X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F45-grub-images;h=84bc178fcb8bf7b3ba12eabfbdb07c125cdc46f6;hp=ec652760ac6546e67df1e13cbb236d8d0e2f6b9c;hb=332ae52de9efa6a0ac5c3619823fe547e35828a0;hpb=be6603053d12b4b5a8315360758a10a2bdcee860 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images b/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images index ec65276..84bc178 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images +++ b/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images @@ -1,36 +1,25 @@ #!/bin/bash -# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/45-efi -# Purpose: create grub image for use in ISO for EFI boot +# Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/45-grub-images +# Purpose: create grub images for use in ISO # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. ################################################################################ set -e +set -u +TMP_CONFIG="/tmp/grub_config_efi" -BOOTX64="${target}/boot/bootx64.efi" -EFI_IMG="${target}/boot/efi.img" -TMP_CONFIG="${target}/tmp/grub_config_efi" - -rm -f "$BOOTX64" "$EFI_IMG" "$TMP_CONFIG" - -cat > "$TMP_CONFIG" < "${target}/${TMP_CONFIG}" <&2 - exit 1 - fi - - SIZE=$(du --apparent-size -sk "${target}/${BOOTX64}" | awk -F" " '{print $1}') - SIZE=$(((($SIZE / 32 )+2)*32)) - - dd if=/dev/zero of="${target}/${EFI_IMG}" bs=1k count="$SIZE" 2>/dev/null - $ROOTCMD mkfs.vfat -n GRML "$EFI_IMG" >/dev/null - $ROOTCMD mmd -i "$EFI_IMG" ::EFI - $ROOTCMD mmd -i "$EFI_IMG" ::EFI/BOOT - $ROOTCMD mcopy -i "$EFI_IMG" "$BOOTX64" ::EFI/BOOT/bootx64.efi >/dev/null - echo "Generated EFI image $BOOTX64" - echo "Generated bootx64 image $EFI_IMG" -fi - rm -f "${target}/${TMP_CONFIG}" echo "Generated Grub images" - ## END OF FILE ################################################################# # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2