T2-Ubuntu/03_prepare_iso.sh
2020-07-20 17:35:10 +02:00

37 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -eu -o pipefail
echo >&2 "===]> Info: Create ISO Image for a LiveCD... "
cd "${IMAGE_PATH}"
### Create a grub UEFI image
grub-mkstandalone \
--format=x86_64-efi \
--output=isolinux/BOOTx64.EFI \
--locales="" \
--fonts="" \
"boot/grub/grub.cfg=isolinux/grub.cfg"
### Create a FAT16 UEFI boot disk image containing the EFI bootloader
(
cd isolinux &&
dd if=/dev/zero of=efiboot.img bs=1M count=10 &&
mkfs.vfat efiboot.img &&
LC_CTYPE=C mmd -i efiboot.img EFI EFI/BOOT &&
LC_CTYPE=C mcopy -i efiboot.img ./BOOTx64.EFI ::EFI/BOOT/
)
### Create a grub BIOS image
grub-mkstandalone \
--format=i386-pc \
--output=isolinux/core.img \
--install-modules="linux16 linux normal iso9660 biosdisk memdisk search tar ls" \
--modules="linux16 linux normal iso9660 biosdisk search" \
--locales="" \
--fonts="" \
"boot/grub/grub.cfg=isolinux/grub.cfg"
### Combine a bootable grub cdboot.img
cat "/usr/lib/grub/i386-pc/cdboot.img" "${IMAGE_PATH}/isolinux/core.img" \
>"${IMAGE_PATH}/isolinux/bios.img"