summaryrefslogtreecommitdiff
path: root/scripts/build/binary_grub-pc
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/binary_grub-pc
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/binary_grub-pc')
-rwxr-xr-xscripts/build/binary_grub-pc34
1 files changed, 34 insertions, 0 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