Bug#885692: live-build: [Patch] Support building ARM64 live system with EFI boot mechanism

2018-03-01 Thread Raphael Hertzog
Hi,

On Wed, 28 Feb 2018, Steven Shiau wrote:
> > Please find below a few comments that I would like you to take into
> > account. Please submit an updated (and tested) patch via a merge request
> > on https://salsa.debian.org/live-team/live-build
> Yes, I have sent the merge request:
> https://salsa.debian.org/live-team/live-build/merge_requests/2

Thanks, I have left some comments for you to fix.

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#885692: live-build: [Patch] Support building ARM64 live system with EFI boot mechanism

2018-02-28 Thread Steven Shiau
Hi Raphael,

On 02/25/2018 12:53 AM, Raphael Hertzog wrote:
> Hello Steven,
>
> On Fri, 29 Dec 2017, Steven Shiau wrote:
>> Dear Maintainer,
>>
>> Attached please find the patch for creating EFI boot mechanism for ARM64
>> system. It would be great to have this for creating ARM64 Debian live. My 2 
>> cents.
> How did you test the resulting image? On what kind of hardware?
I tested it on a ARM64 server which runs OpenStack, i.e., virtual
machine with ARM64 arch. Besides, I believe it can be done in Qemu
environment, just slower.
> Please find below a few comments that I would like you to take into
> account. Please submit an updated (and tested) patch via a merge request
> on https://salsa.debian.org/live-team/live-build
Yes, I have sent the merge request:
https://salsa.debian.org/live-team/live-build/merge_requests/2
Thanks.

