aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-07-03 17:00:50 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2017-07-03 17:00:58 +0100
commitc58269ea72f5e8ccbee99c007f52a9d996cc1dd9 (patch)
tree1b4d27fe9a0a9b398c9808bdf91104e2cdcd1d12
parent84e5e9f53b85f816d82a801b03a739adb06a9227 (diff)
downloadvminstall-c58269ea72f5e8ccbee99c007f52a9d996cc1dd9.tar.gz
build-cd-image: Remove dependency on bsdtar
bsdtar doesn't seem to cope with the latest Debian images, and xorriso does everything we need anyway. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rwxr-xr-xbuild-cd-image28
1 files changed, 15 insertions, 13 deletions
diff --git a/build-cd-image b/build-cd-image
index bac3cf3..2febc82 100755
--- a/build-cd-image
+++ b/build-cd-image
@@ -6,15 +6,12 @@ out=tmp/cd
grubcfg=$out/boot/grub/grub.cfg
mkdir $out
-bsdtar -C $out -xf $1
-if [ -d $out/install.a64 ]; then
- # Debian
- kpath=/install.a64
- kname=vmlinuz
-elif [ -d $out/install ] ; then
- # Ubuntu (new)
- kpath=/install
+vmlinuzpath=$(xorriso -dev $1 -sh_style_result on -find / -type f -name vmlinuz 2>/dev/null | cut -f2- -d '/')
+
+if [ "vmlinuzpath" != "" ]; then
+ # Debian, newer Ubuntu
+ kpath=/`dirname $vmlinuzpath`
kname=vmlinuz
else
# Ubuntu
@@ -22,7 +19,11 @@ else
kname=linux
fi
-cp preseed.cfg $out/
+xorriso -dev $1 \
+ -sh_style_result on \
+ -osirrox on \
+ -extract_single /boot/grub/grub.cfg $grubcfg
+
chmod u+w $grubcfg
cat <<EOF >>$grubcfg
menuentry 'Install preseeded' --id preseed {
@@ -35,10 +36,11 @@ default=preseed
timeout=5
EOF
-xorriso -as mkisofs -V 'Debian stretch-DI-seed arm64 1' \
- -r -o $2 -J -joliet-long -cache-inodes \
- -efi-boot-part --efi-boot-image \
- -e boot/grub/efi.img -no-emul-boot $out
+xorriso -indev $1 \
+ -outdev $2 \
+ -map $grubcfg /boot/grub/grub.cfg \
+ -map preseed.cfg /preseed.cfg \
+ -boot_image any replay
chmod -R a+rw $out
rm -rf $out