-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkiso
More file actions
executable file
·30 lines (27 loc) · 802 Bytes
/
mkiso
File metadata and controls
executable file
·30 lines (27 loc) · 802 Bytes
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
#!/usr/bin/env bash
set -Eeuo pipefail
cd $(dirname $1)
# dnf -y install xorriso dosfstools mtools
trap "rm -fr iso_src efiboot.img" EXIT
mkdir -p iso_src/LiveOS
cp --reflink=auto image.squashfs iso_src/LiveOS/squashfs.img
kernel_size=`du -b image_iso.efi | awk '{print \$1}'`
image_size=$((kernel_size + 512000))
rm -f efiboot.img
truncate -s $image_size efiboot.img
mkfs.vfat efiboot.img
mmd -i efiboot.img efi efi/boot
mcopy -i efiboot.img image_iso.efi ::efi/boot/bootx64.efi
xorriso \
-as mkisofs \
-iso-level 3 \
-full-iso9660-filenames \
-volid "LINUX_IPA" \
-eltorito-alt-boot \
-e EFI/efiboot.img \
-no-emul-boot \
-append_partition 2 0xef efiboot.img \
-output image.iso \
-graft-points \
"./iso_src" \
/EFI/efiboot.img=efiboot.img