Steven
>
>>  # Checking depends
>> -Check_package chroot /usr/lib/grub/x86_64-efi/configfile.mod 
>> grub-efi-amd64-bin
>> -Check_package chroot /usr/lib/grub/i386-efi/configfile.mod grub-efi-ia32-bin
>> +case "${LB_LINUX_FLAVOURS}" in
> Please test LB_ARCHITECTURES here. The flavours of the kernel do vary over
> time, the architectures much less so. Same for the second case below:
Sure.
>> +case "${LB_LINUX_FLAVOURS}" in
>> +amd64|486|586|686*|generic)
>> +"\${LIVE_BUILD_PATH}/efi-image" 
>> "${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/" "x86_64-efi" "x64" 
>> "debian-live/amd64"
>> +mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
>> +mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/efi.img 
>> '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
>> +cp -r "${_CHROOT_DIR}"/grub-efi-temp-x86_64-efi/* 
>> "${_CHROOT_DIR}/grub-efi-temp/"
>> +
>> +"\${LIVE_BUILD_PATH}/efi-image" 
>> "${_CHROOT_DIR}/grub-efi-temp-i386-efi/" "i386-efi" "ia32" "debian-live/i386"
>> +PATH="\${PRE_EFI_IMAGE_PATH}"
>> +mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
>> +mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-i386-efi/efi.img 
>> '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
>> +cp -r "${_CHROOT_DIR}"/grub-efi-temp-i386-efi/* 
>> "${_CHROOT_DIR}/grub-efi-temp/"
>> +;;
>> +arm64)
>> +"\${LIVE_BUILD_PATH}/efi-image" 
>> "${_CHROOT_DIR}/grub-efi-temp-arm64-efi/" "arm64-efi" "aa64" 
>> "debian-live/arm64"
>> +mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
>> +mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-arm64-efi/efi.img 
>> '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
>> +cp -r "${_CHROOT_DIR}"/grub-efi-temp-arm64-efi/* 
>> "${_CHROOT_DIR}/grub-efi-temp/"
>> +PATH="\${PRE_EFI_IMAGE_PATH}"
>> +;;
>> +esac
> If I read this part correctly, we are doing three time the same thing but
> with different values for each architecture. Please factor out the code in
> a single function that you call three times with appropriate parameters.   
> Cheers,

-- 
Steven Shiau 
Public Key Server PGP Key ID: 4096R/163E3FB0
Fingerprint: EB1D D5BF 6F88 820B BCF5  356C 8E94 C9CD 163E 3FB0



Bug#885692: live-build: [Patch] Support building ARM64 live system with EFI boot mechanism

2018-02-24 Thread Raphael Hertzog
Hello Steven,

On Fri, 29 Dec 2017, Steven Shiau wrote:
> Dear Maintainer,
> 
> Attached please find the patch for creating EFI boot mechanism for ARM64
> system. It would be great to have this for creating ARM64 Debian live. My 2 
> cents.

How did you test the resulting image? On what kind of hardware?

Please find below a few comments that I would like you to take into
account. Please submit an updated (and tested) patch via a merge request
on https://salsa.debian.org/live-team/live-build

>  # Checking depends
> -Check_package chroot /usr/lib/grub/x86_64-efi/configfile.mod 
> grub-efi-amd64-bin
> -Check_package chroot /usr/lib/grub/i386-efi/configfile.mod grub-efi-ia32-bin
> +case "${LB_LINUX_FLAVOURS}" in

Please test LB_ARCHITECTURES here. The flavours of the kernel do vary over
time, the architectures much less so. Same for the second case below:

> +case "${LB_LINUX_FLAVOURS}" in
> + amd64|486|586|686*|generic)
> + "\${LIVE_BUILD_PATH}/efi-image" 
> "${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/" "x86_64-efi" "x64" 
> "debian-live/amd64"
> + mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
> + mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/efi.img 
> '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
> + cp -r "${_CHROOT_DIR}"/grub-efi-temp-x86_64-efi/* 
> "${_CHROOT_DIR}/grub-efi-temp/"
> +
> + "\${LIVE_BUILD_PATH}/efi-image" 
> "${_CHROOT_DIR}/grub-efi-temp-i386-efi/" "i386-efi" "ia32" "debian-live/i386"
> + PATH="\${PRE_EFI_IMAGE_PATH}"
> + mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
> + mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-i386-efi/efi.img 
> '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
> + cp -r "${_CHROOT_DIR}"/grub-efi-temp-i386-efi/* 
> "${_CHROOT_DIR}/grub-efi-temp/"
> + ;;
> + arm64)
> + "\${LIVE_BUILD_PATH}/efi-image" 
> "${_CHROOT_DIR}/grub-efi-temp-arm64-efi/" "arm64-efi" "aa64" 
> "debian-live/arm64"
> + mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
> + mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-arm64-efi/efi.img 
> '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
> + cp -r "${_CHROOT_DIR}"/grub-efi-temp-arm64-efi/* 
> "${_CHROOT_DIR}/grub-efi-temp/"
> + PATH="\${PRE_EFI_IMAGE_PATH}"
> + ;;
> +esac

If I read this part correctly, we are doing three time the same thing but
with different values for each architecture. Please factor out the code in
a single function that you call three times with appropriate parameters.

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#885692: live-build: [Patch] Support building ARM64 live system with EFI boot mechanism

2017-12-28 Thread Steven Shiau

Package: live-build
Version: 1:20171207
Severity: normal
Tags: patch

Dear Maintainer,

Attached please find the patch for creating EFI boot mechanism for ARM64 
system.

It would be great to have this for creating ARM64 Debian live. My 2 cents.

-- Package-specific info:

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.12.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)

Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages live-build recommends:
ii  apt-utils   1.6~alpha5
ii  cpio    2.12+dfsg-6
pn  live-boot-doc   
pn  live-config-doc 
ii  live-manual-html [live-manual]  2:20151217.1
ii  wget    1.19.2-1

live-build suggests no packages.

-- no debconf information

--
Steven Shiau 
Public Key Server PGP Key ID: 4096R/163E3FB0
Fingerprint: EB1D D5BF 6F88 820B BCF5  356C 8E94 C9CD 163E 3FB0

Index: live-build-20171207/scripts/build/binary_grub-efi
===
--- live-build-20171207.orig/scripts/build/binary_grub-efi
+++ live-build-20171207/scripts/build/binary_grub-efi
@@ -41,12 +41,19 @@ Check_lockfile .lock
 Create_lockfile .lock
 
 # Check architecture
-Check_architectures amd64 i386
+Check_architectures amd64 i386 arm64
 Check_crossarchitectures
 
 # Checking depends
-Check_package chroot /usr/lib/grub/x86_64-efi/configfile.mod grub-efi-amd64-bin
-Check_package chroot /usr/lib/grub/i386-efi/configfile.mod grub-efi-ia32-bin
+case "${LB_LINUX_FLAVOURS}" in
+   amd64|486|586|686*|generic)
+   Check_package chroot /usr/lib/grub/x86_64-efi/configfile.mod 
grub-efi-amd64-bin
+   Check_package chroot /usr/lib/grub/i386-efi/configfile.mod 
grub-efi-ia32-bin
+   ;;
+   arm64)
+   Check_package chroot /usr/lib/grub/arm64-efi/configfile.mod 
grub-efi-arm64-bin
+   ;;
+esac
 Check_package chroot /usr/bin/grub-mkimage grub-common
 Check_package chroot /usr/bin/mcopy mtools
 Check_package chroot /sbin/mkfs.msdos dosfstools
@@ -67,7 +74,7 @@ Restore_cache cache/packages.binary
 Install_package
 
 # Cleanup files that we generate
-rm -rf binary/boot/efi.img binary/boot/grub/i386-efi/ 
binary/boot/grub/x86_64-efi
+rm -rf binary/boot/efi.img binary/boot/grub/i386-efi/ 
binary/boot/grub/x86_64-efi binary/boot/grub/arm64-efi
 
 # This is workaround till both efi-image and grub-cpmodules are put into a 
binary package
 case "${LB_BUILD_WITH_CHROOT}" in
@@ -102,16 +109,28 @@ fi
 
 PATH="${PATH}:\${LIVE_BUILD_PATH}" # Make sure grub-cpmodules is used as if it 
was installed in the system
 
-"\${LIVE_BUILD_PATH}/efi-image" "${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/" 
"x86_64-efi" "x64" "debian-live/amd64"
-mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
-mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/efi.img 
'::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
-cp -r "${_CHROOT_DIR}"/grub-efi-temp-x86_64-efi/* 
"${_CHROOT_DIR}/grub-efi-temp/"
-
-"\${LIVE_BUILD_PATH}/efi-image" "${_CHROOT_DIR}/grub-efi-temp-i386-efi/" 
"i386-efi" "ia32" "debian-live/i386"
-PATH="\${PRE_EFI_IMAGE_PATH}"
-mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
-mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-i386-efi/efi.img 
'::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
-cp -r "${_CHROOT_DIR}"/grub-efi-temp-i386-efi/* "${_CHROOT_DIR}/grub-efi-temp/"
+case "${LB_LINUX_FLAVOURS}" in
+   amd64|486|586|686*|generic)
+   "\${LIVE_BUILD_PATH}/efi-image" 
"${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/" "x86_64-efi" "x64" 
"debian-live/amd64"
+   mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
+   mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-x86_64-efi/efi.img 
'::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
+   cp -r "${_CHROOT_DIR}"/grub-efi-temp-x86_64-efi/* 
"${_CHROOT_DIR}/grub-efi-temp/"
+
+   "\${LIVE_BUILD_PATH}/efi-image" 
"${_CHROOT_DIR}/grub-efi-temp-i386-efi/" "i386-efi" "ia32" "debian-live/i386"
+   PATH="\${PRE_EFI_IMAGE_PATH}"
+   mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
+   mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-i386-efi/efi.img 
'::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
+   cp -r "${_CHROOT_DIR}"/grub-efi-temp-i386-efi/* 
"${_CHROOT_DIR}/grub-efi-temp/"
+   ;;
+   arm64)
+   "\${LIVE_BUILD_PATH}/efi-image" 
"${_CHROOT_DIR}/grub-efi-temp-arm64-efi/" "arm64-efi" "aa64" "debian-live/arm64"
+   mkdir -p ${_CHROOT_DIR}/grub-efi-temp/efi/boot
+   mcopy -n -i ${_CHROOT_DIR}/grub-efi-temp-arm64-efi/efi.img 
'::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/efi/boot
+   cp -r