summaryrefslogtreecommitdiff
path: root/scripts/build
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-04-08 20:27:41 +0100
committerRaphaƫl Hertzog <hertzog@debian.org>2020-04-23 15:59:39 +0000
commitbf63762721ddfa497e1b6e4b311178fd68a0b012 (patch)
treec743fa82a182c433bf593563ac41dfe7669cee17 /scripts/build
parent49794f118f55570bbccbef649bbf941bbc091ee3 (diff)
downloadvyos-live-build-bf63762721ddfa497e1b6e4b311178fd68a0b012.tar.gz
vyos-live-build-bf63762721ddfa497e1b6e4b311178fd68a0b012.zip
move grub-pc specific code to actual grub-pc script
the grub-pc image creation code has no business being in binary_iso, it should be in binary_grub-pc. it should be noted that the binary_iso script did not even have the necessary package check for grub-mkimage, while binary_grub-pc did have it, pointlessly. Gbp-Dch: Short
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/binary_grub-pc34
-rwxr-xr-xscripts/build/binary_iso22
2 files changed, 34 insertions, 22 deletions
diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc
index 85074a486..86e0ac431 100755
--- a/scripts/build/binary_grub-pc
+++ b/scripts/build/binary_grub-pc
@@ -74,6 +74,40 @@ fi
# Copying grub
cp ${FILES} binary/boot/grub/i386-pc
+# Create eltorito image for ISO cases
+if [ "${LIVE_IMAGE_TYPE}" = "iso" ] || [ "${LIVE_IMAGE_TYPE}" = "iso-hybrid" ]; then
+
+ cat > binary.sh << EOF
+#!/bin/sh
+
+INPUT_DIR="/usr/lib/grub/i386-pc"
+
+# build core.img
+CORE_IMG=\$(mktemp)
+grub-mkimage -d \${INPUT_DIR} -o \${CORE_IMG} -O i386-pc --prefix=/boot/grub biosdisk iso9660
+
+# build grub_eltorito image
+cat \${INPUT_DIR}/cdboot.img \${CORE_IMG} > grub_eltorito
+
+rm -f \${CORE_IMG}
+EOF
+
+ case "${LB_BUILD_WITH_CHROOT}" in
+ true)
+ mv binary.sh chroot
+ Chroot chroot "sh binary.sh"
+ mv chroot/grub_eltorito binary/boot/grub/grub_eltorito
+ rm -f chroot/binary.sh
+ ;;
+
+ false)
+ sh binary.sh
+ mv grub_eltorito binary/boot/grub/grub_eltorito
+ rm -f binary.sh
+ ;;
+ esac
+fi
+
# Saving cache
Save_package_cache binary
diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso
index f2a166cf7..9952b0c51 100755
--- a/scripts/build/binary_iso
+++ b/scripts/build/binary_iso
@@ -160,30 +160,8 @@ done
# XORRISO_OPTIONS="${XORRISO_OPTIONS} -m ${XORRISO_EXCLUDE}"
#fi
-if [ "${LB_FIRST_BOOTLOADER}" = "grub-pc" ]
-then
-
cat > binary.sh << EOF
#!/bin/sh
-
-input_dir=/usr/lib/grub/i386-pc
-
-# build core.img
-core_img=\$(mktemp)
-grub-mkimage -d \${input_dir} -o \${core_img} -O i386-pc --prefix=/boot/grub biosdisk iso9660
-
-# build grub_eltorito image
-cat \${input_dir}/cdboot.img \${core_img} > binary/boot/grub/grub_eltorito
-
-rm -f \${core_img}
-EOF
-
-else
- echo "#!/bin/sh" > binary.sh
-fi
-
-cat >> binary.sh << EOF
-
mkdir -p binary/.disk
xorriso -as mkisofs ${XORRISO_OPTIONS} -o ${IMAGE} binary
EOF