#879147 debian-ports support when installing the kernel and extra packages

#879147#5
Date:
2017-10-19 20:07:15 UTC
From:
To:
Dear Maintainer,

bootstrap-base installs a kernel and some extra packages as its last
steps ('install_kernel' and 'install_extra').

The patch below enables the use of the 'unreleased' distribution on
non released architectures during these steps. (A file 'port_architecture'
should be created previously by another package, e.g.
choose-mirror-bin. See #879130)

Regards,
JH Chatenet
--- a/library.sh
+++ b/library.sh
@@ -873,6 +873,11 @@
 		APTSOURCE="$PROTOCOL://$MIRROR$DIRECTORY"

 		echo "deb $APTSOURCE $DISTRIBUTION $COMPONENTS" > $APT_SOURCES
+
+		if [ -e /usr/lib/choose-mirror/port_architecture ]; then
+			# Port architectures use both suites 'unstable' and 'unreleased'
+			echo "deb $APTSOURCE unreleased $COMPONENTS" >> $APT_SOURCES
+		fi
 	fi
 }

#879147#10
Date:
2020-08-04 15:46:00 UTC
From:
To:
Hi,

Here is an updated patch proposal. It is supposed that the
relevant parts [2] of the patch proposal [1] for
bug #964248 are applied.

I hope it will help to find a solution.

Regards,
JH Chatenet

[1] : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964248#52
[2] : Here is an excerpt of the patch proposal for bug #964248. It sets
the variable 'is_ports_architecture' and defines a debconf variable
'base-installer/no_unreleased'. Both are used in this patch proposal.
---------------------8<---------------------------8<------------------ diff -Naur a/base-installer-1.195/debian/bootstrap-base.templates b/base-installer-1.195/debian/bootstrap-base.templates --- a/base-installer-1.195/debian/bootstrap-base.templates 2019-11-17 22:17:31.000000000 +0100 +++ b/base-installer-1.195/debian/bootstrap-base.templates 2020-08-04 12:17:13.288662639 +0200 @@ -452,3 +452,10 @@ Type: string Description: for internal use; can be preseeded Force use of a specific debootstrap script + +Template: base-installer/no_unreleased +Type: boolean +Default: false +Description: for internal use; can be preseeded + Do not consider packages from the unreleased distribution. + diff -Naur a/base-installer-1.195/library.sh b/base-installer-1.195/library.sh --- a/base-installer-1.195/library.sh 2020-07-05 21:34:10.000000000 +0200 +++ b/base-installer-1.195/library.sh 2020-08-04 12:22:18.410175655 +0200 @@ -888,13 +888,9 @@ rm -f "$KERNEL_LIST" "$KERNEL_LIST.unfiltered" }
#879147#15
Date:
2020-08-19 09:38:38 UTC
From:
To:
Hi,

here is a revised version of a patch proposal
with more detailed log outputs.

I hope it will help !

Regards,
JH Chatenet

# Allows for packages in the 'unreleased' distribution at the
# configure_apt stage on unreleased architectures from the
# Debian-Ports repository.
#
# configure_apt sets up a temporary sources.list file which is used to
# install kernel packages or extra packages at install_kernel and
# install_extra stages. The requested packages may be found in the
# 'unreleased' distribution on debian-ports architectures.

diff -Naur a/base-installer/library.sh b/base-installer/library.sh
--- a/base-installer/library.sh	2020-08-17 11:16:15.000000000 +0200
+++ b/base-installer/library.sh	2020-08-18 15:08:06.890694142 +0200
@@ -881,6 +881,25 @@
 		APTSOURCE="$PROTOCOL://$MIRROR$DIRECTORY"

 		echo "deb $APTSOURCE $DISTRIBUTION $COMPONENTS" > $APT_SOURCES
+
+		if [ "$is_ports_architecture" != "1" ] || \
+			[ "$DISTRIBUTION" != "sid" ] && \
+			[ "$DISTRIBUTION" != "unstable" ]; then
+			# This is a released architecture : nothing to do
+			:
+		else # This is an unreleased architecture in the Debian-Ports repository
+			log "Debian-Ports architecture detected"
+			# Both suites 'unstable' and 'unreleased' may be needed
+
+			# Did the user decline to consider the 'unreleased' suite ?
+			# (e.g. if installing from a custom mirror without 'unreleased')
+			if ! db_get base-installer/no_unreleased || [ "$RET" != true ]; then
+				echo "deb $APTSOURCE unreleased $COMPONENTS" >> $APT_SOURCES
+				log "Using the 'unreleased' distribution"
+			else
+				log "As requested the 'unreleased' distribution is skipped"
+			fi
+		fi
 	fi
 }

#879147#20
Date:
2021-02-20 00:34:07 UTC
From:
To:
Hello,

For information, I submitted a couple of fixes for the unreleased
distribution in debian-cd, it now behaves fine when setting UNRELEASED=1
in CONF.sh: it includes packages from the unreleased distribution in the
sid distribution of the CD. Also, I switched to using LOCAL=1,
LOCALDEBS and UPDATE_LOCAL=1, which is indeed enough to select any few
packages from unreleased for the bootstrap part.

Samuel