-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
03_prepare_iso.sh
executable file
·36 lines (31 loc) · 1.02 KB
/
03_prepare_iso.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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"