feat(iso9660): add volume name and partition type as options

Signed-off-by: desertwitch <24509509+desertwitch@users.noreply.github.com>
This commit is contained in:
desertwitch
2025-11-22 07:55:46 +01:00
parent 4fd5642d16
commit 023c549337
9 changed files with 44 additions and 7 deletions

View File

@@ -75,6 +75,17 @@ config BR2_TARGET_ROOTFS_ISO9660_BIOS_BOOTLOADER
config BR2_TARGET_ROOTFS_ISO9660_EFI_BOOTLOADER
bool
config BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME
string "iso volume name"
default "ISO9660"
help
Set the Volume ID of the ISO image. xorriso accepts any text up to 32
characters, but according to rarely obeyed specs stricter rules apply:
Conformant are ASCII characters out of [A-Z0-9_], like: "IMAGE_23". Joliet
allows 16 UCS-2 characters, like: "Windows name". Be aware that the volume
ID might get used automatically as name of the mount point when the medium
is inserted into a playful computer system.
config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU
string "Isolinux configuration file"
depends on BR2_TARGET_ROOTFS_ISO9660_ISOLINUX || BR2_TARGET_ROOTFS_ISO9660_BOTH
@@ -177,20 +188,36 @@ config BR2_TARGET_ROOTFS_ISO9660_HYBRID
which the BIOS considers as HDD/removable device (e.g. USB stick)
config BR2_TARGET_ROOTFS_ISO9660_HYBRID_APPEND_PARTITION
string "Append hybrid partition image"
string "Append partition to hybrid image"
depends on BR2_TARGET_ROOTFS_ISO9660_BOTH \
&& BR2_TARGET_ROOTFS_ISO9660_HYBRID
default ""
help
Enable this option to append a prepared FAT16 filesystem
image to the hybrid image, useful when needing a writeable
data partition for USBs - should be considered EXPERIMENTAL.
Enable this option to append a prepared filesystem image
to the hybrid image, useful when needing a writeable data
partition for USBs - should be considered as EXPERIMENTAL.
The path is expected to be relative to folder "output/images/".
You can use e.g. a BR2_ROOTFS_POST_BUILD_SCRIPT for preparing
the respective filesystem image for your target configuration.
config BR2_TARGET_ROOTFS_ISO9660_HYBRID_APPEND_PARTITION_TYPE
string "Append partition type"
depends on \
BR2_TARGET_ROOTFS_ISO9660_HYBRID_APPEND_PARTITION != ""
default "0x0e"
help
May be "FAT12", "FAT16", "Linux", or a hexadecimal number between 0x00 and
0xff. Not all those numbers will yield usable results. For a list of codes
search the internet for "Partition Types". If the partition appears in GPT
then 0xef is mapped to the EFI System Partition Type GUID. All others get
mapped to Basic Data Type GUID. May also be a type GUID as plain hex
string like a2a0d0ebe5b9334487c068b6b72699c7 or as structured text like
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7. It will be used if the partition is
mentioned in GPT. In MBR, C12A7328-F81F-11D2-BA4B-00A0C93EC93B will be
mapped to 0xef. Any other GUID will be mapped to 0x83.
endif
comment "iso image needs a Linux kernel and either grub2 or isolinux to be built"

View File

@@ -29,12 +29,14 @@
ROOTFS_ISO9660_DEPENDENCIES = host-xorriso linux
ROOTFS_ISO9660_VOLUME_NAME = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME))
ROOTFS_ISO9660_GRUB2_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU))
ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU))
ROOTFS_ISO9660_GRUB2_EFI_PARTITION_SIZE = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_PARTITION_SIZE))
ROOTFS_ISO9660_GRUB2_EFI_IDENT_FILE = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_IDENT_FILE))
ROOTFS_ISO9660_ISOLINUX_BOOT_MENU = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU))
ROOTFS_ISO9660_HYBRID_APPEND_PARTITION = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_HYBRID_APPEND_PARTITION))
ROOTFS_ISO9660_HYBRID_APPEND_PARTITION_TYPE = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_HYBRID_APPEND_PARTITION_TYPE))
################################################################################
# Architecture-specific variables
@@ -370,7 +372,7 @@ ROOTFS_ISO9660_PRE_GEN_HOOKS += ROOTFS_ISO9660_INSTALL_BOOTLOADERS
# modern Debian distributions (see .disk/mkisofs inside one of their ISOs)
################################################################################
ROOTFS_ISO9660_OPTS += -r -V 'ISO9660' -J -joliet-long -cache-inodes
ROOTFS_ISO9660_OPTS += -r -V '$(ROOTFS_ISO9660_VOLUME_NAME)' -J -joliet-long -cache-inodes
ifeq ($(BR2_TARGET_ROOTFS_ISO9660_BOTH)$(BR2_TARGET_ROOTFS_ISO9660_HYBRID),yy)
# BOTH + HYBRID (uses ISOLINUX)
@@ -429,10 +431,11 @@ ROOTFS_ISO9660_OPTS += \
$(ROOTFS_ISO9660_OPTS_BIOS) \
-eltorito-alt-boot \
$(ROOTFS_ISO9660_OPTS_EFI)
# Append an extra FAT16 partition image (if one was provided, for hybrid mode)
# Append an extra partition image, if one was provided (for hybrid images)
ifneq ($(ROOTFS_ISO9660_HYBRID_APPEND_PARTITION),)
ROOTFS_ISO9660_OPTS += \
-append_partition 3 0x0e $(BINARIES_DIR)/$(ROOTFS_ISO9660_HYBRID_APPEND_PARTITION) \
-append_partition 3 $(ROOTFS_ISO9660_HYBRID_APPEND_PARTITION_TYPE) \
$(BINARIES_DIR)/$(ROOTFS_ISO9660_HYBRID_APPEND_PARTITION) \
-partition_cyl_align all
endif