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

2019-03-03 Thread adrian15
El 20/11/18 a las 14:19, Raphael Hertzog escribió:

Sorry for the delay in answering but I have been busy.

> Hi,
> 
> On Sun, 18 Nov 2018, adrian15 wrote:
>> 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.
> 
> It's up to you to figure this. I won't do it for you. And I won't merge
> the patch until you have something working entirely.

I understand.
I think I was talking aloud because I wish I had no difference from my
live-build fork to the upstream one (The Debian one) but there are still
differences nowadays.

I will try the patch as an standalone patch without merging it with my
other patches. That way I can prove the modifications are right.

Anyways let's continue answering the email.

> 
>> 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.
> 
> The attached patch looks acceptable. The only small comments are below:

Ok.

> 
>> 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.
> 
> This should really be part of the documentation (manual page) because
> right now the explanation is not clear on what it brings:
> 
>>  .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.
> 
> That's the part to be expanded.

Ok, I'll try to do something on it.

> 
>> --- 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}"
> 
> I think you need to update all 3 occurences of LB_LINUX_FLAVOURS in this
> hunk... not only the name of the variable being assigned.

The reason why I didn't renamed everything to
LB_LINUX_FLAVOURS_WITH_ARCH was so that any project relying on the old
variable LB_LINUX_FLAVORUS did work without having to update its
configuration.


I don't have too much time so I will use the long name as you suggested
and probably update some related documentation, changelog or something.


> 
> Cheers,
> 

adrian15
-- 
Support free software. Donate to Super Grub Disk. Apoya el software
libre. Dona a Super Grub Disk. http://www.supergrubdisk.org/donate/



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

2018-11-20 Thread Raphael Hertzog
Hi,

On Sun, 18 Nov 2018, adrian15 wrote:
> 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.

It's up to you to figure this. I won't do it for you. And I won't merge
the patch until you have something working entirely.

> 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.

The attached patch looks acceptable. The only small comments are below:

> 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.

This should really be part of the documentation (manual page) because
right now the explanation is not clear on what it brings:

>  .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.

That's the part to be expanded.

> --- 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}"

I think you need to update all 3 occurences of LB_LINUX_FLAVOURS in this
hunk... not only the name of the variable being assigned.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/



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

2018-11-18 Thread adrian15
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 
Date: Fri, 15 Dec 2017 17:22:57 +
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 ()
 	;;
 
 *)
-	

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

2018-02-23 Thread Raphael Hertzog
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,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/



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

2017-12-23 Thread adrian15
El 21/12/17 a las 14:11, Raphael Hertzog escribió:
> Hi,
> 
> On Sat, 16 Dec 2017, adrian15 wrote:
>> 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.
> 
> Your patch does nothing except dropping the ":amd64" suffix. You could
> just as well not use the suffix and use your system where you manually
> enabled the foreign architecture.
> 
> I would have expected your patch to somehow add the foreign architecture
> to the build chroot and figure it out from there.
> 
> As it stands, I don't see the point of this patch.
> 
> Cheers,

  I wanted to spare you the long explanation but here it goes.

1) live-build already enables the foreign architecture in linux flavour
associated packages



https://anonscm.debian.org/cgit/debian-live/live-build.git/tree/scripts/build/chroot_install-packages?id=acafe6618bfb7a9f7525e723e13ade2956e10b4f#n45

That: packages.foreign-architectures file gets created at:

https://anonscm.debian.org/cgit/debian-live/live-build.git/tree/scripts/build/chroot_package-lists?id=acafe6618bfb7a9f7525e723e13ade2956e10b4f#n80

which it's reading: packages.chroot file.

packages.root file is being feed up with the linux flavour packages in:

https://anonscm.debian.org/cgit/debian-live/live-build.git/tree/scripts/build/chroot_linux-image?id=acafe6618bfb7a9f7525e723e13ade2956e10b4f#n51



2) My first implementation of this patch tried not to invent a new
package variable (which would keep the :amd64 package suffix) but to
invent a new filename variable so that further code regarding installing
different linux kernel filenames did not fail later in the code.

I mean:

DEFAULT_KERNEL="$(basename chroot/boot/vmlinuz-*${DEFAULT_FLAVOUR})"

would have translated to:

DEFAULT_KERNEL="$(basename chroot/boot/vmlinuz-*amd64:amd64)"

and there is no such installed files with those filenames.

You can check it here:
https://github.com/rescatux/live-build/commit/25bbc377a2e9ca67240f7a396f53637426ba4eb6


I discarded myself this implementation because it modifies too many
lines (Occam's razor reference) and seems too much of an artificial fix.


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.



  Do you prefer my discarded implementation? The one I sent initially?
Or is it a better way of approaching this problem?

  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/



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

2017-12-21 Thread Raphael Hertzog
Hi,

On Sat, 16 Dec 2017, adrian15 wrote:
> 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.

Your patch does nothing except dropping the ":amd64" suffix. You could
just as well not use the suffix and use your system where you manually
enabled the foreign architecture.

I would have expected your patch to somehow add the foreign architecture
to the build chroot and figure it out from there.

As it stands, I don't see the point of this patch.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/



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

2017-12-16 Thread adrian15
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 
Date: Fri, 15 Dec 2017 17:22:57 +
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}"


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

2017-12-16 Thread adrian15
Package: live-build
Version: 1:20171207
Severity: normal

Dear Maintainer,

   * Introduction

Jessie had linux-amd64 package in its own i386 section.
Stretch has linux-amd64 package not in i386 section but in amd64 section
only.
When using live-build with Jessie you could use in an i386 Jessie system
this option:
 --linux-flavours="amd64 586"
in order to the amd64 kernel to be installed alongside the 586 kernel in
the same live cd image.

   * What led up to the situation?

Trying to rewrite a live-build configuration from Jessie to Stretch:
 --linux-flavours="amd64 686"

   * What exactly did you do (or not do) that was effective (or
 ineffective)?

I tried this option (using live-build in Stretch):
 --linux-flavours="amd64:amd64 686"

   * What was the outcome of this action?

It failed because linux-image-amd64:amd64-* path for kernel filenames
are not found.

   * What outcome did you expect instead?

I expected the linux-image-amd64:amd64 to be installed and the appropiated
foreign architecture (amd64) to be added in an i386 system.


-- System Information:
Debian Release: 9.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8),
LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages live-build depends on:
ii  debootstrap  1.0.89

Versions of packages live-build recommends:
ii  apt-utils   1.4.8
ii  cpio2.11+dfsg-6
pn  live-boot-doc   
pn  live-config-doc 
pn  live-manual-html | live-manual  
ii  wget1.18-5+deb9u1

live-build suggests no packages.