-
Notifications
You must be signed in to change notification settings - Fork 0
/
iso.sh
executable file
·46 lines (35 loc) · 1.07 KB
/
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
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -eu
tmp="$(mktemp -d iso.XXX)"
tarball="builds/$PACKER_BUILD_NAME.tar"
for dir in chroot isolinux live; do
install -o root -g root -m 0755 -d "$tmp/$dir"
done
tar -xp -C "$tmp/chroot" -f "$tarball"
(
cd "$tmp"
mksquashfs chroot live/filesystem.squashfs -comp xz -e boot
cp chroot/boot/vmlinuz-* live/vmlinuz
cp chroot/boot/initrd.img-* live/initrd
rm -rf chroot
cp /usr/lib/ISOLINUX/isolinux.bin \
/usr/lib/syslinux/modules/bios/menu.c32 \
/usr/lib/syslinux/modules/bios/ldlinux.c32 \
/usr/lib/syslinux/modules/bios/libutil.c32 \
/usr/lib/syslinux/modules/bios/libmenu.c32 \
/usr/lib/syslinux/modules/bios/libcom32.c32 \
/usr/lib/syslinux/modules/bios/libgpl.c32 \
isolinux
)
cp packer/files/isolinux.cfg "$tmp/isolinux/isolinux.cfg"
xorriso \
-as mkisofs \
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-output "builds/$PACKER_BUILD_NAME.iso" \
"$tmp"
rm -rf "$tmp" "$tarball"