util/grub-mkrescue: specify -iso-level 3 in xorriso options
PATCH 1/1 util/grub-mkrescue: specify -iso-level 3 in xorriso options
This is needed for architectures whose EFI executables has file names that exceeds the 8.3 (extension.suffix) convention, such as LoongArch64 (bootloongarch64.efi).
--- util/grub-mkrescue.c | 2 ++ 1 file changed, 2 insertions(+)
util/grub-mkrescue.c +2 -0
@@ -514,6 +514,8 @@ main (int argc, char *argv[])xorriso_push ("-as" );xorriso_push ("mkisofs" );xorriso_push ("-graft-points" ); +xorriso_push ("-iso-level" ); +xorriso_push ("3" ); iso9660_dir =grub_util_make_temporary_dir ();grub_util_info ("temporary iso9660 dir is `%s'" , iso9660_dir);
Signature · 6 lines
2.39.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Hi,
Quoted 3 lines · Mingcong Bai
This is needed for architectures whose EFI executables has file names that exceeds the 8.3 (extension.suffix) convention, such as LoongArch64 (bootloongarch64.efi).
In general -iso-level 3 is a harmless setting if the reading operating system is Linux or MS-Windows. On other reading system your mileage may vary. In any case level 3 is harmless if it is not actually needed, i.e. all file names are 8.3 and all files are smaller than 4 GiB.
But i wonder:
- Why level 3 and not 2 ?
If it is only about file name length, then -iso-level 2 would suffice and not enable file sizes of 4 GiB and larger. Such files have to be represented by more than one extent, which might be not supported by the BSDs and other systems.
Especially in grub-core/fs/iso9660.c function grub_iso9660_read() i see a remark: "XXX: The file is stored in as a single extent" and cannot spot provisions to read more than one directory entry per file. So i doubt that GRUB is prepared for multi-extent files.
(If somebody wants to test: libcdio has a small ISO image
https://git.savannah.gnu.org/cgit/libcdio.git/tree/test/data/multi_extent_8k.iso
of size 122 KB with artificially small extent size. So its file /multi_extent_file bears 8 extents although it has only 54 KB of size. Compare GRUB's representation of the file with that of GNU/Linux.)
- Why is the name bootloongarch64.efi a problem in the ISO filesystem ?
The name length restriction of -iso-level 1 applies only to the dull ISO 9660 names, but not to Rock Ridge names, which GRUB uses if present. (Other than mkisofs or genisoimage, xorriso produces Rock Ridge by
default. Just don't use option --norock.)
Have a nice day :)
Thomas
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Hi,
Quoted 4 lines
- Why is the name bootloongarch64.efi a problem in the ISO filesystem ?
The name length restriction of -iso-level 1 applies only to the dull ISO 9660 names, but not to Rock Ridge names, which GRUB uses if present.
I doubt the vfat driver of the uefi firmware supports rock ride, and that is the driver used to load efi/boot/bootloongarch64.efi because grub is not yet loaded ...
take care,
Gerd
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Hi,
Quoted 3 lines · Gerd Hoffmann
I doubt the vfat driver of the uefi firmware supports rock ride, and that is the driver used to load efi/boot/bootloongarch64.efi because grub is not yet loaded ...
xorrisofs option -iso-level 3 has no effect on the FAT filesystem in the EFI boot image (/efi.img in the grub-mkrescue ISO). xorriso takes this file as opaque input and just advertises it to the firmware. Whether grub-mkrescue can represent "bootloongarch64.efi" in FAT is a matter of the helper programs "mformat" and "mcopy". See line 845 ff. of util/grub-mkrescue.c . Line 813 ff. shows that it already uses long names "bootriscv32.efi" and "bootriscv64.efi
The effect of xorrisofs option -iso-level is descibed in the man page of xorrisofs:
-iso-level number
Specify the ISO 9660 version which defines the limitations of file naming and data file size. The naming restrictions do not apply to the Rock Ridge names but only to the low-level ISO 9660 names. There are three conformance levels:
Level 1 allows ISO names of the form 8.3 and file size up to 4 GiB - 1.
Level 2 allows ISO names with up to 32 characters and file size up to 4 GiB - 1.
Level 3 allows ISO names with up to 32 characters and file size of up to 400 GiB - 200 KiB. (This size limitation is set by the xorriso implementation and not by ISO 9660 which would allow nearly 8 TiB.)
Pseudo-level 4 enables production of an additional ISO 9660:1999 directory tree.
Levels 1 to 3 are specified in ECMA-119, 10 "Levels of interchange". Pseudo-level 4 is an invention of mkisofs, although it would have been better to give the ISO 9660:1999 tree an own option, like for Joliet.
Have a nice day :)
Thomas
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel