[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to create a custom Debian ISO



Hi,

in the second part of this mail i discuss a possible problem with script
04_create_iso.sh about bootability on Legacy BIOS from USB stick.
(I apologize already now for being off topic by talking about an Ubuntu
ISO.)


Roland Clobus wrote:
> Thanks for pointing to live-build :-)

Just connecting my users. :))


> > > [1] https://github.com/t2linux/T2-Ubuntu/tree/LTS
I wrote:
> > Just out of pure curiosity: From what script in particular do you get
> > this impression ?

Roland Clobus wrote:
> The scripts with the sequence numbers 01-04 mirror the steps that are done
> in live-build,

01_build_file_system.sh looks quite debianish. (Not my turf.)
02_build_image.sh mentions squashfs, which is indeed typical for Live ISOs.
But as said, with Ubuntu desktop there is no non-Live ISO.
03_prepare_iso.sh prepares bootloader files.
(I know the topics of 02 and 03 only as bystander.)

----------------------------------------------------------------------
Now for the announced discussion of a possible problem in the production
of derived Ubuntu ISOs:

04_create_iso.sh looks on the first glimpse like producing a usual amd64
hybrid ISO for {Legacy,EFI} x {DVD,HDD}, but in detail it is somewhat
riddling:

  20   --grub2-mbr "/usr/lib/grub/i386-pc/boot_hybrid.img" \
  ...
  24   -isohybrid-mbr "${ROOT_PATH}/files/isohdpfx.bin" \

First xorriso is instructed to use boot_hybrid.img as MBR with some extra
info for GRUB.
But then this is overridden by the instruction to use isohdpfx.bin as MBR
with some extra info for ISOLINUX/SYSLINUX.

In my local experiments this leads to dysfunctional MBR code because
-isohybrid-mbr works its magic only if a ISOLINUX boot image for El Torito
is present. But i understand from 03_prepare_iso.sh that the image file
given by option -b is despite its name "isolinux/bios.img" concatenated
from GRUB files cdboot.img and core.img.

I wonder whether "T2 Macs" would be able to boot via MBR code at all.
That would be EFI in CSM mode and ISO on USB stick.
Does this work with the currently produced ISOs ?

Obviously i am not smart enough to find one of the resulting ISOs in the
web for inspection. Shrug.

Can it be that -isohybrid-mbr was used because else
  25   -isohybrid-gpt-basdat -isohybrid-apm-hfsplus \
would cause an error ?
If so, then option

  -part_like_isohybrid

might be the better alternative because it does not override the
preparation for using boot_hybrid.img as --grub2-mbr.
If i replace in my experiment the line
  -isohybrid-mbr "${ROOT_PATH}/files/isohdpfx.bin" \
by -part_like_isohybrid, then i get an ISO where xorriso can recognize
an MBR with the patched-in extra info caused by option --grub2-mbr.
The partition table is more sparse than with a real ISOLINUX MBR. But
it marks the EFI partition in MBR and (pseudo-)GPT.


Whatever, current Ubuntu desktop ISOs do not use -isohybrid-gpt-basdat
and -isohybrid-apm-hfsplus any more.
One may run e.g.:

  xorriso -indev ubuntu-22.04.3-desktop-amd64.iso -report_el_torito as_mkisofs

to see -append_partition , -appended_part_as_gpt ,
and -e '--interval:appended_partition_2:all::' serving instead of
-part_like_isohybrid (or -isohybrid-mbr), -e "EFI/efiboot.img", and
-isohybrid-gpt-basdat .


Have a nice day :)

Thomas


Reply to: