Bug#879147: debian-ports support when installing the kernel and extra packages
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"
}
-is_ports_architecture() {
- case "$1" in
- alpha|hppa|hurd-i386|ia64|kfreebsd-amd64|kfreebsd-i386|m68k|powerpc|ppc64|riscv64|sh4|sparc64|x32)
- return 0
- ;;
- *)
- return 1
- ;;
- esac
-}
+is_ports_architecture=
+if [ -r /usr/lib/choose-mirror/port_architecture ]; then
+ log "Debian-Ports architecture detected"
+ is_ports_architecture=$(cat /usr/lib/choose-mirror/port_architecture)
+fi
+
---------------------8<---------------------------8<------------------
And here is the patch proposal :
# 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-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:49:33.410283183 +0200
@@ -881,6 +881,23 @@
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
+ # 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
+ else
+ log "As requested the 'unreleased' distribution is skipped"
+ fi
+ fi
fi
}
Reply to: