[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#884553: live-build: Foreign architecture package support for linux kernel flavours in Stretch



El 23/02/18 a las 17:43, Raphael Hertzog escribió:
> Hi,
> 
> On Sat, 23 Dec 2017, adrian15 wrote:
>> 3) So I dropped that implementation of the patch and searched for
>> something more elegant. A patch that modified the least possible lines
>> of the live-build code and I finally found out how... with this new
>> package based variable that would only have to be used in one specific
>> place.
>>
>> And that's the patch I submitted here in the first place.
> 
> Ok, fine. But we should use more explicit variable names.
> 
> Please modify scripts/build/config to store the value of
> --linux-flavours in LB_LINUX_FLAVOURS_WITH_ARCH and then
> define LB_LINUX_FLAVOURS in functions/defaults.sh
> based on LB_LINUX_FLAVOURS_WITH_ARCH (as you did but with different
> variable names).
> 
> Also update the lb-config manual page to explain that you
> can use architecture qualifier. And you should submit an update
> to live-manual too (see section 8.2.9 Kernel flavour and version).
> https://debian-live.alioth.debian.org/live-manual/stable/manual/html/live-manual.en.html#435
> 
> Please submit both patches as merge requests:
> https://salsa.debian.org/live-team/live-build/merge_requests
> https://salsa.debian.org/live-team/live-manual/merge_requests
> 
> Cheers,

Sorry for the late reply.

I have reworked this a bit.
I no longer use the somewhat artificial LB_PACKAGE_LINUX_FLAVOURS variable.

This patch is based on the current master tip (
2fa258cca25d834f7896b7adc64892dc583010bf ) .

After testing this change the Grub menu which should have two kernel
entries has only one. It might be other of my patches are pending of
applying or somewhat I messed up with this patch.

I know modifying the live-manual package is pending. I prefer waiting
for your feedback on my new implementation before commiting work on
live-manual.

You can find the same commit on this branch:
https://salsa.debian.org/adrian15sgd-guest/live-build/tree/foreign-architecture-support-salsa2018-quicktest4

.

Thank you for your feedback.


adrian15
-- 
Support free software. Donate to Super Grub Disk. Apoya el software
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
>From d8cb285610ff620f62fae4601e99f11e1edd0cb2 Mon Sep 17 00:00:00 2001
From: Adrian Gibanel Lopez <adrian.gibanel@btactic.com>
Date: Fri, 15 Dec 2017 17:22:57 +0000
Subject: [PATCH] Fixed foreign architecture package support to linux kernel
 flavours

This problem originated in Stretch where amd64 kernel is not part of i386 repo.
So it needs to be fetched from amd64 repo.

So first of all you need to enable amd64 foreign architecture in your i386 system
thanks to:

dpkg --add-architecture amd64
apt-get update
.

Once you have done this thanks to this commit
now you can set linux flavours ( --linux-flavours ) as:

"i386 amd64:amd64"

in a i386 system and it will install the amd64 kernel alongside the i386 system.
---
 functions/defaults.sh            | 24 ++++++++++++++++--------
 manpages/en/lb_config.1          |  2 +-
 scripts/build/chroot_linux-image |  2 +-
 scripts/build/config             |  2 +-
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/functions/defaults.sh b/functions/defaults.sh
index c48955104..c1ca10258 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -407,27 +407,27 @@ Set_defaults ()
 	# Setting linux flavour string
 	case "${LB_ARCHITECTURES}" in
 		arm64)
-			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-arm64}"
+			LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-arm64}"
 			;;
 
 		armel)
 			# armel will have special images: one rootfs image and many additional kernel images.
 			# therefore we default to all available armel flavours
-			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-marvell}"
+			LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-marvell}"
 			;;
 
 		armhf)
 			# armhf will have special images: one rootfs image and many additional kernel images.
 			# therefore we default to all available armhf flavours
-			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-armmp armmp-lpae}"
+			LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-armmp armmp-lpae}"
 			;;
 
 		amd64)
-			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-amd64}"
+			LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-amd64}"
 			;;
 
 		i386)
