|
47 | 47 | exit 1
|
48 | 48 | fi
|
49 | 49 |
|
| 50 | +mbr="boot_hybrid.img" |
| 51 | + |
| 52 | +efi="ubuntu22-desktop-amd64.efi" |
| 53 | + |
| 54 | +# Extract the MBR template (used for "Make image" below) |
| 55 | + |
| 56 | +dd if="$ISO_PATH" bs=1 count=446 of=$mbr |
| 57 | + |
| 58 | +# Extract EFI partition image (used for "Make image" below) |
| 59 | + |
| 60 | +skip=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $2}') |
| 61 | + |
| 62 | +size=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $4}') |
| 63 | + |
| 64 | +dd if="$ISO_PATH" bs=512 skip="$skip" count="$size" of=$efi |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
50 | 69 | BUILD_FILES_COPY_DESTINATION="squashfs-root/mnt"
|
51 | 70 | TMP_MOUNT_POINT="squashfs-root/tmp"
|
52 | 71 |
|
|
75 | 94 |
|
76 | 95 | build/extract_iso.sh "$ISO_PATH" iso
|
77 | 96 |
|
| 97 | +if [ "$DELETE_DOWNLOADED_ISO" = "true" ] # Useful for CI, that otherwise might run out of space |
| 98 | +then |
| 99 | + sudo rm -f $ISO_PATH |
| 100 | +fi |
| 101 | + |
78 | 102 | # Unsquash and customize
|
79 | 103 | sudo unsquashfs -force iso/casper/filesystem.squashfs > /dev/null
|
80 | 104 |
|
@@ -131,22 +155,6 @@ cd ..
|
131 | 155 | # Cleanup and unmount our tmp from squashfs-root
|
132 | 156 | unmount_cleanup
|
133 | 157 |
|
134 |
| -mbr="boot_hybrid.img" |
135 |
| - |
136 |
| -efi="ubuntu22-desktop-amd64.efi" |
137 |
| - |
138 |
| -# Extract the MBR template |
139 |
| - |
140 |
| -dd if="$ISO_PATH" bs=1 count=446 of=$mbr |
141 |
| - |
142 |
| -# Extract EFI partition image |
143 |
| - |
144 |
| -skip=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $2}') |
145 |
| - |
146 |
| -size=$(/sbin/fdisk --list "$ISO_PATH" | grep --fixed-strings '.iso2 ' | awk '{print $4}') |
147 |
| - |
148 |
| -dd if="$ISO_PATH" bs=512 skip="$skip" count="$size" of=$efi |
149 |
| - |
150 | 158 | # Make image
|
151 | 159 |
|
152 | 160 | xorriso -as mkisofs -r -V "$IMAGE_NAME" -o "$IMAGE_NAME".iso -J -joliet-long -l -iso-level 3 -partition_offset 16 --grub2-mbr $mbr --mbr-force-bootable -append_partition 2 0xEF $efi -appended_part_as_gpt -c boot.catalog -b boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info -eltorito-alt-boot -e '--interval:appended_partition_2:all::' -no-emul-boot iso
|
0 commit comments