Skip to content

Commit

Permalink
Trying to copy the EFI setup from the original Ubuntu ISO (#2361)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalxas committed Jul 31, 2022
1 parent 4377353 commit c7f3202
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/build_chroot.sh
Expand Up @@ -145,6 +145,14 @@ mkdir mnt
sudo mount -o loop "$UBU_ISO" mnt
echo "Lubuntu $ISO_RELEASE $ARCH image mounted."

#Extract iso EFI and MBR partitions
EFI=efi.partition
MBR=mbr.partition
dd if="$UBU_ISO" bs=1 count=446 of="$MBR"
EFISKIP=$(/sbin/fdisk -l "$UBU_ISO" | fgrep '.iso2 ' | awk '{print $2}')
EFISIZE=$(/sbin/fdisk -l "$UBU_ISO" | fgrep '.iso2 ' | awk '{print $4}')
dd if="$UBU_ISO" bs=512 skip="$EFISKIP" count="$EFISIZE" of="$EFI"

#Extract .iso contents into dir 'extract-cd'
mkdir "extract-cd"
rsync --exclude=/casper/filesystem.squashfs -a mnt/ "extract-cd"
Expand Down Expand Up @@ -374,8 +382,8 @@ echo "======================================"
if [ "$ARCH" = "amd64" ] ; then
sudo mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -quiet -b \
boot/grub/i386-pc/eltorito.img -c boot.catalog -no-emul-boot \
-boot-load-size 4 -boot-info-table \
-eltorito-alt-boot -e EFI/boot/grubx64.efi -no-emul-boot \
-boot-load-size 4 -boot-info-table -append_partition 2 0xEF "../$EFI" \
-eltorito-alt-boot -e '--interval:appended_partition_2:all::' -no-emul-boot \
-o ../"$ISO_NAME.iso" .
# sudo isohybrid -u ../"$ISO_NAME.iso"
else
Expand Down

0 comments on commit c7f3202

Please sign in to comment.