-                        LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-686-pae}"
+                        LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-686-pae}"
 			;;
 
 		ia64)
@@ -438,7 +438,7 @@ Set_defaults ()
 					;;
 
 				*)
-					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-itanium}"
+					LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-itanium}"
 					;;
 			esac
 			;;
@@ -451,7 +451,7 @@ Set_defaults ()
 					;;
 
 				*)
-					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc64 powerpc}"
+					LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-powerpc64 powerpc}"
 					;;
 			esac
 			;;
@@ -464,7 +464,7 @@ Set_defaults ()
 					;;
 
 				*)
-					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-s390x}"
+					LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-s390x}"
 					;;
 			esac
 			;;
@@ -475,6 +475,14 @@ Set_defaults ()
 			;;
 	esac
 
+	LB_LINUX_FLAVOURS=""
+	for FLAVOUR in ${LB_LINUX_FLAVOURS_WITH_ARCH}
+	do
+		ARCH_FILTERED_FLAVOUR="$(echo ${FLAVOUR} | awk -F':' '{print $1}')"
+		LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS} ${ARCH_FILTERED_FLAVOUR}"
+	done
+
+
 	# Set linux packages
 	LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux-image}"
 
diff --git a/manpages/en/lb_config.1 b/manpages/en/lb_config.1
index ac562d209..b23f74374 100644
--- a/manpages/en/lb_config.1
+++ b/manpages/en/lb_config.1
@@ -360,7 +360,7 @@ sets the eraseblock size for a JFFS2 (Second Journaling Flash File System) files
 .IP "\fB\-\-keyring\-packages\fR \fIPACKAGE\fI|""\fIPACKAGES\fR""" 4
 sets the keyring package or additional keyring packages. By default this is set to debian\-archive\-keyring.
 .IP "\-k|\fB\-\-linux\-flavours\fR \fIFLAVOUR\fR|""\fIFLAVOURS\fR""" 4
-sets the kernel flavours to be installed. Note that in case you specify more than that the first will be configured the default kernel that gets booted.
+sets the kernel flavours to be installed. Note that in case you specify more than that the first will be configured the default kernel that gets booted. Optionally you can use an architecture qualifier, e.g. amd64:amd64, so that it works ok when you add a foreign architecture to your build system.
 .IP "\fB\-\-linux\-packages\fR ""\fIPACKAGES\fR""" 4
 sets the internal name of the kernel packages naming scheme. If you use debian kernel packages, you will not have to adjust it. If you decide to use custom kernel packages that do not follow the debian naming scheme, remember to set this option to the stub of the packages only (for debian this is linux\-image\-2.6), so that \fISTUB\fR-\fIFLAVOUR\fR results in a valid package name (for debian e.g. linux\-image\-686\-pae). Preferably you use the meta package name, if any, for the stub, so that your configuration is ABI independent. Also don't forget that you have to include stubs of the binary modules packages for unionfs or aufs, and squashfs if you built them out-of-tree.
 .IP "\fB\-\-losetup\fR losetup|losetup.orig" 4
diff --git a/scripts/build/chroot_linux-image b/scripts/build/chroot_linux-image
index a96c4e529..e34743c1c 100755
--- a/scripts/build/chroot_linux-image
+++ b/scripts/build/chroot_linux-image
@@ -48,7 +48,7 @@ Create_lockfile .lock
 #		;;
 #esac
 
-for FLAVOUR in ${LB_LINUX_FLAVOURS}
+for FLAVOUR in ${LB_LINUX_FLAVOURS_WITH_ARCH}
 do
 	for PACKAGE in ${LB_LINUX_PACKAGES}
 	do
diff --git a/scripts/build/config b/scripts/build/config
index 6c2ab3b7b..caabee402 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -1133,7 +1133,7 @@ LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES}"
 
 # \$LB_LINUX_FLAVOURS: set kernel flavour to use
 # (Default: autodetected)
-LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS}"
+LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS}"
 
 # \$LB_LINUX_PACKAGES: set kernel packages to use
 # (Default: autodetected)
-- 
2.19.1


Reply to: