[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



I attach a patch that fixes this bug.

Now using:

--linux-flavours="amd64:amd64 686"

in a i386 system does install amd64 kernel from amd64 architecture in a
transparent manner.

Please tell me if there's something to be polished so that it's accepted
upstream.

This patch:

* It uses the current git head ( d33943ea7a71ba5d874eb20f47bb898da485c77d )

* Can also be found at:
** Repo: https://github.com/rescatux/live-build.git
** Branch: foreign-architecture-support-quicktest3


adrian15
-- 
Support free software. Donate to Super Grub Disk. Apoya el software
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/
>From 2db746bc858683cee82130caef496376c5bf11f7 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            | 12 ++++++++++++
 scripts/build/chroot_linux-image |  2 +-
 scripts/build/config             |  4 ++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/functions/defaults.sh b/functions/defaults.sh
index 78ca358d1..541cf8a7b 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -475,6 +475,18 @@ Set_defaults ()
 			;;
 	esac
 
+	if [ -z "${LB_PACKAGE_LINUX_FLAVOURS}" ]
+	then
+		LB_PACKAGE_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS}"
+		LB_LINUX_FLAVOURS=""
+		for FLAVOUR in ${LB_PACKAGE_LINUX_FLAVOURS}
+		do
+			PACKAGE_FILTERED_FLAVOUR="$(echo ${FLAVOUR} | awk -F':' '{print $1}')"
+			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS} ${PACKAGE_FILTERED_FLAVOUR}"
+		done
+	fi
+
+
 	# Set linux packages
 	LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux-image}"
 
diff --git a/scripts/build/chroot_linux-image b/scripts/build/chroot_linux-image
index a96c4e529..d06ad8261 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_PACKAGE_LINUX_FLAVOURS}
 do
 	for PACKAGE in ${LB_LINUX_PACKAGES}
 	do
diff --git a/scripts/build/config b/scripts/build/config
index c692a926f..850cbb9b5 100755
--- a/scripts/build/config
+++ b/scripts/build/config
@@ -1116,6 +1116,10 @@ LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES}"
 # (Default: autodetected)
 LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS}"
 
+# \$LB_PACKAGE_LINUX_FLAVOURS: set kernel flavour package to use
+# (Default: autodetected)
+LB_PACKAGE_LINUX_FLAVOURS="${LB_PACKAGE_LINUX_FLAVOURS}"
+
 # \$LB_LINUX_PACKAGES: set kernel packages to use
 # (Default: autodetected)
 LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES}"

Reply to: