diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-04-08 20:27:41 +0100 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2020-04-23 15:59:39 +0000 |
commit | bf63762721ddfa497e1b6e4b311178fd68a0b012 (patch) | |
tree | c743fa82a182c433bf593563ac41dfe7669cee17 /scripts/build/binary_grub-pc | |
parent | 49794f118f55570bbccbef649bbf941bbc091ee3 (diff) | |
download | vyos-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-x | scripts/build/binary_grub-pc | 34 |
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 |