-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ae4bbd
commit 86c0e14
Showing
20 changed files
with
214 additions
and
1,053 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
# Prepare the ISO Directories | ||
mkdir -p "$ISO_MOUNT_DIR" "$ISO_WORK_DIR" "$CHROOT_DIR" | ||
# Mount the Original ISO and Copy Files | ||
echo "mounting $ISO_IMAGE" | ||
if [ ! -f "$ISO_IMAGE" ]; then | ||
echo "Error: ISO file $ISO_IMAGE not found." | ||
exit 1 | ||
fi | ||
mount -o loop "$(pwd)/$ISO_IMAGE" "$ISO_MOUNT_DIR" | ||
rsync -a "$ISO_MOUNT_DIR/" "$ISO_WORK_DIR" | ||
umount "$ISO_MOUNT_DIR" | ||
unsquashfs -d "$CHROOT_DIR" "$ISO_WORK_DIR/casper/filesystem.squashfs" | ||
rm "$(pwd)/$ISO_IMAGE" | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
echo >&2 "===]> Info: Getting Kernel version ... " | ||
echo $T2_KERNEL | ||
# Update GRUB Configuration in ISO | ||
echo >&2 "===]> Info: Copying Linux vmlinuz and initrd ... " | ||
cp "$CHROOT_DIR/boot/vmlinuz-$T2_KERNEL" "$ISO_WORK_DIR/casper/vmlinuz" | ||
cp "$CHROOT_DIR/boot/initrd.img-$T2_KERNEL" "$ISO_WORK_DIR/casper/initrd" | ||
|
||
echo >&2 "===]> Info: Modify existing grub.cfg ..." | ||
sed -i 's/--- quiet splash/boot=casper quiet splash intel_iommu=on iommu=pt pcie_ports=native ---/g' "$ISO_WORK_DIR/boot/grub/grub.cfg" | ||
|
||
echo >&2 "===]> Info: Creating EFI image ... " | ||
dd if=/dev/zero of="$ISO_WORK_DIR/EFI/efiboot.img" bs=1M count=10 | ||
mkfs.vfat "$ISO_WORK_DIR/EFI/efiboot.img" | ||
|
||
mkdir -p /mnt/efiboot | ||
mount "$ISO_WORK_DIR/EFI/efiboot.img" /mnt/efiboot | ||
# Create the EFI/boot directory | ||
mkdir -p /mnt/efiboot/EFI/boot | ||
cp "$ISO_WORK_DIR/EFI/boot/grubx64.efi" /mnt/efiboot/EFI/boot/bootx64.efi | ||
# Clean up EFI temp folders | ||
umount /mnt/efiboot | ||
rmdir /mnt/efiboot | ||
echo >&2 "===]> Info: Generating final ISO ... " | ||
(cd "$ISO_WORK_DIR" && find . -type f -print0 | xargs -0 md5sum > md5sum.txt) | ||
|
||
# Ensure the output directory exists | ||
mkdir -p "$(dirname "$ISO_IMAGE_OUTPUT")" | ||
|
||
xorriso -as mkisofs \ | ||
-iso-level 3 \ | ||
-full-iso9660-filenames \ | ||
-volid "T2-KUBUNTU" \ | ||
-eltorito-boot boot/grub/i386-pc/eltorito.img \ | ||
-no-emul-boot \ | ||
-boot-load-size 4 \ | ||
-boot-info-table \ | ||
-eltorito-alt-boot \ | ||
-eltorito-platform efi \ | ||
-eltorito-boot EFI/efiboot.img \ | ||
-no-emul-boot \ | ||
-isohybrid-gpt-basdat \ | ||
-isohybrid-apm-hfsplus \ | ||
-output ${ISO_IMAGE_OUTPUT} \ | ||
${ISO_WORK_DIR} | ||
|
||
echo >&2 "===]> Info: Custom ISO creation process complete. Find the ISO at ${ISO_IMAGE_OUTPUT} ..." | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.