From 023c549337f5f4f16c32e24cc5ee91aa635b28f7 Mon Sep 17 00:00:00 2001 From: desertwitch <24509509+desertwitch@users.noreply.github.com> Date: Sat, 22 Nov 2025 07:55:46 +0100 Subject: [PATCH] feat(iso9660): add volume name and partition type as options Signed-off-by: desertwitch <24509509+desertwitch@users.noreply.github.com> --- configs/shredos_i586_defconfig | 1 + configs/shredos_iso_defconfig | 1 + configs/shredos_iso_extra_defconfig | 1 + configs/shredos_iso_extra_i586_defconfig | 1 + configs/shredos_iso_i586_defconfig | 1 + configs/shredos_iso_legacy_defconfig | 1 + configs/shredos_iso_legacy_i586_defconfig | 1 + fs/iso9660/Config.in | 35 ++++++++++++++++++++--- fs/iso9660/iso9660.mk | 9 ++++-- 9 files changed, 44 insertions(+), 7 deletions(-) diff --git a/configs/shredos_i586_defconfig b/configs/shredos_i586_defconfig index 0d478560a9..240591da29 100644 --- a/configs/shredos_i586_defconfig +++ b/configs/shredos_i586_defconfig @@ -164,6 +164,7 @@ BR2_TARGET_ROOTFS_CPIO_LZMA=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOTH=y +BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME="SHREDOS" BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU="board/shredos/iso/isolinux.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU="board/shredos/iso/grub.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU="board/shredos/iso/efigrub.cfg" diff --git a/configs/shredos_iso_defconfig b/configs/shredos_iso_defconfig index a7869850c1..db9f0a26a1 100644 --- a/configs/shredos_iso_defconfig +++ b/configs/shredos_iso_defconfig @@ -167,6 +167,7 @@ BR2_TARGET_ROOTFS_CPIO_LZMA=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOTH=y +BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME="SHREDOS" BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU="board/shredos/iso/isolinux.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU="board/shredos/iso/grub.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU="board/shredos/iso/efigrub.cfg" diff --git a/configs/shredos_iso_extra_defconfig b/configs/shredos_iso_extra_defconfig index aec7bbb618..34c1412242 100644 --- a/configs/shredos_iso_extra_defconfig +++ b/configs/shredos_iso_extra_defconfig @@ -168,6 +168,7 @@ BR2_TARGET_ROOTFS_CPIO_LZMA=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOTH=y +BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME="SHREDOS" BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU="board/shredos/iso/isolinux.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU="board/shredos/iso/grub.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU="board/shredos/iso/efigrub.cfg" diff --git a/configs/shredos_iso_extra_i586_defconfig b/configs/shredos_iso_extra_i586_defconfig index cabeef7d25..38eb6616d1 100644 --- a/configs/shredos_iso_extra_i586_defconfig +++ b/configs/shredos_iso_extra_i586_defconfig @@ -165,6 +165,7 @@ BR2_TARGET_ROOTFS_CPIO_LZMA=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOTH=y +BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME="SHREDOS" BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU="board/shredos/iso/isolinux.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU="board/shredos/iso/grub.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU="board/shredos/iso/efigrub.cfg" diff --git a/configs/shredos_iso_i586_defconfig b/configs/shredos_iso_i586_defconfig index 39793bcc14..f25b247307 100644 --- a/configs/shredos_iso_i586_defconfig +++ b/configs/shredos_iso_i586_defconfig @@ -164,6 +164,7 @@ BR2_TARGET_ROOTFS_CPIO_LZMA=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOTH=y +BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME="SHREDOS" BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU="board/shredos/iso/isolinux.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU="board/shredos/iso/grub.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU="board/shredos/iso/efigrub.cfg" diff --git a/configs/shredos_iso_legacy_defconfig b/configs/shredos_iso_legacy_defconfig index 78935de472..676ad43f59 100644 --- a/configs/shredos_iso_legacy_defconfig +++ b/configs/shredos_iso_legacy_defconfig @@ -167,6 +167,7 @@ BR2_TARGET_ROOTFS_CPIO_LZMA=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOTH=y +BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME="SHREDOS" BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU="board/shredos/iso/isolinux.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU="board/shredos/iso/grub.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU="board/shredos/iso/efigrub.cfg" diff --git a/configs/shredos_iso_legacy_i586_defconfig b/configs/shredos_iso_legacy_i586_defconfig index addfb68bda..78976354dd 100644 --- a/configs/shredos_iso_legacy_i586_defconfig +++ b/configs/shredos_iso_legacy_i586_defconfig @@ -164,6 +164,7 @@ BR2_TARGET_ROOTFS_CPIO_LZMA=y BR2_TARGET_ROOTFS_INITRAMFS=y BR2_TARGET_ROOTFS_ISO9660=y BR2_TARGET_ROOTFS_ISO9660_BOTH=y +BR2_TARGET_ROOTFS_ISO9660_VOLUME_NAME="SHREDOS" BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MENU="board/shredos/iso/isolinux.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_BOOT_MENU="board/shredos/iso/grub.cfg" BR2_TARGET_ROOTFS_ISO9660_GRUB2_EFI_BOOT_MENU="board/shredos/iso/efigrub.cfg" diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in index c66367ce35..8c80efda9a 100644 --- a/fs/iso9660/Config.in +++ b/fs/iso9660/Config.in @@ -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" diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk index 5feea015a4..1f1ef00a59 100644 --- a/fs/iso9660/iso9660.mk +++ b/fs/iso9660/iso9660.mk @@ -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