X-Git-Url: http://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F45-grub-images;h=16c0e9a195d4e44cd8abb56b8c5cb8160f8f91a7;hp=6dfbf58eeeb79a9c2157e027d0f1da2424c00a49;hb=642e1b389347bcb8d6e44b483c327e45225427f4;hpb=3429ac6a274e3fd1ba0466b4b19b3effeb8b7bd4 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images b/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images index 6dfbf58..16c0e9a 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images +++ b/etc/grml/fai/config/scripts/GRMLBASE/45-grub-images @@ -1,36 +1,30 @@ #!/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" +# this allows us to find this specific Grml ISO, +# even if there are multiple Grml ISOs present +bootfile="${GRML_NAME}_$(TZ=UTC date +%s)" +echo "$bootfile" > "${target}/"boot/grub/bootfile.txt -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