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

Bug#881941: live-build: Creation of .disk/mkisofs is broken



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

Hi,

currently .disk/mkisofs gets created by appending an echo statement to
the temporary script binary.sh whicht gets executed to actually run xorriso.

However this creates the following error in build.log:

---------------8<-------------------
[...]
[2017-11-16 20:52:38] lb binary_checksums
P: Begin creating binary md5sum.txt...
[2017-11-16 20:52:38] lb binary_iso
P: Begin building binary iso image...
The following NEW packages will be installed:
  isolinux libburn4{a} libisoburn1{a} libisofs6{a} libjte1{a} xorriso
The following packages are RECOMMENDED but will NOT be installed:
  syslinux-common
0 packages upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 1154 kB of archives. After unpacking 2367 kB will be used.
Get: 1 http://ftp.debian.org/debian stretch/main amd64 isolinux all 3:6.03+dfsg-14.1 [94.0 kB]
Get: 2 http://ftp.debian.org/debian stretch/main amd64 libburn4 amd64 1.4.6-1 [156 kB]
Get: 3 http://ftp.debian.org/debian stretch/main amd64 libjte1 amd64 1.20-2+b1 [28.4 kB]
Get: 4 http://ftp.debian.org/debian stretch/main amd64 libisofs6 amd64 1.4.6-1 [198 kB]
Get: 5 http://ftp.debian.org/debian stretch/main amd64 libisoburn1 amd64 1.4.6-1+b1 [379 kB]
Get: 6 http://ftp.debian.org/debian stretch/main amd64 xorriso amd64 1.4.6-1+b1 [299 kB]
Fetched 1154 kB in 0s (2760 kB/s)
[...]
Setting up libisofs6:amd64 (1.4.6-1) ...
Setting up libisoburn1:amd64 (1.4.6-1+b1) ...
Setting up xorriso (1.4.6-1+b1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...

xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A Debian Live -p live-build 1:20170920
binary.sh: 4: binary.sh: https://debian-live.alioth.debian.org/live-build -publisher Live: not found
binary.sh: 4: binary.sh: https://debian-live.alioth.debian.org/: not found
binary.sh: 4: binary.sh: debian-live@lists.debian.org -V Debian: not found
xorriso 1.4.6 : RockRidge filesystem manipulator, libburnia project.
[...]
--------------->8-------------------





binary.sh, as generated by binary_iso, contains:
---------------8<-------------------
# cat chroot/binary.sh
#!/bin/sh

mkdir -p binary/.disk
echo "xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Debian Live" -p "live-build 1:20170920; https://debian-live.alioth.debian.org/live-build"; -publisher "Live Systems project; https://debian-live.alioth.debian.org/; debian-live@lists.debian.org" -V "Debian stretch 20171116-20:52" --modification-date=2017111619114000 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot  -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus -o live-image-amd64.hybrid.iso binary" > binary/.disk/mkisofs
xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Debian Live" -p "live-build 1:20170920; https://debian-live.alioth.debian.org/live-build"; -publisher "Live Systems project; https://debian-live.alioth.debian.org/; debian-live@lists.debian.org" -V "Debian stretch 20171116-20:52" --modification-date=2017111619114000 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot  -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus -o live-image-amd64.hybrid.iso binary
--------------->8-------------------


As you can see, the pairs of quotes in the echo line don't match up as
intended:


echo "xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes -iso-level \
     ^--- open #1



[...] -partition_offset 16 -A "Debian Live" -p "live-build 1:20170920;[...]
                  close #1 ---^   open#2--^    ^---close #2
                                                 \------------v------------/
                                                       interpreted by sh



Subsequently, the generated .disk/mkisofs is empty.






The attached patch moves the generation of .disk/mkisofs out of binary.sh and
back to the enclosing binary_iso, replacing echo by a HERE document which is
not prone to this kind of issue.






With this patch applied, build.log no longer shows "not found" errors and the
generated .disk/mkisofs contains:

---------------8<-------------------
xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Debian Live" -p "live-build 1:20170920; https://debian-live.alioth.debian.org/live-build"; -publisher "Live Systems project; https://debian-live.alioth.debian.org/; debian-live@lists.debian.org" -V "Debian stretch 20171116-21:12" --modification-date=2017111620114500 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot  -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus -o live-image-amd64.hybrid.iso binary
--------------->8-------------------




Cheers
Daniel
diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso
index 6ddb9dd09..1ca460c02 100755
--- a/scripts/build/binary_iso
+++ b/scripts/build/binary_iso
@@ -214,7 +214,11 @@ fi
 cat >> binary.sh << EOF
 
 mkdir -p binary/.disk
-echo "xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary" > binary/.disk/mkisofs
+xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary
+EOF
+
+# retain the xorriso command used to create the image in the image itself
+cat <<-EOF >binary/.disk/mkisofs
 xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary
 EOF
 

Reply to: