All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
@ 2013-08-16  9:22 jean
  2013-08-16 11:49 ` Jean Sorgemoel
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: jean @ 2013-08-16  9:22 UTC (permalink / raw)
  To: buildroot


Signed-off-by: jean <jean.sorgemoel@laposte.net>
---
 fs/Config.in            |    1 +
 fs/isolinux/Config.in   |  182 ++++++++++++++++++++++++++++++++++++++
 fs/isolinux/isolinux.mk |  226 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 409 insertions(+)
 create mode 100644 fs/isolinux/Config.in
 create mode 100644 fs/isolinux/isolinux.mk

diff --git a/fs/Config.in b/fs/Config.in
index da4c5ff..02294a9 100644
--- a/fs/Config.in
+++ b/fs/Config.in
@@ -11,5 +11,6 @@ source "fs/romfs/Config.in"
 source "fs/squashfs/Config.in"
 source "fs/tar/Config.in"
 source "fs/ubifs/Config.in"
+source "fs/isolinux/Config.in"
 
 endmenu
diff --git a/fs/isolinux/Config.in b/fs/isolinux/Config.in
new file mode 100644
index 0000000..8abe409
--- /dev/null
+++ b/fs/isolinux/Config.in
@@ -0,0 +1,182 @@
+## Menu ISO image with syslinux
+menu "iso image (isolinux bootloader - with initramfs)"
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX
+	bool "iso image (isolinux bootloader)"
+	depends on (BR2_i386 || BR2_x86_64)
+	depends on BR2_LINUX_KERNEL
+	select BR2_TARGET_ROOTFS_INITRAMFS
+	select BR2_TARGET_SYSLINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX
+	help
+		Build a bootable iso9660 image (with isolinux bootloader and initramfs)
+		You can launch this iso with :
+			qemu -boot d -cdrom rootfs.isolinux
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_JOLIET
+        bool "create iso with Joliet format"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+              	Create iso image with Joliet format (long file)
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_ROCK_RIDGE
+        bool "Generate Rock Ridge directory information"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+                Generate Rock Ridge directory information
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX
+        string "Name to start linux"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        default "buildroot"
+        help
+                define message see to select linux 
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME
+        string "Name iso"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        default "buildroot iso"
+        help
+                cdrom name
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET
+        string "define parameter input charset"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+	default "iso8859-15"
+        help
+                define parameter input charset 
+		(see program genisoimage : genisoimage -input-charset help)
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE
+	string "Message boot for isolinux"
+	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+	default "Buildroot isolinux boot"
+	help
+		define first message see in prompt boot
+		after that, you see all options
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT
+	int "timeout"
+	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        default "20"
+	help
+		define timeout (second)
+		after this time, boot on default config
+
+config BR2_TARGET_ISO_ISOLINUX_TOOLS_HARDWARE_INFO
+	bool "add tools hardware info"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+		isolinux menu, you can see hardware info
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_REBOOT
+        bool "add isolinux option reboot"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+                isolinux menu, you can reboot
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_POWEROFF
+        bool "add isolinux option poweroff"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+                isolinux menu, you can power off
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_FIRSTDISKBOOT
+        bool "add isolinux option to boot on first disk"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+                isolinux menu, you can boot on disk
+
+## Keyboard menu
+menu "keyboard"
+depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+depends on BR2_PACKAGE_KBD
+
+## Choice default keyboard on boot (isolinux only)
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD
+        string
+choice
+	prompt "Default keyboard on isolinux boot"
+	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "us"
+	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "fr"
+	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "fr-pc"
+	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "de"
+	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_MANUAL if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "manual"
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US
+	bool "us"
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR
+	bool "fr"
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC
+	bool "fr-pc"
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE
+	bool "de"
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_MANUAL
+	bool "manual"
+	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
+
+endchoice
+## End choice default keyboard on boot (isolinux only)
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_US
+	bool "keyboard us"
+	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+		activate option keyboard us (exist by default)
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR
+	bool "keyboard fr"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+                activate option keyboard fr
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR_PC
+	bool "keyboard fr-pc"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+                activate option keyboard fr_pc
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_DE
+	bool "keyboard de"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        help
+                activate option keyboard de
+
+
+menu "Manual configuration keyboard"
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
+	bool "Enable manual configuration"
+	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+	help
+		Activate manual keyboard configuration
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME
+        string "Name of keyboard"
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
+        default "unknown"
+        help
+                define name to select this keyboard in isolinux menu
+
+config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE
+	string "File source to generate the keyboard map"
+	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
+        default "data/keymaps/i386/qwerty/us.map"
+        help
+                define map file to generate the keyboard configuration
+		root is kbd package 
+		example : data/keymaps/i386/qwerty/gr.map
+
+endmenu
+## End manual configuration keyboard
+
+endmenu
+## End keyboard menu
+
+endmenu
+## End Menu ISO image with syslinux
diff --git a/fs/isolinux/isolinux.mk b/fs/isolinux/isolinux.mk
new file mode 100644
index 0000000..0d9464d
--- /dev/null
+++ b/fs/isolinux/isolinux.mk
@@ -0,0 +1,226 @@
+################################################################################
+#
+# Build the iso96600 with isolinux bootloader (and initramfs)
+#
+################################################################################
+
+BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT=boot
+BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX=isolinux
+BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS=tools
+BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD=keyboard
+
+BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR = $(BUILD_DIR)/isolinux
+BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)
+BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)
+BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)
+BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)
+
+BR2_TARGET_ISO_ISOLINUX_BOOT_MESSAGE := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE))
+BR2_TARGET_ISO_ISOLINUX_BOOT_TIMEOUT := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT))
+
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US = $(KBD_BUILDDIR)data/keymaps/i386/qwerty/us.map
+
+BR2_TARGET_ISO_ISOLINUX_CONFIG = ""
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG = ""
+
+define copy_files_isolinux_image_tools
+	cp $(1) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS);
+endef
+
+define copy_files_isolinux_image_keyboard
+	$(SYSLINUX_BUILDDIR)utils/keytab-lilo \
+	        $(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US) \
+        	$1 \
+	         > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)/$(subst -,_,$(notdir $(basename $1))).ktl;
+endef
+
+$(BINARIES_DIR)/rootfs.isolinux: host-cdrkit linux syslinux rootfs-initramfs
+	@$(call MESSAGE,"Generating root filesystem image rootfs.isolinux")
+	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
+	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT)
+	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX)
+	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS)
+	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)
+
+	@echo -e $(BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/bootmsg.txt
+
+	@cp $(BINARIES_DIR)/isolinux.bin $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/
+	@cp $(LINUX_IMAGE_PATH) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)/
+
+	@echo -e $(BR2_TARGET_ISO_ISOLINUX_CONFIG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/isolinux.cfg
+	
+	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS), $(call copy_files_isolinux_image_tools, $(file) ) )
+	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD), $(call copy_files_isolinux_image_keyboard, $(file) ) )
+
+	$(HOST_DIR)/usr/bin/genisoimage \
+		$(BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION) \
+		-o $(BINARIES_DIR)/rootfs.isolinux \
+		-b $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/isolinux.bin \
+		-no-emul-boot \
+		-c $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/boot.cat \
+		-boot-load-size 4 \
+		-boot-info-table \
+		-input-charset $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET) \
+		-V $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME) \
+		$(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
+
+	- at rm -rf $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
+
+rootfs-isolinux: $(BINARIES_DIR)/rootfs.isolinux
+
+################################################################################
+#
+# Toplevel Makefile options
+#
+################################################################################
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX),y)
+TARGETS+=rootfs-isolinux
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "display bootmsg.txt\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "default $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "timeout $(BR2_TARGET_ISO_ISOLINUX_BOOT_TIMEOUT)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "prompt 1\\n"
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_JOLIET),y)
+BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION += -J
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_ROCK_RIDGE),y)
+BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION += -R
+endif
+
+# By default it us keyboard
+#ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US),y)
+#BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/us.ktl"
+#BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED=y
+#endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr.ktl\\n"
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED=y
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr_pc.ktl\\n"
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED=y
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/de.ktl\\n"
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED=y
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)/bzImage\\n"
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "$(BR2_TARGET_ISO_ISOLINUX_BOOT_MESSAGE)\n"
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)) launch linux\n"
+endif
+
+ifeq ($(BR2_TARGET_ISO_ISOLINUX_TOOLS_HARDWARE_INFO),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL hdt\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Hardware Info\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  COM32 $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/hdt.c32\\n"
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  hdt) hardware info\n"
+BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_REBOOT),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL reboot\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Reboot\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/reboot.c32\\n"
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  reboot) reboot server\n"
+BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/modules/reboot.c32
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_POWEROFF),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL poweroff\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Poweroff\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/poweroff.com\\n"
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  poweroff) poweroff server\n"
+BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)modules/poweroff.com
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_FIRSTDISKBOOT),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL hd\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Boot from first hard disk\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  localboot 0x80\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  append -\\n"
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  hd) boot on first hard disk\n"
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_US),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL us\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard US (qwerty)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/us.ktl\\n"
+BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += us
+BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED=y
+endif
+
+ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED),y)
+BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/qwerty/us.map
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL fr\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard FR (azerty)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr.ktl\\n"
+BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += fr
+BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED=y
+endif
+
+ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED),y)
+BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/azerty/fr.map
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR_PC),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL frpc\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard FR-PC (azerty)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr_pc.ktl\\n"
+BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += frpc
+BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED=y
+endif
+
+ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED),y)
+BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/azerty/fr-pc.map
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_DE),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL de\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard DE (qwertz)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/de.ktl\\n"
+BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += de
+BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
+BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED=y
+endif
+
+ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED),y)
+BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/qwertz/de.map
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE),y)
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
+BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/$(subst -,_,$(notdir $(basename $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE)))).ktl\\n"
+BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE)
+BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)
+BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
+endif
+
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED),y)
+BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/modules/kbdmap.c32
+endif
+
+ifneq ($(BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION),)
+BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  $(BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION)) keyboard option"
+endif
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
@ 2013-08-16 11:49 ` Jean Sorgemoel
  2013-08-20 22:24 ` Arnout Vandecappelle
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 25+ messages in thread
From: Jean Sorgemoel @ 2013-08-16 11:49 UTC (permalink / raw)
  To: buildroot

Dear All,

Sorry, It's my first patch.

We can generate new iso file with isolinux.

Regards,
Jean

> Signed-off-by: jean <jean.sorgemoel@laposte.net>
> ---
>   fs/Config.in            |    1 +
>   fs/isolinux/Config.in   |  182 ++++++++++++++++++++++++++++++++++++++
>   fs/isolinux/isolinux.mk |  226 +++++++++++++++++++++++++++++++++++++++++++++++
>   3 files changed, 409 insertions(+)
>   create mode 100644 fs/isolinux/Config.in
>   create mode 100644 fs/isolinux/isolinux.mk
>
> diff --git a/fs/Config.in b/fs/Config.in
> index da4c5ff..02294a9 100644
> --- a/fs/Config.in
> +++ b/fs/Config.in
> @@ -11,5 +11,6 @@ source "fs/romfs/Config.in"
>   source "fs/squashfs/Config.in"
>   source "fs/tar/Config.in"
>   source "fs/ubifs/Config.in"
> +source "fs/isolinux/Config.in"
>   
>   endmenu
> diff --git a/fs/isolinux/Config.in b/fs/isolinux/Config.in
> new file mode 100644
> index 0000000..8abe409
> --- /dev/null
> +++ b/fs/isolinux/Config.in
> @@ -0,0 +1,182 @@
> +## Menu ISO image with syslinux
> +menu "iso image (isolinux bootloader - with initramfs)"
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +	bool "iso image (isolinux bootloader)"
> +	depends on (BR2_i386 || BR2_x86_64)
> +	depends on BR2_LINUX_KERNEL
> +	select BR2_TARGET_ROOTFS_INITRAMFS
> +	select BR2_TARGET_SYSLINUX
> +	select BR2_TARGET_SYSLINUX_ISOLINUX
> +	help
> +		Build a bootable iso9660 image (with isolinux bootloader and initramfs)
> +		You can launch this iso with :
> +			qemu -boot d -cdrom rootfs.isolinux
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_JOLIET
> +        bool "create iso with Joliet format"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +              	Create iso image with Joliet format (long file)
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_ROCK_RIDGE
> +        bool "Generate Rock Ridge directory information"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                Generate Rock Ridge directory information
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX
> +        string "Name to start linux"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        default "buildroot"
> +        help
> +                define message see to select linux
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME
> +        string "Name iso"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        default "buildroot iso"
> +        help
> +                cdrom name
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET
> +        string "define parameter input charset"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +	default "iso8859-15"
> +        help
> +                define parameter input charset
> +		(see program genisoimage : genisoimage -input-charset help)
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE
> +	string "Message boot for isolinux"
> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +	default "Buildroot isolinux boot"
> +	help
> +		define first message see in prompt boot
> +		after that, you see all options
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT
> +	int "timeout"
> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        default "20"
> +	help
> +		define timeout (second)
> +		after this time, boot on default config
> +
> +config BR2_TARGET_ISO_ISOLINUX_TOOLS_HARDWARE_INFO
> +	bool "add tools hardware info"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +		isolinux menu, you can see hardware info
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_REBOOT
> +        bool "add isolinux option reboot"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                isolinux menu, you can reboot
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_POWEROFF
> +        bool "add isolinux option poweroff"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                isolinux menu, you can power off
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_FIRSTDISKBOOT
> +        bool "add isolinux option to boot on first disk"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                isolinux menu, you can boot on disk
> +
> +## Keyboard menu
> +menu "keyboard"
> +depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +depends on BR2_PACKAGE_KBD
> +
> +## Choice default keyboard on boot (isolinux only)
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD
> +        string
> +choice
> +	prompt "Default keyboard on isolinux boot"
> +	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "us"
> +	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "fr"
> +	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "fr-pc"
> +	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "de"
> +	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_MANUAL if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "manual"
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US
> +	bool "us"
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR
> +	bool "fr"
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC
> +	bool "fr-pc"
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE
> +	bool "de"
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_MANUAL
> +	bool "manual"
> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
> +
> +endchoice
> +## End choice default keyboard on boot (isolinux only)
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_US
> +	bool "keyboard us"
> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +		activate option keyboard us (exist by default)
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR
> +	bool "keyboard fr"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                activate option keyboard fr
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR_PC
> +	bool "keyboard fr-pc"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                activate option keyboard fr_pc
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_DE
> +	bool "keyboard de"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                activate option keyboard de
> +
> +
> +menu "Manual configuration keyboard"
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
> +	bool "Enable manual configuration"
> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +	help
> +		Activate manual keyboard configuration
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME
> +        string "Name of keyboard"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
> +        default "unknown"
> +        help
> +                define name to select this keyboard in isolinux menu
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE
> +	string "File source to generate the keyboard map"
> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
> +        default "data/keymaps/i386/qwerty/us.map"
> +        help
> +                define map file to generate the keyboard configuration
> +		root is kbd package
> +		example : data/keymaps/i386/qwerty/gr.map
> +
> +endmenu
> +## End manual configuration keyboard
> +
> +endmenu
> +## End keyboard menu
> +
> +endmenu
> +## End Menu ISO image with syslinux
> diff --git a/fs/isolinux/isolinux.mk b/fs/isolinux/isolinux.mk
> new file mode 100644
> index 0000000..0d9464d
> --- /dev/null
> +++ b/fs/isolinux/isolinux.mk
> @@ -0,0 +1,226 @@
> +################################################################################
> +#
> +# Build the iso96600 with isolinux bootloader (and initramfs)
> +#
> +################################################################################
> +
> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT=boot
> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX=isolinux
> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS=tools
> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD=keyboard
> +
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR = $(BUILD_DIR)/isolinux
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)
> +
> +BR2_TARGET_ISO_ISOLINUX_BOOT_MESSAGE := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE))
> +BR2_TARGET_ISO_ISOLINUX_BOOT_TIMEOUT := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT))
> +
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US = $(KBD_BUILDDIR)data/keymaps/i386/qwerty/us.map
> +
> +BR2_TARGET_ISO_ISOLINUX_CONFIG = ""
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG = ""
> +
> +define copy_files_isolinux_image_tools
> +	cp $(1) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS);
> +endef
> +
> +define copy_files_isolinux_image_keyboard
> +	$(SYSLINUX_BUILDDIR)utils/keytab-lilo \
> +	        $(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US) \
> +        	$1 \
> +	         > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)/$(subst -,_,$(notdir $(basename $1))).ktl;
> +endef
> +
> +$(BINARIES_DIR)/rootfs.isolinux: host-cdrkit linux syslinux rootfs-initramfs
> +	@$(call MESSAGE,"Generating root filesystem image rootfs.isolinux")
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)
> +
> +	@echo -e $(BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/bootmsg.txt
> +
> +	@cp $(BINARIES_DIR)/isolinux.bin $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/
> +	@cp $(LINUX_IMAGE_PATH) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)/
> +
> +	@echo -e $(BR2_TARGET_ISO_ISOLINUX_CONFIG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/isolinux.cfg
> +	
> +	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS), $(call copy_files_isolinux_image_tools, $(file) ) )
> +	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD), $(call copy_files_isolinux_image_keyboard, $(file) ) )
> +
> +	$(HOST_DIR)/usr/bin/genisoimage \
> +		$(BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION) \
> +		-o $(BINARIES_DIR)/rootfs.isolinux \
> +		-b $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/isolinux.bin \
> +		-no-emul-boot \
> +		-c $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/boot.cat \
> +		-boot-load-size 4 \
> +		-boot-info-table \
> +		-input-charset $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET) \
> +		-V $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME) \
> +		$(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
> +
> +	- at rm -rf $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
> +
> +rootfs-isolinux: $(BINARIES_DIR)/rootfs.isolinux
> +
> +################################################################################
> +#
> +# Toplevel Makefile options
> +#
> +################################################################################
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX),y)
> +TARGETS+=rootfs-isolinux
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "display bootmsg.txt\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "default $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "timeout $(BR2_TARGET_ISO_ISOLINUX_BOOT_TIMEOUT)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "prompt 1\\n"
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_JOLIET),y)
> +BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION += -J
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_ROCK_RIDGE),y)
> +BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION += -R
> +endif
> +
> +# By default it us keyboard
> +#ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US),y)
> +#BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/us.ktl"
> +#BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED=y
> +#endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr.ktl\\n"
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED=y
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr_pc.ktl\\n"
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED=y
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/de.ktl\\n"
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED=y
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)/bzImage\\n"
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "$(BR2_TARGET_ISO_ISOLINUX_BOOT_MESSAGE)\n"
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)) launch linux\n"
> +endif
> +
> +ifeq ($(BR2_TARGET_ISO_ISOLINUX_TOOLS_HARDWARE_INFO),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL hdt\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Hardware Info\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  COM32 $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/hdt.c32\\n"
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  hdt) hardware info\n"
> +BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_REBOOT),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL reboot\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Reboot\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/reboot.c32\\n"
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  reboot) reboot server\n"
> +BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/modules/reboot.c32
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_POWEROFF),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL poweroff\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Poweroff\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/poweroff.com\\n"
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  poweroff) poweroff server\n"
> +BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)modules/poweroff.com
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_FIRSTDISKBOOT),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL hd\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Boot from first hard disk\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  localboot 0x80\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  append -\\n"
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  hd) boot on first hard disk\n"
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_US),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL us\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard US (qwerty)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/us.ktl\\n"
> +BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += us
> +BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED=y
> +endif
> +
> +ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED),y)
> +BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/qwerty/us.map
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL fr\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard FR (azerty)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr.ktl\\n"
> +BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += fr
> +BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED=y
> +endif
> +
> +ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED),y)
> +BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/azerty/fr.map
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR_PC),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL frpc\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard FR-PC (azerty)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr_pc.ktl\\n"
> +BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += frpc
> +BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED=y
> +endif
> +
> +ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED),y)
> +BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/azerty/fr-pc.map
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_DE),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL de\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard DE (qwertz)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/de.ktl\\n"
> +BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += de
> +BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED=y
> +endif
> +
> +ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED),y)
> +BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/qwertz/de.map
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE),y)
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
> +BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/$(subst -,_,$(notdir $(basename $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE)))).ktl\\n"
> +BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE)
> +BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)
> +BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
> +endif
> +
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED),y)
> +BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/modules/kbdmap.c32
> +endif
> +
> +ifneq ($(BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION),)
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  $(BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION)) keyboard option"
> +endif

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
  2013-08-16 11:49 ` Jean Sorgemoel
@ 2013-08-20 22:24 ` Arnout Vandecappelle
  2014-01-28 16:25   ` Thomas Petazzoni
  2014-01-15  0:24 ` [Buildroot] [PATCH v2 1/1] update package isolinux bootloader - simplify code jean.sorgemoel at laposte.net
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: Arnout Vandecappelle @ 2013-08-20 22:24 UTC (permalink / raw)
  To: buildroot

On 16/08/13 11:22, jean wrote:
>
> Signed-off-by: jean <jean.sorgemoel@laposte.net>

  Hi Jean,

  Thanks for your patch. We will comment on it, and hopefully you can 
send an updated patch to fix the issues we report. When you do, please 
send the updated patch with the
--in-reply-to=1376644934-4302-1-git-send-email-jean.sorgemoel at laposte.net
and
-v 2 (or --subject-prefix='PATCH v2' for older git)
options, so that we can easily follow the updated patch in patchwork.

  First a generic comment. Is there any reason not to simply replace the 
iso9660 filesystem? That one is currently using grub as a bootloader, but 
it doesn't work very well. So I think this patch is very valuable to get 
the iso9660 filesystem working properly again. But as it is now, it is 
too complex to be included in buildroot. See my comments below.

  A second generic comment is about the choice of booting with an 
initramfs. Why not boot with a (rockridge) iso9660 rootfs? Clearly it 
puts a bit more strain on the kernel config since iso9660 as well as the 
bus drivers (sata, usb) have to be linked in, but I think that would be a 
much nicer solution. This type of image containing the actual rootfs in a 
different format should really be generated by a post-image script 
instead of a filesystem target. Can the rest of the list give their opinion?

> ---
>   fs/Config.in            |    1 +
>   fs/isolinux/Config.in   |  182 ++++++++++++++++++++++++++++++++++++++
>   fs/isolinux/isolinux.mk |  226 +++++++++++++++++++++++++++++++++++++++++++++++
>   3 files changed, 409 insertions(+)
>   create mode 100644 fs/isolinux/Config.in
>   create mode 100644 fs/isolinux/isolinux.mk
>
> diff --git a/fs/Config.in b/fs/Config.in
> index da4c5ff..02294a9 100644
> --- a/fs/Config.in
> +++ b/fs/Config.in
> @@ -11,5 +11,6 @@ source "fs/romfs/Config.in"
>   source "fs/squashfs/Config.in"
>   source "fs/tar/Config.in"
>   source "fs/ubifs/Config.in"
> +source "fs/isolinux/Config.in"
>
>   endmenu
> diff --git a/fs/isolinux/Config.in b/fs/isolinux/Config.in
> new file mode 100644
> index 0000000..8abe409
> --- /dev/null
> +++ b/fs/isolinux/Config.in
> @@ -0,0 +1,182 @@
> +## Menu ISO image with syslinux

  This comment is redundant: the line below says exactly that.

> +menu "iso image (isolinux bootloader - with initramfs)"

  We normally don't have a menu in this case. The sub-options will be 
hidden unless the ISOLINUX option is selected, and normally you only have 
one filesystem so the total menu doesn't become too large.

  In some cases we do add a menuconfig (which is a combination of a menu 
and a boolean config), but I don't think it is warranted here.

> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX

  The name of the config symbols should correspond to the directory, i.e. 
BR2_TARGET_ROOTFS_ISOLINUX (or BR2_TARGET_ROOTFS_ISO9660 if you do decide 
to replace that one). And of course the suboptions should also be renamed 
to BR2_TARGET_ROOTFS_ISOLINUX_FOO.

> +	bool "iso image (isolinux bootloader)"
> +	depends on (BR2_i386 || BR2_x86_64)
> +	depends on BR2_LINUX_KERNEL

  If you have a dependency on the kernel, you should also add a comment 
at the file explaining that it is needed. Cfr. iso9660.

> +	select BR2_TARGET_ROOTFS_INITRAMFS
> +	select BR2_TARGET_SYSLINUX
> +	select BR2_TARGET_SYSLINUX_ISOLINUX
> +	help
> +		Build a bootable iso9660 image (with isolinux bootloader and initramfs)

  I think it would be nice if the bootable aspect would be optional. But 
that can be done in a follow-up patch.

  Help text should be indented with 1 tab + 2 spaces, and wrap at 70 
characters (= 80 columns if you have 8-char tabs).

> +		You can launch this iso with :
> +			qemu -boot d -cdrom rootfs.isolinux
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_JOLIET
> +        bool "create iso with Joliet format"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX

  Instead of defining a 'depends on' for every suboption, just wrap the 
whole thing in a 'if ... endif' construct.

> +        help
> +              	Create iso image with Joliet format (long file)

  long filenames

> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_ROCK_RIDGE
> +        bool "Generate Rock Ridge directory information"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                Generate Rock Ridge directory information

  That help text isn't very useful... How about 'Generate Rock Ridge 
directory information, which includes symbolic links, file mode, uid, 
gid, etc.'

> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX
> +        string "Name to start linux"

  All Config.in stuff (except help text) should be indented with 1 tab, 
not with spaces.

> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        default "buildroot"
> +        help
> +                define message see to select linux

  I don't think generating the boot menu is a good idea. Instead, add an 
option to let the user point to the menu file, like iso9660 does it. Or 
actually, a list of files to include in the root dir.

  There should be a default 'menu' that boots immediately. You can just 
put this menu in fs/isolinux, and set the default for this option to that 
path.

> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME
> +        string "Name iso"

  "Volume label" or "Volume ID"

  And maybe the config symbol should be named the same.

> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        default "buildroot iso"

  I think the default label should be just "buildroot".

> +        help
> +                cdrom name
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET
> +        string "define parameter input charset"
> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +	default "iso8859-15"
> +        help
> +                define parameter input charset
> +		(see program genisoimage : genisoimage -input-charset help)
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE
> +	string "Message boot for isolinux"

  I guess this one is part of the menu file so can be removed.

> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +	default "Buildroot isolinux boot"
> +	help
> +		define first message see in prompt boot
> +		after that, you see all options
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT
> +	int "timeout"

  Ditto.

> +	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        default "20"
> +	help
> +		define timeout (second)
> +		after this time, boot on default config
> +
> +config BR2_TARGET_ISO_ISOLINUX_TOOLS_HARDWARE_INFO
> +	bool "add tools hardware info"

  Ditto.

> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +		isolinux menu, you can see hardware info
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_REBOOT
> +        bool "add isolinux option reboot"

  Ditto.

> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                isolinux menu, you can reboot
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_POWEROFF
> +        bool "add isolinux option poweroff"

  Ditto.

> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                isolinux menu, you can power off
> +
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_FIRSTDISKBOOT
> +        bool "add isolinux option to boot on first disk"

  Ditto.

> +        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
> +        help
> +                isolinux menu, you can boot on disk
> +
> +## Keyboard menu
> +menu "keyboard"

  This whole keyboard thing is way too complex. Buildroot wants to be 
_simple_. The only relevant thing would be a space-separate list of 
keyboard layouts to include in the image (cfr. the manual option, but 
with the possibility to specify several keyboards). However, I think for 
the time being it is best to only support a single keyboard (US).

[snip the 100 lines for the keyboard definition]

> diff --git a/fs/isolinux/isolinux.mk b/fs/isolinux/isolinux.mk
> new file mode 100644
> index 0000000..0d9464d
> --- /dev/null
> +++ b/fs/isolinux/isolinux.mk
> @@ -0,0 +1,226 @@
> +################################################################################
> +#
> +# Build the iso96600 with isolinux bootloader (and initramfs)
> +#
> +################################################################################
> +
> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT=boot

  Variables defined in a .mk file should never start with BR2_. The BR2_ 
prefix indicates that it is a Kconfig variable. Also the rest of the 
prefixes can be removed, so you would simply have ISOLINUX_ROOT_DIR_BOOT

  Assignments in .mk files should have a space before and after the = 
(like you do below).

  This variable and the three below, however, are redundant. They are not 
an abbreviation, and they are not variable. So they're not useful, and 
they make the file harder to read.

> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX=isolinux
> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS=tools
> +BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD=keyboard
> +
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR = $(BUILD_DIR)/isolinux

  This one could still be useful, since we have a similar variable for 
the generic packages. However, it should then be called ISOLINUX_DIR.

> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)
> +BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)

  These four are redundant again.

> +
> +BR2_TARGET_ISO_ISOLINUX_BOOT_MESSAGE := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE))
> +BR2_TARGET_ISO_ISOLINUX_BOOT_TIMEOUT := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT))

  Redundant.

> +
> +BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US = $(KBD_BUILDDIR)data/keymaps/i386/qwerty/us.map

  Redundant.

  Also, refering to KBD_BUILDDIR is not very nice. As I said before, I 
would leave the whole keyboard handling thing out for the first 
submission, and maybe add it in a follow-up patch.

> +
> +BR2_TARGET_ISO_ISOLINUX_CONFIG = ""
> +BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG = ""
> +
> +define copy_files_isolinux_image_tools
> +	cp $(1) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS);
> +endef

  Redundant


> +
> +define copy_files_isolinux_image_keyboard
> +	$(SYSLINUX_BUILDDIR)utils/keytab-lilo \
> +	        $(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US) \
> +        	$1 \
> +	         > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)/$(subst -,_,$(notdir $(basename $1))).ktl;
> +endef
> +
> +$(BINARIES_DIR)/rootfs.isolinux: host-cdrkit linux syslinux rootfs-initramfs

  Dependency on linux is redundant, since it is implied by the initramfs.

  You should probably collect the dependencies in a ISOLINUX_DEPENDENCIES 
variable, for consistency with the generic infrastructure.


> +	@$(call MESSAGE,"Generating root filesystem image rootfs.isolinux")
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS)
> +	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)
> +
> +	@echo -e $(BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/bootmsg.txt
> +
> +	@cp $(BINARIES_DIR)/isolinux.bin $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/

  We use '$(INSTALL) -D' instead of cp, which also makes the mkdir's 
above redundant. Remember, however, that the target file name has to be 
given if the -D option is used.

> +	@cp $(LINUX_IMAGE_PATH) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)/
> +
> +	@echo -e $(BR2_TARGET_ISO_ISOLINUX_CONFIG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/isolinux.cfg
> +	
> +	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS), $(call copy_files_isolinux_image_tools, $(file) ) )
> +	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD), $(call copy_files_isolinux_image_keyboard, $(file) ) )
> +
> +	$(HOST_DIR)/usr/bin/genisoimage \
> +		$(BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION) \
> +		-o $(BINARIES_DIR)/rootfs.isolinux \

  This should be $@

> +		-b $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/isolinux.bin \
> +		-no-emul-boot \
> +		-c $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/boot.cat \
> +		-boot-load-size 4 \
> +		-boot-info-table \
> +		-input-charset $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET) \
> +		-V $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME) \
> +		$(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
> +
> +	- at rm -rf $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
> +
> +rootfs-isolinux: $(BINARIES_DIR)/rootfs.isolinux

  I won't comment on the rest anymore since it will change too much after 
my feedback.

  I hope you're not scared off by the big change requests...

  Regards,
  Arnout

[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 1/1] update package isolinux bootloader - simplify code
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
  2013-08-16 11:49 ` Jean Sorgemoel
  2013-08-20 22:24 ` Arnout Vandecappelle
@ 2014-01-15  0:24 ` jean.sorgemoel at laposte.net
  2014-01-28 16:27   ` Thomas Petazzoni
  2014-01-28 16:30 ` [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader Thomas Petazzoni
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-01-15  0:24 UTC (permalink / raw)
  To: buildroot

From: jean <jean.sorgemoel@laposte.net>


Signed-off-by: jean <jean.sorgemoel@laposte.net>
---
After Arnout's remark, (sorry, I read last month), I updated this module. 
Goal : use other method to generate iso (and I think it's work fine)
File : fs/isolinux/Config.in
1/ I suppress redundant comment
2/ Suppress menu and use conditional (replace 'depends on' by 'if/endif')
3/ Modify comment
4/ suppress option (keyboard, ...)
5/ replace 8 x space by tabulation
File : fs/isolinux/isolinux.mk
5/ suppress extension 'BR2_'
7/ use variable 'ISOLINUX_DIR'
8/ suppress keyboard option
9/ I can't use command '$(INSTALL) -D' beacause I don't define filenames (I keep old code)
10/ Hide command genisoimage (with option $@)

 fs/Config.in             |    2 +-
 fs/isolinux/Config.in    |  210 ++++++++++----------------------------------
 fs/isolinux/bootmsg.txt  |    4 +
 fs/isolinux/isolinux.cfg |    7 ++
 fs/isolinux/isolinux.mk  |  219 ++++++----------------------------------------
 5 files changed, 87 insertions(+), 355 deletions(-)
 create mode 100644 fs/isolinux/bootmsg.txt
 create mode 100644 fs/isolinux/isolinux.cfg

diff --git a/fs/Config.in b/fs/Config.in
index 02294a9..dd526f8 100644
--- a/fs/Config.in
+++ b/fs/Config.in
@@ -6,11 +6,11 @@ source "fs/cramfs/Config.in"
 source "fs/ext2/Config.in"
 source "fs/initramfs/Config.in"
 source "fs/iso9660/Config.in"
+source "fs/isolinux/Config.in"
 source "fs/jffs2/Config.in"
 source "fs/romfs/Config.in"
 source "fs/squashfs/Config.in"
 source "fs/tar/Config.in"
 source "fs/ubifs/Config.in"
-source "fs/isolinux/Config.in"
 
 endmenu
diff --git a/fs/isolinux/Config.in b/fs/isolinux/Config.in
index 8abe409..aca54b4 100644
--- a/fs/isolinux/Config.in
+++ b/fs/isolinux/Config.in
@@ -1,182 +1,66 @@
-## Menu ISO image with syslinux
-menu "iso image (isolinux bootloader - with initramfs)"
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX
-	bool "iso image (isolinux bootloader)"
+config BR2_TARGET_ROOTFS_ISOLINUX
+	bool "isolinux"
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
 	select BR2_TARGET_ROOTFS_INITRAMFS
 	select BR2_TARGET_SYSLINUX
 	select BR2_TARGET_SYSLINUX_ISOLINUX
 	help
-		Build a bootable iso9660 image (with isolinux bootloader and initramfs)
-		You can launch this iso with :
-			qemu -boot d -cdrom rootfs.isolinux
+	  Build a bootable iso9660 image
+	    (with isolinux bootloader and initramfs)
+	  The image will be called rootfs.isolinux
+	  You can test this iso with :
+	    qemu -boot d -cdrom output/images/rootfs.isolinux
 
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_JOLIET
-        bool "create iso with Joliet format"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-              	Create iso image with Joliet format (long file)
+comment "isolinux needs a Linux kernel to be built"
+	depends on BR2_i386 || BR2_x86_64
+	depends on !BR2_LINUX_KERNEL
 
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_ROCK_RIDGE
-        bool "Generate Rock Ridge directory information"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-                Generate Rock Ridge directory information
+if BR2_TARGET_ROOTFS_ISOLINUX
 
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX
-        string "Name to start linux"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        default "buildroot"
-        help
-                define message see to select linux 
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME
-        string "Name iso"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        default "buildroot iso"
-        help
-                cdrom name
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET
-        string "define parameter input charset"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-	default "iso8859-15"
-        help
-                define parameter input charset 
-		(see program genisoimage : genisoimage -input-charset help)
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE
-	string "Message boot for isolinux"
-	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-	default "Buildroot isolinux boot"
+config BR2_TARGET_ROOTFS_ISOLINUX_JOLIET
+	bool "Create iso with Joliet format"
 	help
-		define first message see in prompt boot
-		after that, you see all options
+	  Create iso image with Joliet format (long filenames)
 
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT
-	int "timeout"
-	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        default "20"
+config BR2_TARGET_ROOTFS_ISOLINUX_ROCK_RIDGE
+	bool "Generate Rock Ridge directory information"
 	help
-		define timeout (second)
-		after this time, boot on default config
-
-config BR2_TARGET_ISO_ISOLINUX_TOOLS_HARDWARE_INFO
-	bool "add tools hardware info"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-		isolinux menu, you can see hardware info
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_REBOOT
-        bool "add isolinux option reboot"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-                isolinux menu, you can reboot
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_POWEROFF
-        bool "add isolinux option poweroff"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-                isolinux menu, you can power off
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_FIRSTDISKBOOT
-        bool "add isolinux option to boot on first disk"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-                isolinux menu, you can boot on disk
-
-## Keyboard menu
-menu "keyboard"
-depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-depends on BR2_PACKAGE_KBD
-
-## Choice default keyboard on boot (isolinux only)
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD
-        string
-choice
-	prompt "Default keyboard on isolinux boot"
-	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "us"
-	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "fr"
-	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "fr-pc"
-	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "de"
-	default BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_MANUAL if BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD = "manual"
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US
-	bool "us"
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR
-	bool "fr"
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC
-	bool "fr-pc"
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE
-	bool "de"
+	  Generate Rock Ridge directory information,
+	  which includes symbolic links, file mode, uid, gid, etc...
 
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_MANUAL
-	bool "manual"
-	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
-
-endchoice
-## End choice default keyboard on boot (isolinux only)
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_US
-	bool "keyboard us"
-	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-		activate option keyboard us (exist by default)
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR
-	bool "keyboard fr"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-                activate option keyboard fr
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR_PC
-	bool "keyboard fr-pc"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-                activate option keyboard fr_pc
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_DE
-	bool "keyboard de"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        help
-                activate option keyboard de
-
-
-menu "Manual configuration keyboard"
-
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
-	bool "Enable manual configuration"
-	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
+config BR2_TARGET_ROOTFS_ISOLINUX_BOOT_MESSAGE
+	string "Boot message"
+	default "fs/isolinux/bootmsg.txt"
 	help
-		Activate manual keyboard configuration
+	  Filename is contain boot message
 
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME
-        string "Name of keyboard"
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-        depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
-        default "unknown"
-        help
-                define name to select this keyboard in isolinux menu
+config BR2_TARGET_ROOTFS_ISOLINUX_CONFIG_FILE
+	string "Configuration file"
+	default "fs/isolinux/isolinux.cfg"
+	help
+	  isolinux configuration file
 
-config BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE
-	string "File source to generate the keyboard map"
-	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX
-	depends on BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE
-        default "data/keymaps/i386/qwerty/us.map"
-        help
-                define map file to generate the keyboard configuration
-		root is kbd package 
-		example : data/keymaps/i386/qwerty/gr.map
+config BR2_TARGET_ROOTFS_ISOLINUX_NAME
+	string "Volume label"
+	default "buildroot"
+	help
+	  cdrom name
 
-endmenu
-## End manual configuration keyboard
+config BR2_TARGET_ROOTFS_ISOLINUX_INPUT_CHARSET
+	string "Define parameter input charset"
+	default "iso8859-15"
+	help
+	  define parameter input charset 
+	  (see program genisoimage : genisoimage -input-charset help)
 
-endmenu
-## End keyboard menu
+config BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
+	string "Extra files copy on image"
+	default ""
+	help
+	  list of file (binary or other) copy directly on iso
+	  (separate by space, target directory 'extra')
+	  ex. :
+	    $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32
 
-endmenu
-## End Menu ISO image with syslinux
+endif # BR2_TARGET_ROOTFS_ISOLINUX
diff --git a/fs/isolinux/bootmsg.txt b/fs/isolinux/bootmsg.txt
new file mode 100644
index 0000000..4b9ba94
--- /dev/null
+++ b/fs/isolinux/bootmsg.txt
@@ -0,0 +1,4 @@
+Buildroot isolinux boot
+  buildroot) launch linux
+
+
diff --git a/fs/isolinux/isolinux.cfg b/fs/isolinux/isolinux.cfg
new file mode 100644
index 0000000..f2f2aa1
--- /dev/null
+++ b/fs/isolinux/isolinux.cfg
@@ -0,0 +1,7 @@
+display bootmsg.txt
+default buildroot
+timeout 20
+prompt 1
+LABEL buildroot
+  KERNEL bzImage
+
diff --git a/fs/isolinux/isolinux.mk b/fs/isolinux/isolinux.mk
index 0d9464d..848d3bb 100644
--- a/fs/isolinux/isolinux.mk
+++ b/fs/isolinux/isolinux.mk
@@ -4,67 +4,43 @@
 #
 ################################################################################
 
-BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT=boot
-BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX=isolinux
-BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS=tools
-BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD=keyboard
+ISOLINUX_DIR = $(BUILD_DIR)/isolinux
+ISOLINUX_DIR_EXTRA = $(ISOLINUX_DIR)/extra
 
-BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR = $(BUILD_DIR)/isolinux
-BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)
-BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)
-BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)
-BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD = $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)
+QUOTE = "
+ISOLINUX_LIST_EXTRA = $(subst $(QUOTE),,$(BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES))
 
-BR2_TARGET_ISO_ISOLINUX_BOOT_MESSAGE := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_MESSAGE))
-BR2_TARGET_ISO_ISOLINUX_BOOT_TIMEOUT := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_BOOT_TIMEOUT))
-
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US = $(KBD_BUILDDIR)data/keymaps/i386/qwerty/us.map
-
-BR2_TARGET_ISO_ISOLINUX_CONFIG = ""
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG = ""
-
-define copy_files_isolinux_image_tools
-	cp $(1) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS);
-endef
-
-define copy_files_isolinux_image_keyboard
-	$(SYSLINUX_BUILDDIR)utils/keytab-lilo \
-	        $(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US) \
-        	$1 \
-	         > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)/$(subst -,_,$(notdir $(basename $1))).ktl;
+define copy_files_isolinux_image_extra
+	cp $(1) $(ISOLINUX_DIR_EXTRA);
 endef
 
 $(BINARIES_DIR)/rootfs.isolinux: host-cdrkit linux syslinux rootfs-initramfs
 	@$(call MESSAGE,"Generating root filesystem image rootfs.isolinux")
-	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
-	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_BOOT)
-	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_ISOLINUX)
-	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_TOOLS)
-	@mkdir -p $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR_KEYBOARD)
+	@mkdir -p $(ISOLINUX_DIR)
+	@mkdir -p $(ISOLINUX_DIR_EXTRA)
+
+	@cp $(BR2_TARGET_ROOTFS_ISOLINUX_BOOT_MESSAGE) $(ISOLINUX_DIR)
 
-	@echo -e $(BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/bootmsg.txt
+	@cp $(BINARIES_DIR)/isolinux.bin $(ISOLINUX_DIR)
+	@cp $(LINUX_IMAGE_PATH) $(ISOLINUX_DIR)
 
-	@cp $(BINARIES_DIR)/isolinux.bin $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/
-	@cp $(LINUX_IMAGE_PATH) $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/$(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)/
+	@cp $(BR2_TARGET_ROOTFS_ISOLINUX_CONFIG_FILE) $(ISOLINUX_DIR)/isolinux.cfg
 
-	@echo -e $(BR2_TARGET_ISO_ISOLINUX_CONFIG) > $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)/isolinux.cfg
-	
-	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS), $(call copy_files_isolinux_image_tools, $(file) ) )
-	@$(foreach file, $(BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD), $(call copy_files_isolinux_image_keyboard, $(file) ) )
+	@$(foreach file, $(ISOLINUX_LIST_EXTRA), $(call copy_files_isolinux_image_extra, $(file) ) )
 
-	$(HOST_DIR)/usr/bin/genisoimage \
-		$(BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION) \
+	@$(HOST_DIR)/usr/bin/genisoimage \
+		$(ISOLINUX_GENISOIMAGE_OPTION) \
 		-o $(BINARIES_DIR)/rootfs.isolinux \
-		-b $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/isolinux.bin \
+		-b isolinux.bin \
 		-no-emul-boot \
-		-c $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_ISOLINUX)/boot.cat \
+		-c boot.cat \
 		-boot-load-size 4 \
 		-boot-info-table \
-		-input-charset $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_INPUT_CHARSET) \
-		-V $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_NAME) \
-		$(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
+		-input-charset $(BR2_TARGET_ROOTFS_ISOLINUX_INPUT_CHARSET) \
+		-V $(BR2_TARGET_ROOTFS_ISOLINUX_NAME) \
+		$(ISOLINUX_DIR)
 
-	- at rm -rf $(BR2_TARGET_ISO_ISOLINUX_BUILDIMAGE_DIR)
+	- at rm -rf $(ISOLINUX_DIR)
 
 rootfs-isolinux: $(BINARIES_DIR)/rootfs.isolinux
 
@@ -74,153 +50,14 @@ rootfs-isolinux: $(BINARIES_DIR)/rootfs.isolinux
 #
 ################################################################################
 
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX),y)
-TARGETS+=rootfs-isolinux
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "display bootmsg.txt\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "default $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "timeout $(BR2_TARGET_ISO_ISOLINUX_BOOT_TIMEOUT)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "prompt 1\\n"
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_JOLIET),y)
-BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION += -J
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_ROCK_RIDGE),y)
-BR2_TARGET_ISO_ISOLINUX_GENISOIMAGE_OPTION += -R
-endif
-
-# By default it us keyboard
-#ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_US),y)
-#BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/us.ktl"
-#BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED=y
-#endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr.ktl\\n"
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED=y
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_FR_PC),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr_pc.ktl\\n"
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED=y
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_DESIRED_KEYBOARD_DE),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "kbdmap $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/de.ktl\\n"
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED=y
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_BOOT)/bzImage\\n"
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "$(BR2_TARGET_ISO_ISOLINUX_BOOT_MESSAGE)\n"
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_MENU_LINUX)) launch linux\n"
-endif
-
-ifeq ($(BR2_TARGET_ISO_ISOLINUX_TOOLS_HARDWARE_INFO),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL hdt\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Hardware Info\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  COM32 $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/hdt.c32\\n"
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  hdt) hardware info\n"
-BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_REBOOT),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL reboot\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Reboot\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/reboot.c32\\n"
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  reboot) reboot server\n"
-BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/modules/reboot.c32
+ifeq ($(BR2_TARGET_ROOTFS_ISOLINUX),y)
+TARGETS += rootfs-isolinux
 endif
 
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_POWEROFF),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL poweroff\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Poweroff\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/poweroff.com\\n"
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  poweroff) poweroff server\n"
-BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)modules/poweroff.com
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_TOOLS_FIRSTDISKBOOT),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL hd\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL Boot from first hard disk\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  localboot 0x80\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  append -\\n"
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  hd) boot on first hard disk\n"
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_US),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL us\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard US (qwerty)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/us.ktl\\n"
-BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += us
-BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED=y
-endif
-
-ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_US_ACTIVATED),y)
-BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/qwerty/us.map
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL fr\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard FR (azerty)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr.ktl\\n"
-BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += fr
-BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED=y
-endif
-
-ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_ACTIVATED),y)
-BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/azerty/fr.map
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_FR_PC),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL frpc\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard FR-PC (azerty)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/fr_pc.ktl\\n"
-BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += frpc
-BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED=y
-endif
-
-ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_FR_PC_ACTIVATED),y)
-BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/azerty/fr-pc.map
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_DE),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL de\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard DE (qwertz)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/de.ktl\\n"
-BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += de
-BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
-BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED=y
-endif
-
-ifeq ($(BR2_TARGET_ISO_ISOLINUX_KEYBOARD_DE_ACTIVATED),y)
-BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)data/keymaps/i386/qwertz/de.map
-endif
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_ACTIVATE),y)
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "LABEL $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  MENU LABEL keyboard $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  KERNEL $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_TOOLS)/kbdmap.c32\\n"
-BR2_TARGET_ISO_ISOLINUX_CONFIG += "  APPEND $(BR2_TARGET_ISO_ISOLINUX_ROOT_DIR_KEYBOARD)/$(subst -,_,$(notdir $(basename $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE)))).ktl\\n"
-BR2_TARGET_ISO_ISOLINUX_LIST_KEYBOARD +=  $(KBD_BUILDDIR)$(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_SOURCE)
-BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION += $(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_MANUAL_NAME)
-BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED=y
-endif
-
-
-ifeq ($(BR2_TARGET_ROOTFS_ISO_ISOLINUX_KEYBOARD_ACTIVATED),y)
-BR2_TARGET_ISO_ISOLINUX_LIST_TOOLS += $(SYSLINUX_BUILDDIR)com32/modules/kbdmap.c32
+ifeq ($(BR2_TARGET_ROOTFS_ISOLINUX_JOLIET),y)
+ISOLINUX_GENISOIMAGE_OPTION += -J
 endif
 
-ifneq ($(BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION),)
-BR2_TARGET_ISO_BR2_TARGET_ISO_ISOLINUX_BOOT_MSG += "  $(BR2_TARGET_ISO_BR2_TARGET_KEYBOARD_OPTION)) keyboard option"
+ifeq ($(BR2_TARGET_ROOTFS_ISOLINUX_ROCK_RIDGE),y)
+ISOLINUX_GENISOIMAGE_OPTION += -R
 endif
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2013-08-20 22:24 ` Arnout Vandecappelle
@ 2014-01-28 16:25   ` Thomas Petazzoni
  2014-01-28 17:33     ` Arnout Vandecappelle
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2014-01-28 16:25 UTC (permalink / raw)
  To: buildroot

Dear Arnout Vandecappelle,

On Wed, 21 Aug 2013 00:24:36 +0200, Arnout Vandecappelle wrote:

>   First a generic comment. Is there any reason not to simply replace the 
> iso9660 filesystem? That one is currently using grub as a bootloader, but 
> it doesn't work very well. So I think this patch is very valuable to get 
> the iso9660 filesystem working properly again. But as it is now, it is 
> too complex to be included in buildroot. See my comments below.

What doesn't work with the current iso9660 filesystem support that is
grub based? I've tested it recently, and it was working. I've even
pushed a few improvements to it.

>   A second generic comment is about the choice of booting with an 
> initramfs. Why not boot with a (rockridge) iso9660 rootfs? Clearly it 
> puts a bit more strain on the kernel config since iso9660 as well as the 
> bus drivers (sata, usb) have to be linked in, but I think that would be a 
> much nicer solution. This type of image containing the actual rootfs in a 
> different format should really be generated by a post-image script 
> instead of a filesystem target. Can the rest of the list give their opinion?

I don't think that ISO9660 supports symbolic links, ownership,
permissions, device files and all these Unix filesystem features that
are typically needed to use a given filesystem type as a Linux root
filesystem.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 1/1] update package isolinux bootloader - simplify code
  2014-01-15  0:24 ` [Buildroot] [PATCH v2 1/1] update package isolinux bootloader - simplify code jean.sorgemoel at laposte.net
@ 2014-01-28 16:27   ` Thomas Petazzoni
  2014-01-29  7:02     ` Arnout Vandecappelle
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2014-01-28 16:27 UTC (permalink / raw)
  To: buildroot

Dear jean.sorgemoel at laposte.net,

On Wed, 15 Jan 2014 01:24:05 +0100, jean.sorgemoel at laposte.net wrote:
> From: jean <jean.sorgemoel@laposte.net>
> 
> 
> Signed-off-by: jean <jean.sorgemoel@laposte.net>

Please add a commit log with details, explaining what the patch is
doing.

> ---
> After Arnout's remark, (sorry, I read last month), I updated this module. 
> Goal : use other method to generate iso (and I think it's work fine)
> File : fs/isolinux/Config.in
> 1/ I suppress redundant comment
> 2/ Suppress menu and use conditional (replace 'depends on' by 'if/endif')
> 3/ Modify comment
> 4/ suppress option (keyboard, ...)
> 5/ replace 8 x space by tabulation
> File : fs/isolinux/isolinux.mk
> 5/ suppress extension 'BR2_'
> 7/ use variable 'ISOLINUX_DIR'
> 8/ suppress keyboard option
> 9/ I can't use command '$(INSTALL) -D' beacause I don't define filenames (I keep old code)
> 10/ Hide command genisoimage (with option $@)
> 
>  fs/Config.in             |    2 +-
>  fs/isolinux/Config.in    |  210 ++++++++++----------------------------------
>  fs/isolinux/bootmsg.txt  |    4 +
>  fs/isolinux/isolinux.cfg |    7 ++
>  fs/isolinux/isolinux.mk  |  219 ++++++----------------------------------------
>  5 files changed, 87 insertions(+), 355 deletions(-)
>  create mode 100644 fs/isolinux/bootmsg.txt
>  create mode 100644 fs/isolinux/isolinux.cfg

You did your patch incorrectly: what you're sending here are the
differences between your v1 and your v2. What we need is a single patch
that contains all of your changes.

You need to squash your v2 changes into the original patch, to make
only one patch that adds the isolinux stuff.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
                   ` (2 preceding siblings ...)
  2014-01-15  0:24 ` [Buildroot] [PATCH v2 1/1] update package isolinux bootloader - simplify code jean.sorgemoel at laposte.net
@ 2014-01-28 16:30 ` Thomas Petazzoni
  2014-02-01 21:17 ` [Buildroot] [PATCH v3 1/1] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2014-01-28 16:30 UTC (permalink / raw)
  To: buildroot

Dear jean,

On Fri, 16 Aug 2013 11:22:14 +0200, jean wrote:

> diff --git a/fs/isolinux/Config.in b/fs/isolinux/Config.in
> new file mode 100644
> index 0000000..8abe409
> --- /dev/null
> +++ b/fs/isolinux/Config.in
> @@ -0,0 +1,182 @@
> +## Menu ISO image with syslinux
> +menu "iso image (isolinux bootloader - with initramfs)"
> +config BR2_TARGET_ROOTFS_ISO_ISOLINUX

I don't agree with the idea that this is introduced as a new filesystem
type. I'm sorry, but "isolinux" is not a filesystem type, it's a
bootloader.

Instead, if you want to support ISO9660 images that use isolinux as the
bootloader instead of Grub (as is currently supported in fs/iso9660),
then you should expand fs/iso9660/ to support either Grub or isolinux
as the bootloader. Probably with a Config.in "choice" in
fs/iso9660/Config.in.

This way, all your improvements such as offering options for Joliet,
Rock Ridge support and so on will also benefit to the existing iso9660
support.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2014-01-28 16:25   ` Thomas Petazzoni
@ 2014-01-28 17:33     ` Arnout Vandecappelle
  2014-01-28 21:39       ` Thomas Petazzoni
  0 siblings, 1 reply; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-01-28 17:33 UTC (permalink / raw)
  To: buildroot

On 28/01/14 17:25, Thomas Petazzoni wrote:
> Dear Arnout Vandecappelle,
>
> On Wed, 21 Aug 2013 00:24:36 +0200, Arnout Vandecappelle wrote:
>
>>    First a generic comment. Is there any reason not to simply replace the
>> iso9660 filesystem? That one is currently using grub as a bootloader, but
>> it doesn't work very well. So I think this patch is very valuable to get
>> the iso9660 filesystem working properly again. But as it is now, it is
>> too complex to be included in buildroot. See my comments below.
>
> What doesn't work with the current iso9660 filesystem support that is
> grub based? I've tested it recently, and it was working. I've even
> pushed a few improvements to it.

  To be honest it has been a couple of years since I tried it, and I 
don't remember exactly. Here are a few issues that I can think of now.

* It doesn't actually build a rootfs, but rather a bootable image.

* grub has issues cross-compiling between x86_64 and i386 - but your 
recent patches may have fixed that.

* Bug#6092 (closed now, but not at the time I posted it).

* The issue that grub was built without iso support (fixed now, but not 
at the time I posted it).

  Possibly iso9660 is working reliably by now.


>>    A second generic comment is about the choice of booting with an
>> initramfs. Why not boot with a (rockridge) iso9660 rootfs? Clearly it
>> puts a bit more strain on the kernel config since iso9660 as well as the
>> bus drivers (sata, usb) have to be linked in, but I think that would be a
>> much nicer solution. This type of image containing the actual rootfs in a
>> different format should really be generated by a post-image script
>> instead of a filesystem target. Can the rest of the list give their opinion?
>
> I don't think that ISO9660 supports symbolic links, ownership,
> permissions, device files and all these Unix filesystem features that
> are typically needed to use a given filesystem type as a Linux root
> filesystem.

  That's what RockRidge is for.


  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2014-01-28 17:33     ` Arnout Vandecappelle
@ 2014-01-28 21:39       ` Thomas Petazzoni
  2014-01-29  7:00         ` Arnout Vandecappelle
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2014-01-28 21:39 UTC (permalink / raw)
  To: buildroot

Dear Arnout Vandecappelle,

On Tue, 28 Jan 2014 18:33:24 +0100, Arnout Vandecappelle wrote:

>   To be honest it has been a couple of years since I tried it, and I 
> don't remember exactly. Here are a few issues that I can think of now.
> 
> * It doesn't actually build a rootfs, but rather a bootable image.

Well, yes, that's true, but it was since the beginning the idea of this
iso9660 support, and the additional 'isolinux' filesystem being
proposed is exactly the same: a bootable image, except that it uses a
different bootloader.

> * grub has issues cross-compiling between x86_64 and i386 - but your 
> recent patches may have fixed that.

Yes, they fixed that.

> * Bug#6092 (closed now, but not at the time I posted it).

Yes, I've closed it, because it works for me.

> * The issue that grub was built without iso support (fixed now, but not 
> at the time I posted it).

Yes, it is fixed.

>   Possibly iso9660 is working reliably by now.

It works for me, at least, and was also reported to work by Thierry
Bultel, IIRC.

> >>    A second generic comment is about the choice of booting with an
> >> initramfs. Why not boot with a (rockridge) iso9660 rootfs? Clearly it
> >> puts a bit more strain on the kernel config since iso9660 as well as the
> >> bus drivers (sata, usb) have to be linked in, but I think that would be a
> >> much nicer solution. This type of image containing the actual rootfs in a
> >> different format should really be generated by a post-image script
> >> instead of a filesystem target. Can the rest of the list give their opinion?
> >
> > I don't think that ISO9660 supports symbolic links, ownership,
> > permissions, device files and all these Unix filesystem features that
> > are typically needed to use a given filesystem type as a Linux root
> > filesystem.
> 
>   That's what RockRidge is for.

Aaah, interesting, I didn't know that. So it would probably make a lot
of sense to improve the ISO9660 support to:

 * Generate just an ISO9660 root filesystem image by default

 * Optionally, make it bootable using either Grub or isolinux

 * Optionally, replace the ISO9660 root filesystem by an initramfs

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2014-01-28 21:39       ` Thomas Petazzoni
@ 2014-01-29  7:00         ` Arnout Vandecappelle
  2014-01-29  8:25           ` Thomas Petazzoni
  0 siblings, 1 reply; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-01-29  7:00 UTC (permalink / raw)
  To: buildroot

On 28/01/14 22:39, Thomas Petazzoni wrote:
[snip]

  The conclusion of the snipped text was that my comments from August are 
no longer valid.

>>>>     A second generic comment is about the choice of booting with an
>>>> initramfs. Why not boot with a (rockridge) iso9660 rootfs? Clearly it
>>>> puts a bit more strain on the kernel config since iso9660 as well as the
>>>> bus drivers (sata, usb) have to be linked in, but I think that would be a
>>>> much nicer solution. This type of image containing the actual rootfs in a
>>>> different format should really be generated by a post-image script
>>>> instead of a filesystem target. Can the rest of the list give their opinion?
>>>
>>> I don't think that ISO9660 supports symbolic links, ownership,
>>> permissions, device files and all these Unix filesystem features that
>>> are typically needed to use a given filesystem type as a Linux root
>>> filesystem.
>>
>>    That's what RockRidge is for.
>
> Aaah, interesting, I didn't know that. So it would probably make a lot
> of sense to improve the ISO9660 support to:
>
>   * Generate just an ISO9660 root filesystem image by default
>
>   * Optionally, make it bootable using either Grub or isolinux
>
>   * Optionally, replace the ISO9660 root filesystem by an initramfs

  The third one fits better in the genimages approach IMHO. The second 
one as well - except that that is not possible, once the iso image is 
created you can't make it bootable anymore. So yes, I think that would 
really improve the iso9660 support.

  However, I would also be happy with a patch that simply adds an option 
to use isolinux instead of grub for the current iso9660 infrastructure.

  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v2 1/1] update package isolinux bootloader - simplify code
  2014-01-28 16:27   ` Thomas Petazzoni
@ 2014-01-29  7:02     ` Arnout Vandecappelle
  0 siblings, 0 replies; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-01-29  7:02 UTC (permalink / raw)
  To: buildroot

On 28/01/14 17:27, Thomas Petazzoni wrote:
> Dear jean.sorgemoel at laposte.net,
>
> On Wed, 15 Jan 2014 01:24:05 +0100, jean.sorgemoel at laposte.net wrote:
>> From: jean <jean.sorgemoel@laposte.net>
>>
>>
>> Signed-off-by: jean <jean.sorgemoel@laposte.net>
>
> Please add a commit log with details, explaining what the patch is
> doing.
>
>> ---
>> After Arnout's remark, (sorry, I read last month), I updated this module.
>> Goal : use other method to generate iso (and I think it's work fine)
>> File : fs/isolinux/Config.in
>> 1/ I suppress redundant comment
>> 2/ Suppress menu and use conditional (replace 'depends on' by 'if/endif')
>> 3/ Modify comment
>> 4/ suppress option (keyboard, ...)
>> 5/ replace 8 x space by tabulation
>> File : fs/isolinux/isolinux.mk
>> 5/ suppress extension 'BR2_'
>> 7/ use variable 'ISOLINUX_DIR'
>> 8/ suppress keyboard option
>> 9/ I can't use command '$(INSTALL) -D' beacause I don't define filenames (I keep old code)
>> 10/ Hide command genisoimage (with option $@)
>>
>>   fs/Config.in             |    2 +-
>>   fs/isolinux/Config.in    |  210 ++++++++++----------------------------------
>>   fs/isolinux/bootmsg.txt  |    4 +
>>   fs/isolinux/isolinux.cfg |    7 ++
>>   fs/isolinux/isolinux.mk  |  219 ++++++----------------------------------------
>>   5 files changed, 87 insertions(+), 355 deletions(-)
>>   create mode 100644 fs/isolinux/bootmsg.txt
>>   create mode 100644 fs/isolinux/isolinux.cfg
>
> You did your patch incorrectly: what you're sending here are the
> differences between your v1 and your v2. What we need is a single patch
> that contains all of your changes.
>
> You need to squash your v2 changes into the original patch, to make
> only one patch that adds the isolinux stuff.

  Also, this version doesn't yet address one of the main comments that 
both Thomas and I have: you shouldn't create a new filesystem type, but 
instead you should modify the existing iso9660 support and add an option 
to it to use isolinux instead of grub.

  Regards,
  Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2014-01-29  7:00         ` Arnout Vandecappelle
@ 2014-01-29  8:25           ` Thomas Petazzoni
  2014-02-01 21:33             ` jean.sorgemoel at laposte.net
  0 siblings, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2014-01-29  8:25 UTC (permalink / raw)
  To: buildroot

Arnout, Jean,

On Wed, 29 Jan 2014 08:00:48 +0100, Arnout Vandecappelle wrote:

> > Aaah, interesting, I didn't know that. So it would probably make a lot
> > of sense to improve the ISO9660 support to:
> >
> >   * Generate just an ISO9660 root filesystem image by default
> >
> >   * Optionally, make it bootable using either Grub or isolinux
> >
> >   * Optionally, replace the ISO9660 root filesystem by an initramfs
> 
>   The third one fits better in the genimages approach IMHO. The second 
> one as well - except that that is not possible, once the iso image is 
> created you can't make it bootable anymore. So yes, I think that would 
> really improve the iso9660 support.

I agree.

>   However, I would also be happy with a patch that simply adds an option 
> to use isolinux instead of grub for the current iso9660 infrastructure.

Yes, this would be interesting regardless of the other possible
improvements discussed above.

Bottomline: Jean, if you could add the possibility of using isolinux as
part of the existing fs/iso9660 stuff, that would be great.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 1/1] add bootloader option for iso9660 filesystem image (isolinux)
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
                   ` (3 preceding siblings ...)
  2014-01-28 16:30 ` [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader Thomas Petazzoni
@ 2014-02-01 21:17 ` jean.sorgemoel at laposte.net
  2014-02-02 16:28   ` Thomas Petazzoni
  2014-02-04 23:49 ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image jean.sorgemoel at laposte.net
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-02-01 21:17 UTC (permalink / raw)
  To: buildroot

From: jean <jean.sorgemoel@laposte.net>

default generate iso with grub bootloader
you can select isolinux bootloader

detail : (module fs/iso9660)
  option to select bootloader (grub/isolinux)
  file(s) bootloader configuration
  option to copy file(s) on iso (only for isolinux)
  option to create iso with long filenames (Joliet format)
  option to create iso with POSIX file system (file mode, uid, gid, ...)
  define volume label
  define parameter input charset
  can use initramfs (if activate), also cpio (like initrd)

Signed-off-by: jean <jean.sorgemoel@laposte.net>
---
 fs/iso9660/Config.in    |   81 +++++++++++++++++++++++++++++++++++++++++++++--
 fs/iso9660/bootmsg.txt  |    4 +++
 fs/iso9660/iso9660.mk   |   77 +++++++++++++++++++++++++++++++++++++++++---
 fs/iso9660/isolinux.cfg |   10 ++++++
 4 files changed, 165 insertions(+), 7 deletions(-)
 create mode 100644 fs/iso9660/bootmsg.txt
 create mode 100644 fs/iso9660/isolinux.cfg

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 50b4377..c82915c 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -2,17 +2,92 @@ config BR2_TARGET_ROOTFS_ISO9660
 	bool "iso image"
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
+	help
+	  Build a bootable iso9660 image
+
+choice
+	prompt "Bootloader"
+	default BR2_TARGET_ROOTFS_ISO9660_GRUB
+	depends on BR2_TARGET_ROOTFS_ISO9660
+	help
+	  Select bootloader for iso
+
+config BR2_TARGET_ROOTFS_ISO9660_GRUB
+	bool "grub"
 	select BR2_TARGET_ROOTFS_CPIO
 	select BR2_TARGET_GRUB
 	select BR2_TARGET_GRUB_FS_ISO9660
 	help
-	  Build a bootable iso9660 image
+	  Use bootloader Grub.
 
-config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+	bool "isolinux"
+#	select BR2_TARGET_ROOTFS_INITRAMFS
+	select BR2_TARGET_ROOTFS_CPIO
+	select BR2_TARGET_SYSLINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX
+	help
+	  Use bootloader Isolinux (syslinux).
+
+endchoice
+
+if BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+config BR2_TARGET_ROOTFS_ISO9660_GRUB_BOOT_MENU
 	string "Boot menu.lst file"
-	depends on BR2_TARGET_ROOTFS_ISO9660
 	default "fs/iso9660/menu.lst"
 
+endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE
+	string "Boot message"
+	default "fs/iso9660/bootmsg.txt"
+	help
+	  Filename is contain boot message
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE
+	string "Configuration file"
+	default "fs/iso9660/isolinux.cfg"
+	help
+	  isolinux configuration file
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_EXTRA_FILES
+	string "Extra files copy on image"
+	default ""
+	help
+	  list of file (binary or other) copy directly on iso
+	  (separate by space, target directory 'extra')
+	  ex. :
+	    $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32
+
+endif # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
+config BR2_TARGET_ROOTFS_ISO9660_JOLIET
+	bool "Create iso with Joliet format"
+	help
+	  Create iso image with Joliet format (long filenames)
+
+config BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
+	bool "Generate Rock Ridge directory information"
+	help
+	  Generate Rock Ridge directory information,
+	  which includes file mode, uid, gid, etc...
+
+config BR2_TARGET_ROOTFS_ISO9660_NAME
+	string "Volume label"
+	default "buildroot"
+	help
+	  cdrom name
+
+config BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
+	string "Define parameter input charset"
+	default "iso8859-15"
+	help
+	  define parameter input charset
+	  (see program genisoimage : genisoimage -input-charset help)
+
 comment "iso image needs a Linux kernel to be built"
 	depends on BR2_i386 || BR2_x86_64
 	depends on !BR2_LINUX_KERNEL
diff --git a/fs/iso9660/bootmsg.txt b/fs/iso9660/bootmsg.txt
new file mode 100644
index 0000000..e67951b
--- /dev/null
+++ b/fs/iso9660/bootmsg.txt
@@ -0,0 +1,4 @@
+Buildroot isolinux boot
+  buildroot) launch linux
+  harddrive) Hard Drive (first partition)
+
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index a6a9c95..c39d244 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -8,8 +8,16 @@
 ################################################################################
 
 ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
-ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_GRUB_BOOT_MENU))
+ISO9660_TARGET_DIR_EXTRA = $(ISO9660_TARGET_DIR)/extra
+QUOTE = "
+ISO9660_LIST_EXTRA = $(subst $(QUOTE),,$(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_EXTRA_FILES))
 
+define copy_files_isolinux_image_extra
+	cp $(1) $(ISO9660_TARGET_DIR_EXTRA);
+endef
+
+# Build ISO9660 with bootloader Grub
 $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
 	mkdir -p $(ISO9660_TARGET_DIR)
@@ -31,8 +39,15 @@ endif
 	rm -f $(FAKEROOT_SCRIPT)
 	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 	# Use fakeroot so mkisofs believes the previous fakery
-	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
-		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
+	echo "$(HOST_DIR)/usr/bin/genisoimage " \
+		"$(GENISOIMAGE_OPTION) " \
+		"-b boot/grub/stage2_eltorito " \
+		"-no-emul-boot " \
+		"-boot-load-size 4 " \
+		"-boot-info-table " \
+		"-input-charset $(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET) " \
+		"-V $(BR2_TARGET_ROOTFS_ISO9660_NAME) " \
+		"-o $@ $(ISO9660_TARGET_DIR)" \
 		>> $(FAKEROOT_SCRIPT)
 	chmod a+x $(FAKEROOT_SCRIPT)
 	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
@@ -41,11 +56,65 @@ endif
 
 rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
 
+# Build ISO9660 with bootloader ISOLINUX
+$(BINARIES_DIR)/rootfs.isolinux.iso9660: host-cdrkit host-fakeroot linux syslinux rootfs-cpio
+	@$(call MESSAGE,"Generating root filesystem image rootfs.isolinux.iso9660")
+	@mkdir -p $(ISO9660_TARGET_DIR)
+	@mkdir -p $(ISO9660_TARGET_DIR_EXTRA)
+
+	@cp $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE) $(ISO9660_TARGET_DIR)
+
+	@cp $(BINARIES_DIR)/isolinux.bin $(ISO9660_TARGET_DIR)
+	@cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)
+	@cp $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE) $(ISO9660_TARGET_DIR)/isolinux.cfg
+
+ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
+	@$(SED) '/INITRD/d'  $(ISO9660_TARGET_DIR)/isolinux.cfg
+else
+	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
+endif
+
+	@$(foreach file, $(ISO9660_LIST_EXTRA), $(call copy_files_isolinux_image_extra, $(file) ) )
+
+	# Use fakeroot to pretend all target binaries are owned by root
+	rm -f $(FAKEROOT_SCRIPT)
+	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
+	# Use fakeroot so mkisofs believes the previous fakery
+	echo "$(HOST_DIR)/usr/bin/genisoimage " \
+		"$(GENISOIMAGE_OPTION) " \
+		"-b isolinux.bin " \
+		"-no-emul-boot " \
+		"-c boot.cat " \
+		"-boot-load-size 4 " \
+		"-boot-info-table " \
+		"-input-charset $(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET) " \
+		"-V $(BR2_TARGET_ROOTFS_ISO9660_NAME) " \
+		"-o $@ $(ISO9660_TARGET_DIR)" \
+		>> $(FAKEROOT_SCRIPT)
+	chmod a+x $(FAKEROOT_SCRIPT)
+	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
+	- at rm -f $(FAKEROOT_SCRIPT)
+	- at rm -rf $(ISO9660_TARGET_DIR)
+
+rootfs-isolinux-iso9660: $(BINARIES_DIR)/rootfs.isolinux.iso9660
+
 ################################################################################
 #
 # Toplevel Makefile options
 #
 ################################################################################
-ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
 TARGETS += rootfs-iso9660
 endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+TARGETS += rootfs-isolinux-iso9660
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_JOLIET),y)
+GENISOIMAGE_OPTION += -J
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE),y)
+GENISOIMAGE_OPTION += -R
+endif
diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
new file mode 100644
index 0000000..f4887e4
--- /dev/null
+++ b/fs/iso9660/isolinux.cfg
@@ -0,0 +1,10 @@
+display bootmsg.txt
+default buildroot
+timeout 20
+prompt 1
+LABEL buildroot
+  KERNEL bzImage
+  INITRD initrd
+
+LABEL harddrive
+  LOCALBOOT 0x80
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader
  2014-01-29  8:25           ` Thomas Petazzoni
@ 2014-02-01 21:33             ` jean.sorgemoel at laposte.net
  0 siblings, 0 replies; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-02-01 21:33 UTC (permalink / raw)
  To: buildroot

Thomas, Arnout,

I sent new patch to include your comment.
I modify iso9660 module (add choice to select grub or isolinux)

I'm not happy with my code.
For each image we use different filename:
      rootfs.iso9660 for grub
      rootfs.isolinux.iso9660 for isolinux
The code is similar but we have each difference on dependency (and other 
but not important)

I'm not sure understand optional initramfs (because it's not easy to see 
if option activated) but I implement same method of old module iso9660 
(with grub)

Thanks for your remark (and your time)

Regards,
Jean

> Arnout, Jean,
>
> On Wed, 29 Jan 2014 08:00:48 +0100, Arnout Vandecappelle wrote:
>
>>> Aaah, interesting, I didn't know that. So it would probably make a lot
>>> of sense to improve the ISO9660 support to:
>>>
>>>    * Generate just an ISO9660 root filesystem image by default
>>>
>>>    * Optionally, make it bootable using either Grub or isolinux
>>>
>>>    * Optionally, replace the ISO9660 root filesystem by an initramfs
>>    The third one fits better in the genimages approach IMHO. The second
>> one as well - except that that is not possible, once the iso image is
>> created you can't make it bootable anymore. So yes, I think that would
>> really improve the iso9660 support.
> I agree.
>
>>    However, I would also be happy with a patch that simply adds an option
>> to use isolinux instead of grub for the current iso9660 infrastructure.
> Yes, this would be interesting regardless of the other possible
> improvements discussed above.
>
> Bottomline: Jean, if you could add the possibility of using isolinux as
> part of the existing fs/iso9660 stuff, that would be great.
>
> Thanks a lot!
>
> Thomas

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v3 1/1] add bootloader option for iso9660 filesystem image (isolinux)
  2014-02-01 21:17 ` [Buildroot] [PATCH v3 1/1] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
@ 2014-02-02 16:28   ` Thomas Petazzoni
  0 siblings, 0 replies; 25+ messages in thread
From: Thomas Petazzoni @ 2014-02-02 16:28 UTC (permalink / raw)
  To: buildroot

Jean,

Thanks a lot for working on this! Below are just a few comments, this
is not yet a full review.

On Sat,  1 Feb 2014 22:17:32 +0100, jean.sorgemoel at laposte.net wrote:

> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 50b4377..c82915c 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -2,17 +2,92 @@ config BR2_TARGET_ROOTFS_ISO9660
>  	bool "iso image"
>  	depends on (BR2_i386 || BR2_x86_64)
>  	depends on BR2_LINUX_KERNEL

You need to keep the "select BR2_TARGET_ROOTFS_CPIO" because it is
needed for both the Grub and Isolinux support. Both assume that the
root filesystem will be stored in $(BINARIES_DIR)/rootfs.cpio.

> +	help
> +	  Build a bootable iso9660 image
> +
> +choice
> +	prompt "Bootloader"
> +	default BR2_TARGET_ROOTFS_ISO9660_GRUB
> +	depends on BR2_TARGET_ROOTFS_ISO9660

Replace this dependency by enclosing the entire block of Config.in
options in a:

if BR2_TARGET_ROOTFS_ISO9660

...

endif

> +	help
> +	  Select bootloader for iso

We would like to have slightly better help texts, such as:

	  Select the bootloader that should be used for the bootable
	  ISO9660 image.

> +
> +config BR2_TARGET_ROOTFS_ISO9660_GRUB
> +	bool "grub"
>  	select BR2_TARGET_ROOTFS_CPIO
>  	select BR2_TARGET_GRUB
>  	select BR2_TARGET_GRUB_FS_ISO9660
>  	help
> -	  Build a bootable iso9660 image
> +	  Use bootloader Grub.

	  Use the Grub bootloader for the bootable ISO9660 image.

>  
> -config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
> +config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +	bool "isolinux"
> +#	select BR2_TARGET_ROOTFS_INITRAMFS
> +	select BR2_TARGET_ROOTFS_CPIO

As explained above, not needed, since it should be selected both the
Grub and Isolinux support.

> +	select BR2_TARGET_SYSLINUX
> +	select BR2_TARGET_SYSLINUX_ISOLINUX
> +	help
> +	  Use bootloader Isolinux (syslinux).

	  Use the Isolinux bootloader from the syslinux project as the
	  ISO9660 bootable image bootloader.

> +
> +endchoice
> +
> +if BR2_TARGET_ROOTFS_ISO9660_GRUB
> +
> +config BR2_TARGET_ROOTFS_ISO9660_GRUB_BOOT_MENU
>  	string "Boot menu.lst file"
> -	depends on BR2_TARGET_ROOTFS_ISO9660
>  	default "fs/iso9660/menu.lst"

There's a little problem here because you're renaming the
BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU option to
BR2_TARGET_ROOTFS_ISO9660_GRUB_BOOT_MENU. I think this is good for
consistency, but then you need to add some code in Config.in.legacy for
backward compatibility. See
http://git.buildroot.net/buildroot/tree/Config.in.legacy#n1.

>  
> +endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
> +
> +if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +
> +config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE
> +	string "Boot message"
> +	default "fs/iso9660/bootmsg.txt"
> +	help
> +	  Filename is contain boot message

We want a slightly better help text here.

> +
> +config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE
> +	string "Configuration file"
> +	default "fs/iso9660/isolinux.cfg"
> +	help
> +	  isolinux configuration file

Here as well.

> +
> +config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_EXTRA_FILES
> +	string "Extra files copy on image"
> +	default ""
> +	help
> +	  list of file (binary or other) copy directly on iso
> +	  (separate by space, target directory 'extra')
> +	  ex. :
> +	    $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32

Why is this specific to the Isolinux case?

> +
> +endif # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +
> +config BR2_TARGET_ROOTFS_ISO9660_JOLIET
> +	bool "Create iso with Joliet format"
> +	help
> +	  Create iso image with Joliet format (long filenames)
> +
> +config BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
> +	bool "Generate Rock Ridge directory information"
> +	help
> +	  Generate Rock Ridge directory information,
> +	  which includes file mode, uid, gid, etc...
> +
> +config BR2_TARGET_ROOTFS_ISO9660_NAME
> +	string "Volume label"
> +	default "buildroot"
> +	help
> +	  cdrom name
> +
> +config BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
> +	string "Define parameter input charset"
> +	default "iso8859-15"
> +	help
> +	  define parameter input charset
> +	  (see program genisoimage : genisoimage -input-charset help)

These are definitely interesting, but are not at all related to the
addition of Isolinux support. Could you split your patch into a series
of two patches: one adding these additional options, one adding the
Isolinux support?

Also, for each of these options, we can a slightly better help text.
Also, the short description should be more uniform. The option for
Joliet is "Create iso with Joliet format", while your second option is
"Generate Rock Ridge directory information". This is not very
consistent.

> +
>  comment "iso image needs a Linux kernel to be built"
>  	depends on BR2_i386 || BR2_x86_64
>  	depends on !BR2_LINUX_KERNEL
> diff --git a/fs/iso9660/bootmsg.txt b/fs/iso9660/bootmsg.txt
> new file mode 100644
> index 0000000..e67951b
> --- /dev/null
> +++ b/fs/iso9660/bootmsg.txt
> @@ -0,0 +1,4 @@
> +Buildroot isolinux boot
> +  buildroot) launch linux
> +  harddrive) Hard Drive (first partition)
> +
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index a6a9c95..c39d244 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -8,8 +8,16 @@
>  ################################################################################
>  
>  ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
> -ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
> +ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_GRUB_BOOT_MENU))
> +ISO9660_TARGET_DIR_EXTRA = $(ISO9660_TARGET_DIR)/extra
> +QUOTE = "
> +ISO9660_LIST_EXTRA = $(subst $(QUOTE),,$(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_EXTRA_FILES))

We already have the qstrip function for that, so:

ISO9660_LIST_EXTRA = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_EXTRA_FILES))

>  
> +define copy_files_isolinux_image_extra
> +	cp $(1) $(ISO9660_TARGET_DIR_EXTRA);
> +endef

Why is this a separate function?

> +
> +# Build ISO9660 with bootloader Grub
>  $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
>  	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
>  	mkdir -p $(ISO9660_TARGET_DIR)
> @@ -31,8 +39,15 @@ endif
>  	rm -f $(FAKEROOT_SCRIPT)
>  	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
>  	# Use fakeroot so mkisofs believes the previous fakery
> -	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
> -		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
> +	echo "$(HOST_DIR)/usr/bin/genisoimage " \
> +		"$(GENISOIMAGE_OPTION) " \
> +		"-b boot/grub/stage2_eltorito " \
> +		"-no-emul-boot " \
> +		"-boot-load-size 4 " \
> +		"-boot-info-table " \
> +		"-input-charset $(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET) " \
> +		"-V $(BR2_TARGET_ROOTFS_ISO9660_NAME) " \
> +		"-o $@ $(ISO9660_TARGET_DIR)" \
>  		>> $(FAKEROOT_SCRIPT)
>  	chmod a+x $(FAKEROOT_SCRIPT)
>  	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
> @@ -41,11 +56,65 @@ endif
>  
>  rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
>  
> +# Build ISO9660 with bootloader ISOLINUX
> +$(BINARIES_DIR)/rootfs.isolinux.iso9660: host-cdrkit host-fakeroot linux syslinux rootfs-cpio
> +	@$(call MESSAGE,"Generating root filesystem image rootfs.isolinux.iso9660")
> +	@mkdir -p $(ISO9660_TARGET_DIR)
> +	@mkdir -p $(ISO9660_TARGET_DIR_EXTRA)
> +
> +	@cp $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE) $(ISO9660_TARGET_DIR)
> +
> +	@cp $(BINARIES_DIR)/isolinux.bin $(ISO9660_TARGET_DIR)
> +	@cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)
> +	@cp $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE) $(ISO9660_TARGET_DIR)/isolinux.cfg
> +
> +ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> +	@$(SED) '/INITRD/d'  $(ISO9660_TARGET_DIR)/isolinux.cfg
> +else
> +	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
> +endif
> +
> +	@$(foreach file, $(ISO9660_LIST_EXTRA), $(call copy_files_isolinux_image_extra, $(file) ) )
> +
> +	# Use fakeroot to pretend all target binaries are owned by root
> +	rm -f $(FAKEROOT_SCRIPT)
> +	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
> +	# Use fakeroot so mkisofs believes the previous fakery
> +	echo "$(HOST_DIR)/usr/bin/genisoimage " \
> +		"$(GENISOIMAGE_OPTION) " \
> +		"-b isolinux.bin " \
> +		"-no-emul-boot " \
> +		"-c boot.cat " \
> +		"-boot-load-size 4 " \
> +		"-boot-info-table " \
> +		"-input-charset $(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET) " \
> +		"-V $(BR2_TARGET_ROOTFS_ISO9660_NAME) " \
> +		"-o $@ $(ISO9660_TARGET_DIR)" \
> +		>> $(FAKEROOT_SCRIPT)
> +	chmod a+x $(FAKEROOT_SCRIPT)
> +	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
> +	- at rm -f $(FAKEROOT_SCRIPT)
> +	- at rm -rf $(ISO9660_TARGET_DIR)

We really don't want to duplicate this between the Grub case and the
Isolinux case. They should be common, with just a variable that defines
the value to be passed to genisoimage -b option.

> +
> +rootfs-isolinux-iso9660: $(BINARIES_DIR)/rootfs.isolinux.iso9660
> +
>  ################################################################################
>  #
>  # Toplevel Makefile options
>  #
>  ################################################################################
> -ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
>  TARGETS += rootfs-iso9660
>  endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
> +TARGETS += rootfs-isolinux-iso9660
> +endif

As explained above, there should be only one target for both.

> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_JOLIET),y)
> +GENISOIMAGE_OPTION += -J
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE),y)
> +GENISOIMAGE_OPTION += -R
> +endif

These should be *before* the rootfs-iso9660 target. Also, please name
the variable GENISOIMAGE_OPTS.

> diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> new file mode 100644
> index 0000000..f4887e4
> --- /dev/null
> +++ b/fs/iso9660/isolinux.cfg
> @@ -0,0 +1,10 @@
> +display bootmsg.txt
> +default buildroot
> +timeout 20
> +prompt 1
> +LABEL buildroot
> +  KERNEL bzImage
> +  INITRD initrd
> +
> +LABEL harddrive
> +  LOCALBOOT 0x80

Again, thanks a lot for this work!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
                   ` (4 preceding siblings ...)
  2014-02-01 21:17 ` [Buildroot] [PATCH v3 1/1] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
@ 2014-02-04 23:49 ` jean.sorgemoel at laposte.net
  2014-02-04 23:49   ` [Buildroot] [PATCH v4 2/2] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
  2014-02-17  6:47   ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image Arnout Vandecappelle
  2014-03-01 21:00 ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) jean.sorgemoel at laposte.net
  2014-03-02 21:41 ` [Buildroot] [PATCH v6 1/2] adding bootloader option for iso9660 filesystem image jean.sorgemoel at laposte.net
  7 siblings, 2 replies; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-02-04 23:49 UTC (permalink / raw)
  To: buildroot

From: jean <jean.sorgemoel@laposte.net>

detail : (module fs/iso9660)
  option to copy file(s) on iso
  option to create iso with long filenames (Joliet format)
  option to create iso with POSIX file system (file mode, uid, gid, ...)
  define volume label
  define parameter input charset (for genisoimage)

Signed-off-by: jean <jean.sorgemoel@laposte.net>
---
 fs/iso9660/Config.in  |   46 ++++++++++++++++++++++++++++++++++++-
 fs/iso9660/iso9660.mk |   61 +++++++++++++++++++++++++++++++++++++------------
 2 files changed, 92 insertions(+), 15 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 50b4377..9faa93f 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -8,10 +8,54 @@ config BR2_TARGET_ROOTFS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
+if BR2_TARGET_ROOTFS_ISO9660
+
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
-	depends on BR2_TARGET_ROOTFS_ISO9660
 	default "fs/iso9660/menu.lst"
+	help
+	  Grub configuration
+	  Define menu, commands and options for grub
+
+config BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES
+	string "Extra files copy on image"
+	default ""
+	help
+	  list of file (binary or other) copy directly on iso
+	  (separate by space, target directory 'extra')
+	  ex. :
+	    $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32
+	    $(SYSLINUX_BUILDDIR)com32/modules/reboot.c32
+
+config BR2_TARGET_ROOTFS_ISO9660_JOLIET
+	bool "Create iso with Joliet format (long filenames)"
+	help
+	  Generate iso image with Joliet directory records.
+	  Use Unicode and each path component can be up 64
+	  Unicode characters long.
+
+config BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
+	bool "Create iso with Rock Ridge extensions (POSIX Filesystem)"
+	default y
+	help
+	  Generate iso image with Rock Ridge directory information,
+	  POSIX file system (file mode, uid, gid, ...)
+
+config BR2_TARGET_ROOTFS_ISO9660_NAME
+	string "Volume label"
+	default "buildroot"
+	help
+	  cdrom name
+
+config BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
+	string "Define parameter input charset (genisoimage)"
+	default "iso8859-15"
+	help
+	  Defines the local character set you are using on your
+	  machine.
+	  (see program genisoimage : genisoimage -input-charset help)
+
+endif # BR2_TARGET_ROOTFS_ISO9660
 
 comment "iso image needs a Linux kernel to be built"
 	depends on BR2_i386 || BR2_x86_64
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index a6a9c95..2f20f5b 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -9,32 +9,57 @@
 
 ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
 ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ISO9660_TARGET_DIR_EXTRA = $(ISO9660_TARGET_DIR)/extra
+ISO9660_LIST_EXTRA = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES))
+
+BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
+BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
+BOOTLOADER_SRC_CFG = $(ISO9660_BOOT_MENU)
+BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
+ELTORITO_BOOT = boot/grub/stage2_eltorito
 
 $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
-	mkdir -p $(ISO9660_TARGET_DIR)
-	mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
-	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
-	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@mkdir -p $(ISO9660_TARGET_DIR)
+	@mkdir -p $(BOOTLOADER_DIR)
+	@mkdir -p $(ISO9660_TARGET_DIR_EXTRA)
+
+	@cp $(BOOTLOADER_BIN) $(BOOTLOADER_DIR)
+	@cp $(BOOTLOADER_SRC_CFG) $(BOOTLOADER_DST_CFG)
+	@cp $(LINUX_IMAGE_PATH) $(KERNEL_DST)
+
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
-	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/^splashimage/d' $(BOOTLOADER_DST_CFG)
 else
-	cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
-endif
-	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
+endif # BR2_TARGET_GRUB_SPLASH
+
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/initrd/d'  $(BOOTLOADER_DST_CFG)
 else
-	cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
-endif
+	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
+		$(ISO9660_TARGET_DIR)/initrd
+endif # BR2_TARGET_ROOTFS_INITRAMFS
+
+	@$(foreach file, $(ISO9660_LIST_EXTRA), \
+		cp $(file) $(ISO9660_TARGET_DIR_EXTRA)/ ; )
+
 	# Use fakeroot to pretend all target binaries are owned by root
 	rm -f $(FAKEROOT_SCRIPT)
 	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 	# Use fakeroot so mkisofs believes the previous fakery
-	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
-		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
+	echo "$(HOST_DIR)/usr/bin/genisoimage " \
+		"$(GENISOIMAGE_OPTS) " \
+		"-b $(ELTORITO_BOOT) " \
+		"-no-emul-boot " \
+		"-boot-load-size 4 " \
+		"-boot-info-table " \
+		"-input-charset $(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET) " \
+		"-V $(BR2_TARGET_ROOTFS_ISO9660_NAME) " \
+		"-o $@ $(ISO9660_TARGET_DIR)" \
 		>> $(FAKEROOT_SCRIPT)
-	chmod a+x $(FAKEROOT_SCRIPT)
+	@chmod a+x $(FAKEROOT_SCRIPT)
 	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
 	- at rm -f $(FAKEROOT_SCRIPT)
 	- at rm -rf $(ISO9660_TARGET_DIR)
@@ -49,3 +74,11 @@ rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
 ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
 TARGETS += rootfs-iso9660
 endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_JOLIET),y)
+GENISOIMAGE_OPTS += -J
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE),y)
+GENISOIMAGE_OPTS += -R
+endif
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 2/2] add bootloader option for iso9660 filesystem image (isolinux)
  2014-02-04 23:49 ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image jean.sorgemoel at laposte.net
@ 2014-02-04 23:49   ` jean.sorgemoel at laposte.net
  2014-02-17  7:02     ` Arnout Vandecappelle
  2014-02-17  6:47   ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image Arnout Vandecappelle
  1 sibling, 1 reply; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-02-04 23:49 UTC (permalink / raw)
  To: buildroot

From: jean <jean.sorgemoel@laposte.net>

default generate iso with grub bootloader
you can select isolinux bootloader

detail : (module fs/iso9660)
  option to select bootloader (grub/isolinux)
  can use initramfs (if activate), also cpio (like initrd)

Signed-off-by: jean <jean.sorgemoel@laposte.net>
---
 fs/iso9660/Config.in    |   47 ++++++++++++++++++++++++++++++++++++++++++++---
 fs/iso9660/bootmsg.txt  |    4 ++++
 fs/iso9660/iso9660.mk   |   26 ++++++++++++++++++++++++--
 fs/iso9660/isolinux.cfg |   10 ++++++++++
 4 files changed, 82 insertions(+), 5 deletions(-)
 create mode 100644 fs/iso9660/bootmsg.txt
 create mode 100644 fs/iso9660/isolinux.cfg

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 9faa93f..f2b9d2f 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -1,14 +1,37 @@
 config BR2_TARGET_ROOTFS_ISO9660
 	bool "iso image"
+	select BR2_TARGET_ROOTFS_CPIO
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
-	select BR2_TARGET_ROOTFS_CPIO
-	select BR2_TARGET_GRUB
-	select BR2_TARGET_GRUB_FS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
 if BR2_TARGET_ROOTFS_ISO9660
+choice
+	prompt "Bootloader"
+	default BR2_TARGET_ROOTFS_ISO9660_GRUB
+	help
+	  Select the bootloader that should be used for the bootable
+	  ISO9660 image.
+
+config BR2_TARGET_ROOTFS_ISO9660_GRUB
+	bool "grub"
+	select BR2_TARGET_GRUB
+	select BR2_TARGET_GRUB_FS_ISO9660
+	help
+	  Use the Grub bootloader for the bootable ISO9660 image.
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+	bool "isolinux"
+	select BR2_TARGET_SYSLINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX
+	help
+	  Use the Isolinux bootloader from the syslinux project as the
+	  ISO9660 bootable image bootloader.
+
+endchoice
+
+if BR2_TARGET_ROOTFS_ISO9660_GRUB
 
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
@@ -17,6 +40,24 @@ config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	  Grub configuration
 	  Define menu, commands and options for grub
 
+endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE
+	string "Boot message"
+	default "fs/iso9660/bootmsg.txt"
+	help
+	  Displays this filename on the screen at boot time
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE
+	string "Configuration file"
+	default "fs/iso9660/isolinux.cfg"
+	help
+	  This file define all options to start isolinux
+
+endif # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
 config BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES
 	string "Extra files copy on image"
 	default ""
diff --git a/fs/iso9660/bootmsg.txt b/fs/iso9660/bootmsg.txt
new file mode 100644
index 0000000..e67951b
--- /dev/null
+++ b/fs/iso9660/bootmsg.txt
@@ -0,0 +1,4 @@
+Buildroot isolinux boot
+  buildroot) launch linux
+  harddrive) Hard Drive (first partition)
+
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 2f20f5b..66fd1ee 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -12,14 +12,29 @@ ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
 ISO9660_TARGET_DIR_EXTRA = $(ISO9660_TARGET_DIR)/extra
 ISO9660_LIST_EXTRA = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES))
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
+BOOTLOADER_PACKAGE = grub
 BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
 BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
 BOOTLOADER_SRC_CFG = $(ISO9660_BOOT_MENU)
 BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
 KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
 ELTORITO_BOOT = boot/grub/stage2_eltorito
+INITRD_SED_CMD = '/initrd/d'
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+BOOTLOADER_PACKAGE = syslinux
+BOOTLOADER_BIN = $(BINARIES_DIR)/isolinux.bin
+BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)
+BOOTLOADER_SRC_CFG = $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE)
+BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/isolinux.cfg
+KERNEL_DST = $(ISO9660_TARGET_DIR)/bzImage
+ELTORITO_BOOT = isolinux.bin
+INITRD_SED_CMD = '/INITRD/d'
+endif
 
-$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
+$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio $(BOOTLOADER_PACKAGE)
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
 	@mkdir -p $(ISO9660_TARGET_DIR)
 	@mkdir -p $(BOOTLOADER_DIR)
@@ -29,14 +44,21 @@ $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	@cp $(BOOTLOADER_SRC_CFG) $(BOOTLOADER_DST_CFG)
 	@cp $(LINUX_IMAGE_PATH) $(KERNEL_DST)
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
 	@$(SED) '/^splashimage/d' $(BOOTLOADER_DST_CFG)
 else
 	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
 endif # BR2_TARGET_GRUB_SPLASH
+endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+	@cp $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE) \
+		$(ISO9660_TARGET_DIR)
+endif
 
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-	@$(SED) '/initrd/d'  $(BOOTLOADER_DST_CFG)
+	@$(SED) $(INITRD_SED_CMD)  $(BOOTLOADER_DST_CFG)
 else
 	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
 		$(ISO9660_TARGET_DIR)/initrd
diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
new file mode 100644
index 0000000..f4887e4
--- /dev/null
+++ b/fs/iso9660/isolinux.cfg
@@ -0,0 +1,10 @@
+display bootmsg.txt
+default buildroot
+timeout 20
+prompt 1
+LABEL buildroot
+  KERNEL bzImage
+  INITRD initrd
+
+LABEL harddrive
+  LOCALBOOT 0x80
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image
  2014-02-04 23:49 ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image jean.sorgemoel at laposte.net
  2014-02-04 23:49   ` [Buildroot] [PATCH v4 2/2] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
@ 2014-02-17  6:47   ` Arnout Vandecappelle
  1 sibling, 0 replies; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-02-17  6:47 UTC (permalink / raw)
  To: buildroot

 Hi Jean,

 Thanks for your update! Sorry for the late response, the 2014.02 release
is keeping us busy...

 Your patch looks pretty good, even though I still have many (rather
small) comments.

On 05/02/14 00:49, jean.sorgemoel at laposte.net wrote:
> From: jean <jean.sorgemoel@laposte.net>
> 
> detail : (module fs/iso9660)
>   option to copy file(s) on iso
>   option to create iso with long filenames (Joliet format)
>   option to create iso with POSIX file system (file mode, uid, gid, ...)
>   define volume label
>   define parameter input charset (for genisoimage)
> 
> Signed-off-by: jean <jean.sorgemoel@laposte.net>

 Please use your full name for Signed-off-by. Remember that Signed-off-by
is a legal statement, so using anything other than your full real name is
pointless.

 In follow-up patches, please include a patch changelog, separated by ---
from the commit message itself. Alternatively, you can include the
changelog in a cover letter.

> ---
>  fs/iso9660/Config.in  |   46 ++++++++++++++++++++++++++++++++++++-
>  fs/iso9660/iso9660.mk |   61 +++++++++++++++++++++++++++++++++++++------------
>  2 files changed, 92 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 50b4377..9faa93f 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -8,10 +8,54 @@ config BR2_TARGET_ROOTFS_ISO9660
>  	help
>  	  Build a bootable iso9660 image
>  
> +if BR2_TARGET_ROOTFS_ISO9660
> +
>  config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
>  	string "Boot menu.lst file"
> -	depends on BR2_TARGET_ROOTFS_ISO9660
>  	default "fs/iso9660/menu.lst"
> +	help
> +	  Grub configuration
> +	  Define menu, commands and options for grub
> +
> +config BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES
> +	string "Extra files copy on image"
> +	default ""
> +	help
> +	  list of file (binary or other) copy directly on iso
> +	  (separate by space, target directory 'extra')
> +	  ex. :
> +	    $(SYSLINUX_BUILDDIR)com32/hdt/hdt.c32
> +	    $(SYSLINUX_BUILDDIR)com32/modules/reboot.c32

 Why limit this to files only, and why would you put it in the 'extra'
directory? Better to use the approach of BR2_ROOTFS_OVERLAY. You can also
reuse its help text:

"""
  Specify a list of directories that are copied over the iso9660
  filesystem, next to the kernel and initrd images.

  They are copied as-is into the iso9660 filesystem, excluding files
  ending with ~ and .git, .svn and .hg directories.
"""

 The prompt would then be "iso9660 filesystem overlay directories".

> +
> +config BR2_TARGET_ROOTFS_ISO9660_JOLIET
> +	bool "Create iso with Joliet format (long filenames)"
> +	help
> +	  Generate iso image with Joliet directory records.
> +	  Use Unicode and each path component can be up 64
> +	  Unicode characters long.
> +
> +config BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
> +	bool "Create iso with Rock Ridge extensions (POSIX Filesystem)"

 Filesystem -> filesystem

> +	default y

 Why default this to y? It was not y before and it's not needed for the
default kernel+initrd layout.

> +	help
> +	  Generate iso image with Rock Ridge directory information,
> +	  POSIX file system (file mode, uid, gid, ...)

 ... directory information, which makes it a POSIX filesystem...

> +
> +config BR2_TARGET_ROOTFS_ISO9660_NAME
> +	string "Volume label"
> +	default "buildroot"

 I think this should default to empty, like it was before.

> +	help
> +	  cdrom name
> +
> +config BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
> +	string "Define parameter input charset (genisoimage)"
> +	default "iso8859-15"
> +	help
> +	  Defines the local character set you are using on your
> +	  machine.
> +	  (see program genisoimage : genisoimage -input-charset help)

 This description and its default don't seem appropriate to me.

	string "Input filename character encoding"
	default "utf8"
	help
	  The character encoding with which the names of the files that
	  will be copied into the iso9660 filesystem are encoded. For the
	  RockRidge directory, the same encoding will be used. For the
	  Joliet directory, it will be converted to UTF-16.

 However, I wonder how useful this option is. Why would you put files
with non-ASCII characters in the name into the iso9660 filesystem? Also,
does this make sense at all unless either RockRidge or Joliet is used?

> +
> +endif # BR2_TARGET_ROOTFS_ISO9660
>  
>  comment "iso image needs a Linux kernel to be built"
>  	depends on BR2_i386 || BR2_x86_64
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index a6a9c95..2f20f5b 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -9,32 +9,57 @@
>  
>  ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
>  ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))

 Since you define BOOTLOADER_SRC_CFG below, this variable has become
redundant.

> +ISO9660_TARGET_DIR_EXTRA = $(ISO9660_TARGET_DIR)/extra

 As I said, I don't see a reason to keep the extra/

> +ISO9660_LIST_EXTRA = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES))
> +
> +BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
> +BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
> +BOOTLOADER_SRC_CFG = $(ISO9660_BOOT_MENU)
> +BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
> +ELTORITO_BOOT = boot/grub/stage2_eltorito

 All these variables should get an ISO9660_ prefix.

>  
>  $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
>  	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
> -	mkdir -p $(ISO9660_TARGET_DIR)
> -	mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
> -	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
> -	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +	@mkdir -p $(ISO9660_TARGET_DIR)
> +	@mkdir -p $(BOOTLOADER_DIR)
> +	@mkdir -p $(ISO9660_TARGET_DIR_EXTRA)
> +
> +	@cp $(BOOTLOADER_BIN) $(BOOTLOADER_DIR)
> +	@cp $(BOOTLOADER_SRC_CFG) $(BOOTLOADER_DST_CFG)
> +	@cp $(LINUX_IMAGE_PATH) $(KERNEL_DST)
> +
>  ifeq ($(BR2_TARGET_GRUB_SPLASH),)
> -	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +	@$(SED) '/^splashimage/d' $(BOOTLOADER_DST_CFG)
>  else
> -	cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
> -endif
> -	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
> +	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
> +endif # BR2_TARGET_GRUB_SPLASH
> +
>  ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> -	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
> +	@$(SED) '/initrd/d'  $(BOOTLOADER_DST_CFG)
>  else
> -	cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
> -endif
> +	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
> +		$(ISO9660_TARGET_DIR)/initrd
> +endif # BR2_TARGET_ROOTFS_INITRAMFS
> +
> +	@$(foreach file, $(ISO9660_LIST_EXTRA), \
> +		cp $(file) $(ISO9660_TARGET_DIR_EXTRA)/ ; )

 This should use rsync:

        @$(foreach d, $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_EXTRA)),\
                $(call MESSAGE,"Copying overlay $(d)"); \
                rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
                        --chmod=Du+w --exclude .empty --exclude '*~' \
                        $(d)/ $(ISO9660_TARGET_DIR)$(sep))

> +
>  	# Use fakeroot to pretend all target binaries are owned by root
>  	rm -f $(FAKEROOT_SCRIPT)
>  	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
>  	# Use fakeroot so mkisofs believes the previous fakery
> -	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
> -		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
> +	echo "$(HOST_DIR)/usr/bin/genisoimage " \
> +		"$(GENISOIMAGE_OPTS) " \
> +		"-b $(ELTORITO_BOOT) " \
> +		"-no-emul-boot " \
> +		"-boot-load-size 4 " \
> +		"-boot-info-table " \
> +		"-input-charset $(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET) " \
> +		"-V $(BR2_TARGET_ROOTFS_ISO9660_NAME) " \

 You need to qstrip the variable.


 Regards,
 Arnout

> +		"-o $@ $(ISO9660_TARGET_DIR)" \
>  		>> $(FAKEROOT_SCRIPT)
> -	chmod a+x $(FAKEROOT_SCRIPT)
> +	@chmod a+x $(FAKEROOT_SCRIPT)
>  	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
>  	- at rm -f $(FAKEROOT_SCRIPT)
>  	- at rm -rf $(ISO9660_TARGET_DIR)
> @@ -49,3 +74,11 @@ rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
>  ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
>  TARGETS += rootfs-iso9660
>  endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_JOLIET),y)
> +GENISOIMAGE_OPTS += -J
> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE),y)
> +GENISOIMAGE_OPTS += -R
> +endif
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v4 2/2] add bootloader option for iso9660 filesystem image (isolinux)
  2014-02-04 23:49   ` [Buildroot] [PATCH v4 2/2] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
@ 2014-02-17  7:02     ` Arnout Vandecappelle
  0 siblings, 0 replies; 25+ messages in thread
From: Arnout Vandecappelle @ 2014-02-17  7:02 UTC (permalink / raw)
  To: buildroot

 Hi Jean,

On 05/02/14 00:49, jean.sorgemoel at laposte.net wrote:
> From: jean <jean.sorgemoel@laposte.net>
> 
> default generate iso with grub bootloader
> you can select isolinux bootloader
> 
> detail : (module fs/iso9660)
>   option to select bootloader (grub/isolinux)
>   can use initramfs (if activate), also cpio (like initrd)
> 
> Signed-off-by: jean <jean.sorgemoel@laposte.net>
> ---
>  fs/iso9660/Config.in    |   47 ++++++++++++++++++++++++++++++++++++++++++++---
>  fs/iso9660/bootmsg.txt  |    4 ++++
>  fs/iso9660/iso9660.mk   |   26 ++++++++++++++++++++++++--
>  fs/iso9660/isolinux.cfg |   10 ++++++++++
>  4 files changed, 82 insertions(+), 5 deletions(-)
>  create mode 100644 fs/iso9660/bootmsg.txt
>  create mode 100644 fs/iso9660/isolinux.cfg
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 9faa93f..f2b9d2f 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -1,14 +1,37 @@
>  config BR2_TARGET_ROOTFS_ISO9660
>  	bool "iso image"
> +	select BR2_TARGET_ROOTFS_CPIO
>  	depends on (BR2_i386 || BR2_x86_64)
>  	depends on BR2_LINUX_KERNEL
> -	select BR2_TARGET_ROOTFS_CPIO
> -	select BR2_TARGET_GRUB
> -	select BR2_TARGET_GRUB_FS_ISO9660
>  	help
>  	  Build a bootable iso9660 image
>  
>  if BR2_TARGET_ROOTFS_ISO9660
> +choice
> +	prompt "Bootloader"
> +	default BR2_TARGET_ROOTFS_ISO9660_GRUB
> +	help
> +	  Select the bootloader that should be used for the bootable
> +	  ISO9660 image.

 Actually, Kconfig doesn't show help text associated with a choice. So
this is pointless.

> +
> +config BR2_TARGET_ROOTFS_ISO9660_GRUB
> +	bool "grub"
> +	select BR2_TARGET_GRUB
> +	select BR2_TARGET_GRUB_FS_ISO9660
> +	help
> +	  Use the Grub bootloader for the bootable ISO9660 image.
> +
> +config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +	bool "isolinux"
> +	select BR2_TARGET_SYSLINUX
> +	select BR2_TARGET_SYSLINUX_ISOLINUX
> +	help
> +	  Use the Isolinux bootloader from the syslinux project as the
> +	  ISO9660 bootable image bootloader.
> +
> +endchoice
> +
> +if BR2_TARGET_ROOTFS_ISO9660_GRUB
>  
>  config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
>  	string "Boot menu.lst file"
> @@ -17,6 +40,24 @@ config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
>  	  Grub configuration
>  	  Define menu, commands and options for grub
>  
> +endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
> +
> +if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +
> +config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE
> +	string "Boot message"
> +	default "fs/iso9660/bootmsg.txt"
> +	help
> +	  Displays this filename on the screen at boot time

 It's the contents of that file that is displayed, not the filename :-)

> +
> +config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE
> +	string "Configuration file"
> +	default "fs/iso9660/isolinux.cfg"
> +	help
> +	  This file define all options to start isolinux

 defines

> +
> +endif # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
> +
>  config BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES
>  	string "Extra files copy on image"
>  	default ""
> diff --git a/fs/iso9660/bootmsg.txt b/fs/iso9660/bootmsg.txt
> new file mode 100644
> index 0000000..e67951b
> --- /dev/null
> +++ b/fs/iso9660/bootmsg.txt
> @@ -0,0 +1,4 @@
> +Buildroot isolinux boot
> +  buildroot) launch linux

 Launch linux from the CD-ROM

> +  harddrive) Hard Drive (first partition)
> +
> diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
> index 2f20f5b..66fd1ee 100644
> --- a/fs/iso9660/iso9660.mk
> +++ b/fs/iso9660/iso9660.mk
> @@ -12,14 +12,29 @@ ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
>  ISO9660_TARGET_DIR_EXTRA = $(ISO9660_TARGET_DIR)/extra
>  ISO9660_LIST_EXTRA = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_EXTRA_FILES))
>  
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
> +BOOTLOADER_PACKAGE = grub
>  BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
>  BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
>  BOOTLOADER_SRC_CFG = $(ISO9660_BOOT_MENU)
>  BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
>  KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
>  ELTORITO_BOOT = boot/grub/stage2_eltorito
> +INITRD_SED_CMD = '/initrd/d'

 You can avoid this additional variable by using '/initrd\|INITRD/d'

> +endif
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
> +BOOTLOADER_PACKAGE = syslinux
> +BOOTLOADER_BIN = $(BINARIES_DIR)/isolinux.bin
> +BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)
> +BOOTLOADER_SRC_CFG = $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE)
> +BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/isolinux.cfg
> +KERNEL_DST = $(ISO9660_TARGET_DIR)/bzImage

 I see no reason to call it 'bzImage' for one bootloader and 'kernel' for
another. Probably both of them should be called bzImage. Even better
would be to use $(LINUX_IMAGE_NAME) but that requires an addition sed of
the config file, and is pretty pointless since on x86 the only other
option is vmlinux which AFAIK doesn't boot from either bootloader.

> +ELTORITO_BOOT = isolinux.bin
> +INITRD_SED_CMD = '/INITRD/d'
> +endif
>  
> -$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
> +$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio $(BOOTLOADER_PACKAGE)
>  	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
>  	@mkdir -p $(ISO9660_TARGET_DIR)
>  	@mkdir -p $(BOOTLOADER_DIR)
> @@ -29,14 +44,21 @@ $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
>  	@cp $(BOOTLOADER_SRC_CFG) $(BOOTLOADER_DST_CFG)
>  	@cp $(LINUX_IMAGE_PATH) $(KERNEL_DST)
>  
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
>  ifeq ($(BR2_TARGET_GRUB_SPLASH),)
>  	@$(SED) '/^splashimage/d' $(BOOTLOADER_DST_CFG)
>  else
>  	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
>  endif # BR2_TARGET_GRUB_SPLASH
> +endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
> +
> +ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
> +	@cp $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE) \
> +		$(ISO9660_TARGET_DIR)
> +endif
>  
>  ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
> -	@$(SED) '/initrd/d'  $(BOOTLOADER_DST_CFG)
> +	@$(SED) $(INITRD_SED_CMD)  $(BOOTLOADER_DST_CFG)

 As I mentioned, here you can use '/initrd\|INITRD/d'

>  else
>  	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
>  		$(ISO9660_TARGET_DIR)/initrd
> diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
> new file mode 100644
> index 0000000..f4887e4
> --- /dev/null
> +++ b/fs/iso9660/isolinux.cfg
> @@ -0,0 +1,10 @@
> +display bootmsg.txt

 The bootmsg.txt is actually optional, right? Would it be possible to sed
it out when the option is set to empty?

> +default buildroot
> +timeout 20

 For grub, we have a timeout of 10 seconds. I'd keep the same timeout.

 Regards,
 Arnout

> +prompt 1
> +LABEL buildroot
> +  KERNEL bzImage
> +  INITRD initrd
> +
> +LABEL harddrive
> +  LOCALBOOT 0x80
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub)
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
                   ` (5 preceding siblings ...)
  2014-02-04 23:49 ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image jean.sorgemoel at laposte.net
@ 2014-03-01 21:00 ` jean.sorgemoel at laposte.net
  2014-03-01 21:00   ` [Buildroot] [PATCH v5 2/2] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
  2014-03-02 16:17   ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) Thomas Petazzoni
  2014-03-02 21:41 ` [Buildroot] [PATCH v6 1/2] adding bootloader option for iso9660 filesystem image jean.sorgemoel at laposte.net
  7 siblings, 2 replies; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-03-01 21:00 UTC (permalink / raw)
  To: buildroot

From: Jerome Sagnole <jean.sorgemoel@laposte.net>

Changelog :

patch v1 : new branch to generate iso with bootloader isolinux

patch v2 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Arnout Vandecappelle
        simplify code
          1/ I suppress redundant comment
          2/ Suppress menu and use conditional (replace 'depends on' by 'if/end$
          3/ Modify comment
          4/ suppress option (keyboard, ...)
          5/ replace 8 x space by tabulation
                File : fs/isolinux/isolinux.mk
          6/ suppress extension 'BR2_'
          7/ use variable 'ISOLINUX_DIR'
          8/ suppress keyboard option
          9/ I can't use command '$(INSTALL) -D' beacause I don't define filena$
         10/ Hide command genisoimage (with option $@)

patch v3 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Thomas Petazzoni & Arnout Vandecappelle
        modify comment
        default generate iso with grub bootloader
        you can select isolinux bootloader
        detail : (module fs/iso9660)
          option to select bootloader (grub/isolinux)
          file(s) bootloader configuration
          option to copy file(s) on iso (only for isolinux)
          option to create iso with long filenames (Joliet format)
          option to create iso with POSIX file system (file mode, uid, gid, ...)
          define volume label
          define parameter input charset
          can use initramfs (if activate), also cpio (like initrd)

patch v4 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Arnout Vandecappelle & Thomas Petazzoni
        add choise to select bootloader in iso9660 menu
        modify comment
        seperate code in two patch
          1st patch : update iso9660 with grub
          2nd patch : add new bootloader isolinux

patch v5 part 1: modify bootloader option for iso9660 filesystem image (grub)
        addon to include comment Arnout Vandecappelle & Martin Bark
        modify option to include files and directories in iso image
          suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
          add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
          modify code to include this new option
        modify comment
        modify signed-off-by (use real name)
        keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
          in old code, it defined by default (keep for compatibility)
        modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
        modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
        modify variable name to add prefix 'ISO9660_'
        "qstrip" each variable
          BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
          BR2_TARGET_ROOTFS_ISO9660_NAME
        modify command INITRD_SED_CMD
        modify kernel launch for this iso
          use LINUX_IMAGE_NAME
          add command sed to replace __LINUX_IMAGE_NAME__ in configuration


Signed-off-by: Jerome Sagnole <jean.sorgemoel@laposte.net>
---
 fs/iso9660/Config.in  |   49 ++++++++++++++++++++++++++++++++++-
 fs/iso9660/iso9660.mk |   68 ++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 99 insertions(+), 18 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 50b4377..8020bd8 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -8,10 +8,57 @@ config BR2_TARGET_ROOTFS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
+if BR2_TARGET_ROOTFS_ISO9660
+
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
-	depends on BR2_TARGET_ROOTFS_ISO9660
 	default "fs/iso9660/menu.lst"
+	help
+	  Grub configuration
+	  Define menu, commands and options for grub
+
+config BR2_TARGET_ROOTFS_ISO9660_OVERLAY
+	string "iso9660 filesystem overlay directories"
+	default ""
+	help
+	  Specify a list of directories that are copied over the root of the
+	  iso filesystem after the build has finished and before it is
+	  packed into the iso filesystem image.
+
+	  They are copied as-is into the iso image, excluding files ending
+	  with ~ and .git, .svn and .hg directories.
+
+config BR2_TARGET_ROOTFS_ISO9660_JOLIET
+	bool "Create iso with Joliet format (long filenames)"
+	help
+	  Generate iso image with Joliet directory records.
+	  Use Unicode and each path component can be up 64
+	  Unicode characters long.
+
+config BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
+	bool "Create iso with Rock Ridge extensions (POSIX filesystem)"
+	default y
+	help
+	  Generate iso image with Rock Ridge directory information,
+	  which makes it a POSIX filesystem (file mode, uid, gid, ...)
+
+config BR2_TARGET_ROOTFS_ISO9660_NAME
+	string "Volume label"
+	default ""
+	help
+	  cdrom name
+
+config BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
+	string "Input filename character encoding"
+	default "utf8"
+	help
+	  The character encoding with which the names of the files that
+	  will be copied into the iso9660 filesystem are encoded. For the
+	  RockRidge directory, the same encoding will be used. For the
+	  Joliet directory, it will be converted to UTF-16.
+	  (see program genisoimage : genisoimage -input-charset help)
+
+endif # BR2_TARGET_ROOTFS_ISO9660
 
 comment "iso image needs a Linux kernel to be built"
 	depends on BR2_i386 || BR2_x86_64
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index a6a9c95..fdba96c 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -9,33 +9,59 @@
 
 ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
 ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ISO9660_CHARSET = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET))
+ISO9660_NAME = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_NAME))
+ISO9660_KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
+
+ISO9660_BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
+ISO9660_BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
+ISO9660_BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+ISO9660_ELTORITO_BOOT = boot/grub/stage2_eltorito
 
 $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
-	mkdir -p $(ISO9660_TARGET_DIR)
-	mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
-	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
-	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@mkdir -p $(ISO9660_TARGET_DIR)
+	@mkdir -p $(ISO9660_BOOTLOADER_DIR)
+
+	@cp $(ISO9660_BOOTLOADER_BIN) $(ISO9660_BOOTLOADER_DIR)
+	@cp $(ISO9660_BOOT_MENU) $(ISO9660_BOOTLOADER_DST_CFG)
+	@cp $(LINUX_IMAGE_PATH) $(ISO9660_KERNEL_DST)
+
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
-	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/^splashimage/d' $(ISO9660_BOOTLOADER_DST_CFG)
 else
-	cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
-endif
-	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
+endif # BR2_TARGET_GRUB_SPLASH
+
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/initrd/d'  $(ISO9660_BOOTLOADER_DST_CFG)
 else
-	cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
-endif
+	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
+		$(ISO9660_TARGET_DIR)/initrd
+endif # BR2_TARGET_ROOTFS_INITRAMFS
+
+	@$(foreach d, $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_OVERLAY)), \
+		$(call MESSAGE,"Copying overlay $(d)"); \
+		rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+		      --chmod=Du+w --exclude .empty --exclude '*~' \
+		      $(d)/ $(ISO9660_TARGET_DIR)$(sep))
+
 	# Use fakeroot to pretend all target binaries are owned by root
-	rm -f $(FAKEROOT_SCRIPT)
-	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
+	@rm -f $(FAKEROOT_SCRIPT)
+	@echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 	# Use fakeroot so mkisofs believes the previous fakery
-	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
-		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
+	@echo "$(HOST_DIR)/usr/bin/genisoimage " \
+		"$(GENISOIMAGE_OPTS) " \
+		"-b $(ISO9660_ELTORITO_BOOT) " \
+		"-no-emul-boot " \
+		"-boot-load-size 4 " \
+		"-boot-info-table " \
+		"-input-charset '$(ISO9660_CHARSET)' " \
+		"-V '$(ISO9660_NAME)' " \
+		"-o $@ $(ISO9660_TARGET_DIR)" \
 		>> $(FAKEROOT_SCRIPT)
-	chmod a+x $(FAKEROOT_SCRIPT)
-	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
+	@chmod a+x $(FAKEROOT_SCRIPT)
+	@$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
 	- at rm -f $(FAKEROOT_SCRIPT)
 	- at rm -rf $(ISO9660_TARGET_DIR)
 
@@ -49,3 +75,11 @@ rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
 ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
 TARGETS += rootfs-iso9660
 endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_JOLIET),y)
+GENISOIMAGE_OPTS += -J
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE),y)
+GENISOIMAGE_OPTS += -R
+endif
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v5 2/2] add bootloader option for iso9660 filesystem image (isolinux)
  2014-03-01 21:00 ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) jean.sorgemoel at laposte.net
@ 2014-03-01 21:00   ` jean.sorgemoel at laposte.net
  2014-03-02 16:17   ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) Thomas Petazzoni
  1 sibling, 0 replies; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-03-01 21:00 UTC (permalink / raw)
  To: buildroot

From: Jerome Sagnole <jean.sorgemoel@laposte.net>


Changelog :

patch v1 : new branch to generate iso with bootloader isolinux

patch v2 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Arnout Vandecappelle
        simplify code
          1/ I suppress redundant comment
          2/ Suppress menu and use conditional (replace 'depends on' by 'if/end$
          3/ Modify comment
          4/ suppress option (keyboard, ...)
          5/ replace 8 x space by tabulation
                File : fs/isolinux/isolinux.mk
          6/ suppress extension 'BR2_'
          7/ use variable 'ISOLINUX_DIR'
          8/ suppress keyboard option
          9/ I can't use command '$(INSTALL) -D' beacause I don't define filena$
         10/ Hide command genisoimage (with option $@)

patch v3 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Thomas Petazzoni & Arnout Vandecappelle
        modify comment
        default generate iso with grub bootloader
        you can select isolinux bootloader
        detail : (module fs/iso9660)
          option to select bootloader (grub/isolinux)
          file(s) bootloader configuration
          option to copy file(s) on iso (only for isolinux)
          option to create iso with long filenames (Joliet format)
          option to create iso with POSIX file system (file mode, uid, gid, ...)
          define volume label
          define parameter input charset
          can use initramfs (if activate), also cpio (like initrd)

patch v4 : add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Arnout Vandecappelle & Thomas Petazzoni
        add choise to select bootloader in iso9660 menu
        modify comment
        seperate code in two patch
          1st patch : update iso9660 with grub
          2nd patch : add new bootloader isolinux

patch v5 part 1: modify bootloader option for iso9660 filesystem image (grub)
        addon to include comment Arnout Vandecappelle & Martin Bark
        modify option to include files and directories in iso image
          suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
          add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
          modify code to include this new option
        modify comment
        modify signed-off-by (use real name)
        keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
          in old code, it defined by default (keep for compatibility)
        modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
        modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
        modify variable name to add prefix 'ISO9660_'
        "qstrip" each variable
          BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
          BR2_TARGET_ROOTFS_ISO9660_NAME
        modify command INITRD_SED_CMD
        modify kernel launch for this iso
          use LINUX_IMAGE_NAME
          add command sed to replace __LINUX_IMAGE_NAME__ in configuration

patch v5 part 2: add bootloader option for iso9660 filesystem image (isolinux)
        addon to include comment Arnout Vandecappelle & Martin Bark
        modify comment
        suppress bootmsg.txt in isolinux.cfg if is empty (bootloader isolinux)


Signed-off-by: Jerome Sagnole <jean.sorgemoel@laposte.net>
---
 fs/iso9660/Config.in    |   40 ++++++++++++++++++++++++++++++++++++++--
 fs/iso9660/bootmsg.txt  |    4 ++++
 fs/iso9660/iso9660.mk   |   40 +++++++++++++++++++++++++++++++++++-----
 fs/iso9660/isolinux.cfg |   10 ++++++++++
 fs/iso9660/menu.lst     |    2 +-
 5 files changed, 88 insertions(+), 8 deletions(-)
 create mode 100644 fs/iso9660/bootmsg.txt
 create mode 100644 fs/iso9660/isolinux.cfg

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 8020bd8..a055f2d 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -3,12 +3,30 @@ config BR2_TARGET_ROOTFS_ISO9660
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
 	select BR2_TARGET_ROOTFS_CPIO
-	select BR2_TARGET_GRUB
-	select BR2_TARGET_GRUB_FS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
 if BR2_TARGET_ROOTFS_ISO9660
+choice
+	prompt "Bootloader"
+	default BR2_TARGET_ROOTFS_ISO9660_GRUB
+	help
+	  Select the bootloader that should be used for the bootable
+	  ISO9660 image.
+
+config BR2_TARGET_ROOTFS_ISO9660_GRUB
+	bool "grub"
+	select BR2_TARGET_GRUB
+	select BR2_TARGET_GRUB_FS_ISO9660
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+	bool "isolinux"
+	select BR2_TARGET_SYSLINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX
+
+endchoice
+
+if BR2_TARGET_ROOTFS_ISO9660_GRUB
 
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
@@ -17,6 +35,24 @@ config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	  Grub configuration
 	  Define menu, commands and options for grub
 
+endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE
+	string "Boot message"
+	default "fs/iso9660/bootmsg.txt"
+	help
+	  Displays the contents of this file on the screen at boot time
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE
+	string "Configuration file"
+	default "fs/iso9660/isolinux.cfg"
+	help
+	  This file defines all options to start isolinux
+
+endif # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
 config BR2_TARGET_ROOTFS_ISO9660_OVERLAY
 	string "iso9660 filesystem overlay directories"
 	default ""
diff --git a/fs/iso9660/bootmsg.txt b/fs/iso9660/bootmsg.txt
new file mode 100644
index 0000000..efc9dfc
--- /dev/null
+++ b/fs/iso9660/bootmsg.txt
@@ -0,0 +1,4 @@
+Buildroot isolinux boot
+  buildroot) Launch linux from the CD-ROM
+  harddrive) Hard Drive (first partition)
+
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index fdba96c..d948ad8 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -8,33 +8,63 @@
 ################################################################################
 
 ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
-ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ISO9660_INITRD_SED_CMD = '/initrd/Id'
 ISO9660_CHARSET = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET))
 ISO9660_NAME = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_NAME))
-ISO9660_KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
+ISO9660_KERNEL_DST = $(ISO9660_TARGET_DIR)/$(LINUX_IMAGE_NAME)
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
+ISO9660_BOOTLOADER_PACKAGE = grub
 ISO9660_BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
 ISO9660_BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
+ISO9660_BOOTLOADER_SRC_CFG = $(call qstrip, \
+		$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
 ISO9660_BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
 ISO9660_ELTORITO_BOOT = boot/grub/stage2_eltorito
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+ISO9660_BOOTLOADER_PACKAGE = syslinux
+ISO9660_BOOTLOADER_BIN = $(BINARIES_DIR)/isolinux.bin
+ISO9660_BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)
+ISO9660_BOOTLOADER_SRC_CFG = $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE)
+ISO9660_BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/isolinux.cfg
+ISO9660_ELTORITO_BOOT = isolinux.bin
+ISO9660_BOOT_MESSAGE = $(call qstrip, \
+		$(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE))
+endif
 
-$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
+$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio $(ISO9660_BOOTLOADER_PACKAGE)
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
 	@mkdir -p $(ISO9660_TARGET_DIR)
 	@mkdir -p $(ISO9660_BOOTLOADER_DIR)
 
 	@cp $(ISO9660_BOOTLOADER_BIN) $(ISO9660_BOOTLOADER_DIR)
-	@cp $(ISO9660_BOOT_MENU) $(ISO9660_BOOTLOADER_DST_CFG)
+	@cp $(ISO9660_BOOTLOADER_SRC_CFG) $(ISO9660_BOOTLOADER_DST_CFG)
 	@cp $(LINUX_IMAGE_PATH) $(ISO9660_KERNEL_DST)
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
 	@$(SED) '/^splashimage/d' $(ISO9660_BOOTLOADER_DST_CFG)
 else
 	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
 endif # BR2_TARGET_GRUB_SPLASH
+endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+ifeq ($(ISO9660_BOOT_MESSAGE),)
+	@$(SED) '/display bootmsg.txt/d' $(ISO9660_BOOTLOADER_DST_CFG)
+else
+	@cp $(ISO9660_BOOT_MESSAGE) \
+		$(ISO9660_TARGET_DIR)
+endif  # ISO9660_BOOT_MESSAGE
+endif  # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
+	@$(SED) 's/__LINUX_IMAGE_NAME__/'$(LINUX_IMAGE_NAME)'/g' \
+		$(ISO9660_BOOTLOADER_DST_CFG)
 
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-	@$(SED) '/initrd/d'  $(ISO9660_BOOTLOADER_DST_CFG)
+	@$(SED) $(ISO9660_INITRD_SED_CMD)  $(ISO9660_BOOTLOADER_DST_CFG)
 else
 	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
 		$(ISO9660_TARGET_DIR)/initrd
diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
new file mode 100644
index 0000000..947d441
--- /dev/null
+++ b/fs/iso9660/isolinux.cfg
@@ -0,0 +1,10 @@
+display bootmsg.txt
+default buildroot
+timeout 10
+prompt 1
+LABEL buildroot
+  KERNEL __LINUX_IMAGE_NAME__
+  INITRD initrd
+
+LABEL harddrive
+  LOCALBOOT 0x80
diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst
index c0bbff6..8cfb5e0 100644
--- a/fs/iso9660/menu.lst
+++ b/fs/iso9660/menu.lst
@@ -12,7 +12,7 @@ foreground 	000000
 background 	cccccc
 
 title		Buildroot ISO9660 image
-kernel		/kernel
+kernel		/__LINUX_IMAGE_NAME__
 initrd		/initrd
 
 title		Hard Drive (first partition)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub)
  2014-03-01 21:00 ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) jean.sorgemoel at laposte.net
  2014-03-01 21:00   ` [Buildroot] [PATCH v5 2/2] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
@ 2014-03-02 16:17   ` Thomas Petazzoni
  2014-03-02 19:04     ` jean.sorgemoel at laposte.net
  1 sibling, 1 reply; 25+ messages in thread
From: Thomas Petazzoni @ 2014-03-02 16:17 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat,  1 Mar 2014 22:00:55 +0100, jean.sorgemoel at laposte.net wrote:
> From: Jerome Sagnole <jean.sorgemoel@laposte.net>
> 
> Changelog :
> 
> patch v1 : new branch to generate iso with bootloader isolinux
> 
> patch v2 : add bootloader option for iso9660 filesystem image (isolinux)
>         addon to include comment Arnout Vandecappelle
>         simplify code
>           1/ I suppress redundant comment
>           2/ Suppress menu and use conditional (replace 'depends on' by 'if/end$
>           3/ Modify comment
>           4/ suppress option (keyboard, ...)
>           5/ replace 8 x space by tabulation
>                 File : fs/isolinux/isolinux.mk
>           6/ suppress extension 'BR2_'
>           7/ use variable 'ISOLINUX_DIR'
>           8/ suppress keyboard option
>           9/ I can't use command '$(INSTALL) -D' beacause I don't define filena$
>          10/ Hide command genisoimage (with option $@)
> 
> patch v3 : add bootloader option for iso9660 filesystem image (isolinux)
>         addon to include comment Thomas Petazzoni & Arnout Vandecappelle
>         modify comment
>         default generate iso with grub bootloader
>         you can select isolinux bootloader
>         detail : (module fs/iso9660)
>           option to select bootloader (grub/isolinux)
>           file(s) bootloader configuration
>           option to copy file(s) on iso (only for isolinux)
>           option to create iso with long filenames (Joliet format)
>           option to create iso with POSIX file system (file mode, uid, gid, ...)
>           define volume label
>           define parameter input charset
>           can use initramfs (if activate), also cpio (like initrd)
> 
> patch v4 : add bootloader option for iso9660 filesystem image (isolinux)
>         addon to include comment Arnout Vandecappelle & Thomas Petazzoni
>         add choise to select bootloader in iso9660 menu
>         modify comment
>         seperate code in two patch
>           1st patch : update iso9660 with grub
>           2nd patch : add new bootloader isolinux
> 
> patch v5 part 1: modify bootloader option for iso9660 filesystem image (grub)
>         addon to include comment Arnout Vandecappelle & Martin Bark
>         modify option to include files and directories in iso image
>           suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
>           add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
>           modify code to include this new option
>         modify comment
>         modify signed-off-by (use real name)
>         keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
>           in old code, it defined by default (keep for compatibility)
>         modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
>         modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>         modify variable name to add prefix 'ISO9660_'
>         "qstrip" each variable
>           BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>           BR2_TARGET_ROOTFS_ISO9660_NAME
>         modify command INITRD_SED_CMD
>         modify kernel launch for this iso
>           use LINUX_IMAGE_NAME
>           add command sed to replace __LINUX_IMAGE_NAME__ in configuration

This changelog should go after the "---" sign below. Moreover your
commit should have a proper title, like:

	fs/iso9660: <short description>

and a proper commit log, with several paragraphs explaining what the
commit is changing. Your title mentions only "modify bootloader
option", but your commit does *much* more than that. If your commit
does multiple things, it should be split into several commits. Your
commit actually seems to be doing several things:

 * Adding multiple new options for ISO9660 filesystems: Joliet,
   RockRidge, name, input charset, overlay, etc.

 * Adding the infrastructure to use different bootloaders.

Those two things should lead to two separate patches.

See also
http://buildroot.org/downloads/manual/manual.html#_patch_revision_changelog
on how to format a git commit log with a changelog.

> Signed-off-by: Jerome Sagnole <jean.sorgemoel@laposte.net>
> ---
>  fs/iso9660/Config.in  |   49 ++++++++++++++++++++++++++++++++++-
>  fs/iso9660/iso9660.mk |   68 ++++++++++++++++++++++++++++++++++++-------------
>  2 files changed, 99 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
> index 50b4377..8020bd8 100644
> --- a/fs/iso9660/Config.in
> +++ b/fs/iso9660/Config.in
> @@ -8,10 +8,57 @@ config BR2_TARGET_ROOTFS_ISO9660
>  	help
>  	  Build a bootable iso9660 image
>  
> +if BR2_TARGET_ROOTFS_ISO9660
> +
>  config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
>  	string "Boot menu.lst file"
> -	depends on BR2_TARGET_ROOTFS_ISO9660
>  	default "fs/iso9660/menu.lst"
> +	help
> +	  Grub configuration
> +	  Define menu, commands and options for grub
> +
> +config BR2_TARGET_ROOTFS_ISO9660_OVERLAY
> +	string "iso9660 filesystem overlay directories"
> +	default ""
> +	help
> +	  Specify a list of directories that are copied over the root of the
> +	  iso filesystem after the build has finished and before it is
> +	  packed into the iso filesystem image.
> +
> +	  They are copied as-is into the iso image, excluding files ending
> +	  with ~ and .git, .svn and .hg directories.

I must say I'm not a big fan of this. We already have an overlay
mechanism for the root filesystem. I understand that in the case of
iso9660, the root filesystem as generated by Buildroot goes into the
initramfs, and that there is no way to put some more stuff in the
iso9660 filesystem itself (outside the initramfs), I believe that the
direction we are taking here is the wrong one.

Instead, I believe we should turn the iso9660 option into what it
should have been in the first place: using an iso9660 root filesystem.
So we would get rid of the initramfs usage, enable Rock Ridge and
Joliet extensions by default, and put the Buildroot filesystem as is in
the ISO9660 filesystem. This way, no need for an additional overlay
mechanism, we can just re-use the one from Buildroot.

Do you think this would be possible?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub)
  2014-03-02 16:17   ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) Thomas Petazzoni
@ 2014-03-02 19:04     ` jean.sorgemoel at laposte.net
  0 siblings, 0 replies; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-03-02 19:04 UTC (permalink / raw)
  To: buildroot

Hi,

On 02/03/2014 17:17, Thomas Petazzoni wrote:
> Hello,
>
> On Sat,  1 Mar 2014 22:00:55 +0100,jean.sorgemoel at laposte.net  wrote:
>> From: Jerome Sagnole<jean.sorgemoel@laposte.net>
>>
>> Changelog :
>>
>> patch v1 : new branch to generate iso with bootloader isolinux
>>
>> patch v2 : add bootloader option for iso9660 filesystem image (isolinux)
>>          addon to include comment Arnout Vandecappelle
>>          simplify code
>>            1/ I suppress redundant comment
>>            2/ Suppress menu and use conditional (replace 'depends on' by 'if/end$
>>            3/ Modify comment
>>            4/ suppress option (keyboard, ...)
>>            5/ replace 8 x space by tabulation
>>                  File : fs/isolinux/isolinux.mk
>>            6/ suppress extension 'BR2_'
>>            7/ use variable 'ISOLINUX_DIR'
>>            8/ suppress keyboard option
>>            9/ I can't use command '$(INSTALL) -D' beacause I don't define filena$
>>           10/ Hide command genisoimage (with option $@)
>>
>> patch v3 : add bootloader option for iso9660 filesystem image (isolinux)
>>          addon to include comment Thomas Petazzoni & Arnout Vandecappelle
>>          modify comment
>>          default generate iso with grub bootloader
>>          you can select isolinux bootloader
>>          detail : (module fs/iso9660)
>>            option to select bootloader (grub/isolinux)
>>            file(s) bootloader configuration
>>            option to copy file(s) on iso (only for isolinux)
>>            option to create iso with long filenames (Joliet format)
>>            option to create iso with POSIX file system (file mode, uid, gid, ...)
>>            define volume label
>>            define parameter input charset
>>            can use initramfs (if activate), also cpio (like initrd)
>>
>> patch v4 : add bootloader option for iso9660 filesystem image (isolinux)
>>          addon to include comment Arnout Vandecappelle & Thomas Petazzoni
>>          add choise to select bootloader in iso9660 menu
>>          modify comment
>>          seperate code in two patch
>>            1st patch : update iso9660 with grub
>>            2nd patch : add new bootloader isolinux
>>
>> patch v5 part 1: modify bootloader option for iso9660 filesystem image (grub)
>>          addon to include comment Arnout Vandecappelle & Martin Bark
>>          modify option to include files and directories in iso image
>>            suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
>>            add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
>>            modify code to include this new option
>>          modify comment
>>          modify signed-off-by (use real name)
>>          keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
>>            in old code, it defined by default (keep for compatibility)
>>          modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
>>          modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>>          modify variable name to add prefix 'ISO9660_'
>>          "qstrip" each variable
>>            BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
>>            BR2_TARGET_ROOTFS_ISO9660_NAME
>>          modify command INITRD_SED_CMD
>>          modify kernel launch for this iso
>>            use LINUX_IMAGE_NAME
>>            add command sed to replace __LINUX_IMAGE_NAME__ in configuration
> This changelog should go after the "---" sign below. Moreover your
> commit should have a proper title, like:
>
> 	fs/iso9660: <short description>
>
> and a proper commit log, with several paragraphs explaining what the
> commit is changing. Your title mentions only "modify bootloader
> option", but your commit does *much* more than that. If your commit
> does multiple things, it should be split into several commits. Your
> commit actually seems to be doing several things:
>
>   * Adding multiple new options for ISO9660 filesystems: Joliet,
>     RockRidge, name, input charset, overlay, etc.
>
>   * Adding the infrastructure to use different bootloaders.
>
> Those two things should lead to two separate patches.
>
> See also
> http://buildroot.org/downloads/manual/manual.html#_patch_revision_changelog
> on how to format a git commit log with a changelog.

Good remark, I will update my patch.

>> Signed-off-by: Jerome Sagnole<jean.sorgemoel@laposte.net>
>> ---
>>   fs/iso9660/Config.in  |   49 ++++++++++++++++++++++++++++++++++-
>>   fs/iso9660/iso9660.mk |   68 ++++++++++++++++++++++++++++++++++++-------------
>>   2 files changed, 99 insertions(+), 18 deletions(-)
>>
>> diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
>> index 50b4377..8020bd8 100644
>> --- a/fs/iso9660/Config.in
>> +++ b/fs/iso9660/Config.in
>> @@ -8,10 +8,57 @@ config BR2_TARGET_ROOTFS_ISO9660
>>   	help
>>   	  Build a bootable iso9660 image
>>   
>> +if BR2_TARGET_ROOTFS_ISO9660
>> +
>>   config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
>>   	string "Boot menu.lst file"
>> -	depends on BR2_TARGET_ROOTFS_ISO9660
>>   	default "fs/iso9660/menu.lst"
>> +	help
>> +	  Grub configuration
>> +	  Define menu, commands and options for grub
>> +
>> +config BR2_TARGET_ROOTFS_ISO9660_OVERLAY
>> +	string "iso9660 filesystem overlay directories"
>> +	default ""
>> +	help
>> +	  Specify a list of directories that are copied over the root of the
>> +	  iso filesystem after the build has finished and before it is
>> +	  packed into the iso filesystem image.
>> +
>> +	  They are copied as-is into the iso image, excluding files ending
>> +	  with ~ and .git, .svn and .hg directories.
> I must say I'm not a big fan of this. We already have an overlay
> mechanism for the root filesystem. I understand that in the case of
> iso9660, the root filesystem as generated by Buildroot goes into the
> initramfs, and that there is no way to put some more stuff in the
> iso9660 filesystem itself (outside the initramfs), I believe that the
> direction we are taking here is the wrong one.
>
> Instead, I believe we should turn the iso9660 option into what it
> should have been in the first place: using an iso9660 root filesystem.
> So we would get rid of the initramfs usage, enable Rock Ridge and
> Joliet extensions by default, and put the Buildroot filesystem as is in
> the ISO9660 filesystem. This way, no need for an additional overlay
> mechanism, we can just re-use the one from Buildroot.
>
> Do you think this would be possible?
The goal is to copy on iso the binary to choice in boot. (ex. check memory)
The initial code copy only files (not directories). (and without overlay 
method)
What's method can be use?

I will update my patch without this option.
I will enable Joliet extension by default (for Rock Ridge it's ok)

> Thanks,
>
> Thomas

Thanks,
Jerome

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v6 1/2] adding bootloader option for iso9660 filesystem image
  2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
                   ` (6 preceding siblings ...)
  2014-03-01 21:00 ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) jean.sorgemoel at laposte.net
@ 2014-03-02 21:41 ` jean.sorgemoel at laposte.net
  2014-03-02 21:41   ` [Buildroot] [PATCH v6 2/2] add bootloader isolinux " jean.sorgemoel at laposte.net
  7 siblings, 1 reply; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-03-02 21:41 UTC (permalink / raw)
  To: buildroot

From: Jerome Sagnole <jean.sorgemoel@laposte.net>

	* Adding multiple new options for ISO9660 filesystems: Joliet,
	   RockRidge, name, input charset

	* Adding the infrastructure to use different bootloaders.


Signed-off-by: Jerome Sagnole <jean.sorgemoel@laposte.net>
---

changes v4 -> v5:
	* addon to include comment Arnout Vandecappelle & Martin Bark
	* modify option to include files and directories in iso image
	   - suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
	   - add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
	   - modify code to include this new option
	* modify comment
	* modify signed-off-by (use real name)
	* keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
	    in old code, it defined by default (keep for compatibility)
	* modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
	* modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET 
	* modify variable name to add prefix 'ISO9660_'
	* "qstrip" each variable
	    BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
	    BR2_TARGET_ROOTFS_ISO9660_NAME
	* modify command INITRD_SED_CMD
	* modify kernel launch for this iso 
	   - use LINUX_IMAGE_NAME 
	   - add command sed to replace __LINUX_IMAGE_NAME__ in configuration
	* suppress bootmsg.txt in isolinux.cfg is empty (bootloader isolinux)


changes v3 -> v4:
	* addon to include remark Arnout Vandecappelle & Thomas Petazzoni
	* add choise to select bootloader in iso9660 menu
	* modify comment
	* seperate code in two patch
	  1st patch : update iso9660 with grub
	  2nd patch : add new bootloader isolinux


changes v2 -> v3:
	* addon to include remark Thomas Petazzoni & Arnout Vandecappelle
	  - modify comment
	  - default generate iso with grub bootloader
	  - you can select isolinux bootloader
	    - detail : (module fs/iso9660)
	    - option to select bootloader (grub/isolinux)
	    - file(s) bootloader configuration
	    - option to copy file(s) on iso (only for isolinux)
	    - option to create iso with long filenames (Joliet format)
	    - option to create iso with POSIX file system (file mode, uid, gid, ...)
	    - define volume label
	    - define parameter input charset
	    - can use initramfs (if activate), also cpio (like initrd)

changes v1 -> v2:
	* simplify code (suggest by Arnout Vandecappelle)
	  - I suppress redundant comment
	  - Suppress menu and use conditional (replace 'depends on' by 'if/endif')
	  - Modify comment
	  - suppress option (keyboard, ...)
	  - replace 8 x space by tabulation
	  - suppress extension 'BR2_'
	  - use variable 'ISOLINUX_DIR'
	  - suppress keyboard option
	  - I can't use command '$(INSTALL) -D' beacause I don't define filenames (I keep old code)
	  - Hide command genisoimage (with option $@) 

Changes v0 -> v1:
	* new branch to generate iso with bootloader isolinux


 fs/iso9660/Config.in  |   39 ++++++++++++++++++++++++++++++-
 fs/iso9660/iso9660.mk |   62 +++++++++++++++++++++++++++++++++++--------------
 2 files changed, 83 insertions(+), 18 deletions(-)

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index 50b4377..e881ca6 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -8,10 +8,47 @@ config BR2_TARGET_ROOTFS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
+if BR2_TARGET_ROOTFS_ISO9660
+
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
-	depends on BR2_TARGET_ROOTFS_ISO9660
 	default "fs/iso9660/menu.lst"
+	help
+	  Grub configuration
+	  Define menu, commands and options for grub
+
+config BR2_TARGET_ROOTFS_ISO9660_JOLIET
+	bool "Create iso with Joliet format (long filenames)"
+	default y
+	help
+	  Generate iso image with Joliet directory records.
+	  Use Unicode and each path component can be up 64
+	  Unicode characters long.
+
+config BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
+	bool "Create iso with Rock Ridge extensions (POSIX filesystem)"
+	default y
+	help
+	  Generate iso image with Rock Ridge directory information,
+	  which makes it a POSIX filesystem (file mode, uid, gid, ...)
+
+config BR2_TARGET_ROOTFS_ISO9660_NAME
+	string "Volume label"
+	default ""
+	help
+	  cdrom name
+
+config BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
+	string "Input filename character encoding"
+	default "utf8"
+	help
+	  The character encoding with which the names of the files that
+	  will be copied into the iso9660 filesystem are encoded. For the
+	  RockRidge directory, the same encoding will be used. For the
+	  Joliet directory, it will be converted to UTF-16.
+	  (see program genisoimage : genisoimage -input-charset help)
+
+endif # BR2_TARGET_ROOTFS_ISO9660
 
 comment "iso image needs a Linux kernel to be built"
 	depends on BR2_i386 || BR2_x86_64
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index a6a9c95..7ac84ca 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -9,33 +9,53 @@
 
 ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
 ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ISO9660_CHARSET = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET))
+ISO9660_NAME = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_NAME))
+ISO9660_KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
+
+ISO9660_BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
+ISO9660_BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
+ISO9660_BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+ISO9660_ELTORITO_BOOT = boot/grub/stage2_eltorito
 
 $(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
-	mkdir -p $(ISO9660_TARGET_DIR)
-	mkdir -p $(ISO9660_TARGET_DIR)/boot/grub
-	cp $(GRUB_DIR)/stage2/stage2_eltorito $(ISO9660_TARGET_DIR)/boot/grub/
-	cp $(ISO9660_BOOT_MENU) $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@mkdir -p $(ISO9660_TARGET_DIR)
+	@mkdir -p $(ISO9660_BOOTLOADER_DIR)
+
+	@cp $(ISO9660_BOOTLOADER_BIN) $(ISO9660_BOOTLOADER_DIR)
+	@cp $(ISO9660_BOOT_MENU) $(ISO9660_BOOTLOADER_DST_CFG)
+	@cp $(LINUX_IMAGE_PATH) $(ISO9660_KERNEL_DST)
+
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
-	$(SED) '/^splashimage/d' $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/^splashimage/d' $(ISO9660_BOOTLOADER_DST_CFG)
 else
-	cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
-endif
-	cp $(LINUX_IMAGE_PATH) $(ISO9660_TARGET_DIR)/kernel
+	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
+endif # BR2_TARGET_GRUB_SPLASH
+
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-	$(SED) '/initrd/d'  $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
+	@$(SED) '/initrd/d'  $(ISO9660_BOOTLOADER_DST_CFG)
 else
-	cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) $(ISO9660_TARGET_DIR)/initrd
-endif
+	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
+		$(ISO9660_TARGET_DIR)/initrd
+endif # BR2_TARGET_ROOTFS_INITRAMFS
+
 	# Use fakeroot to pretend all target binaries are owned by root
-	rm -f $(FAKEROOT_SCRIPT)
-	echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
+	@rm -f $(FAKEROOT_SCRIPT)
+	@echo "chown -R 0:0 $(ISO9660_TARGET_DIR)" >> $(FAKEROOT_SCRIPT)
 	# Use fakeroot so mkisofs believes the previous fakery
-	echo "$(HOST_DIR)/usr/bin/genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot " \
-		"-boot-load-size 4 -boot-info-table -o $@ $(ISO9660_TARGET_DIR)" \
+	@echo "$(HOST_DIR)/usr/bin/genisoimage " \
+		"$(GENISOIMAGE_OPTS) " \
+		"-b $(ISO9660_ELTORITO_BOOT) " \
+		"-no-emul-boot " \
+		"-boot-load-size 4 " \
+		"-boot-info-table " \
+		"-input-charset '$(ISO9660_CHARSET)' " \
+		"-V '$(ISO9660_NAME)' " \
+		"-o $@ $(ISO9660_TARGET_DIR)" \
 		>> $(FAKEROOT_SCRIPT)
-	chmod a+x $(FAKEROOT_SCRIPT)
-	$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
+	@chmod a+x $(FAKEROOT_SCRIPT)
+	@$(HOST_DIR)/usr/bin/fakeroot -- $(FAKEROOT_SCRIPT)
 	- at rm -f $(FAKEROOT_SCRIPT)
 	- at rm -rf $(ISO9660_TARGET_DIR)
 
@@ -49,3 +69,11 @@ rootfs-iso9660: $(BINARIES_DIR)/rootfs.iso9660
 ifeq ($(BR2_TARGET_ROOTFS_ISO9660),y)
 TARGETS += rootfs-iso9660
 endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_JOLIET),y)
+GENISOIMAGE_OPTS += -J
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE),y)
+GENISOIMAGE_OPTS += -R
+endif
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Buildroot] [PATCH v6 2/2] add bootloader isolinux for iso9660 filesystem image
  2014-03-02 21:41 ` [Buildroot] [PATCH v6 1/2] adding bootloader option for iso9660 filesystem image jean.sorgemoel at laposte.net
@ 2014-03-02 21:41   ` jean.sorgemoel at laposte.net
  0 siblings, 0 replies; 25+ messages in thread
From: jean.sorgemoel at laposte.net @ 2014-03-02 21:41 UTC (permalink / raw)
  To: buildroot

From: Jerome Sagnole <jean.sorgemoel@laposte.net>

	* Adding bootloader isolinux

	* Modify kernel filename (use variable LINUX_IMAGE_NAME)

	* Update grub/isolinux configuration
		replace __LINUX_IMAGE_NAME__ by value of LINUX_IMAGE_NAME

Signed-off-by: Jerome Sagnole <jean.sorgemoel@laposte.net>
---

changes v4 -> v5:
	* addon to include comment Arnout Vandecappelle & Martin Bark
	* modify option to include files and directories in iso image
	   - suppress option BR2_TARGET_ROOTFS_ISOLINUX_EXTRA_FILES
	   - add option BR2_TARGET_ROOTFS_ISO9660_OVERLAY
	   - modify code to include this new option
	* modify comment
	* modify signed-off-by (use real name)
	* keep default option for BR2_TARGET_ROOTFS_ISO9660_ROCK_RIDGE
	    in old code, it defined by default (keep for compatibility)
	* modify default option for BR2_TARGET_ROOTFS_ISO9660_NAME
	* modify default option for BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET 
	* modify variable name to add prefix 'ISO9660_'
	* "qstrip" each variable
	    BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET
	    BR2_TARGET_ROOTFS_ISO9660_NAME
	* modify command INITRD_SED_CMD
	* modify kernel launch for this iso 
	   - use LINUX_IMAGE_NAME 
	   - add command sed to replace __LINUX_IMAGE_NAME__ in configuration
	* suppress bootmsg.txt in isolinux.cfg is empty (bootloader isolinux)


changes v3 -> v4:
	* addon to include remark Arnout Vandecappelle & Thomas Petazzoni
	* add choise to select bootloader in iso9660 menu
	* modify comment
	* seperate code in two patch
	  1st patch : update iso9660 with grub
	  2nd patch : add new bootloader isolinux


changes v2 -> v3:
	* addon to include remark Thomas Petazzoni & Arnout Vandecappelle
	  - modify comment
	  - default generate iso with grub bootloader
	  - you can select isolinux bootloader
	    - detail : (module fs/iso9660)
	    - option to select bootloader (grub/isolinux)
	    - file(s) bootloader configuration
	    - option to copy file(s) on iso (only for isolinux)
	    - option to create iso with long filenames (Joliet format)
	    - option to create iso with POSIX file system (file mode, uid, gid, ...)
	    - define volume label
	    - define parameter input charset
	    - can use initramfs (if activate), also cpio (like initrd)

changes v1 -> v2:
	* simplify code (suggest by Arnout Vandecappelle)
	  - I suppress redundant comment
	  - Suppress menu and use conditional (replace 'depends on' by 'if/endif')
	  - Modify comment
	  - suppress option (keyboard, ...)
	  - replace 8 x space by tabulation
	  - suppress extension 'BR2_'
	  - use variable 'ISOLINUX_DIR'
	  - suppress keyboard option
	  - I can't use command '$(INSTALL) -D' beacause I don't define filenames (I keep old code)
	  - Hide command genisoimage (with option $@) 

Changes v0 -> v1:
	* new branch to generate iso with bootloader isolinux


 fs/iso9660/Config.in    |   40 ++++++++++++++++++++++++++++++++++++++--
 fs/iso9660/bootmsg.txt  |    4 ++++
 fs/iso9660/iso9660.mk   |   40 +++++++++++++++++++++++++++++++++++-----
 fs/iso9660/isolinux.cfg |   10 ++++++++++
 fs/iso9660/menu.lst     |    2 +-
 5 files changed, 88 insertions(+), 8 deletions(-)
 create mode 100644 fs/iso9660/bootmsg.txt
 create mode 100644 fs/iso9660/isolinux.cfg

diff --git a/fs/iso9660/Config.in b/fs/iso9660/Config.in
index e881ca6..eb45591 100644
--- a/fs/iso9660/Config.in
+++ b/fs/iso9660/Config.in
@@ -3,12 +3,30 @@ config BR2_TARGET_ROOTFS_ISO9660
 	depends on (BR2_i386 || BR2_x86_64)
 	depends on BR2_LINUX_KERNEL
 	select BR2_TARGET_ROOTFS_CPIO
-	select BR2_TARGET_GRUB
-	select BR2_TARGET_GRUB_FS_ISO9660
 	help
 	  Build a bootable iso9660 image
 
 if BR2_TARGET_ROOTFS_ISO9660
+choice
+	prompt "Bootloader"
+	default BR2_TARGET_ROOTFS_ISO9660_GRUB
+	help
+	  Select the bootloader that should be used for the bootable
+	  ISO9660 image.
+
+config BR2_TARGET_ROOTFS_ISO9660_GRUB
+	bool "grub"
+	select BR2_TARGET_GRUB
+	select BR2_TARGET_GRUB_FS_ISO9660
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+	bool "isolinux"
+	select BR2_TARGET_SYSLINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX
+
+endchoice
+
+if BR2_TARGET_ROOTFS_ISO9660_GRUB
 
 config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	string "Boot menu.lst file"
@@ -17,6 +35,24 @@ config BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU
 	  Grub configuration
 	  Define menu, commands and options for grub
 
+endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+if BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE
+	string "Boot message"
+	default "fs/iso9660/bootmsg.txt"
+	help
+	  Displays the contents of this file on the screen at boot time
+
+config BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE
+	string "Configuration file"
+	default "fs/iso9660/isolinux.cfg"
+	help
+	  This file defines all options to start isolinux
+
+endif # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
 config BR2_TARGET_ROOTFS_ISO9660_JOLIET
 	bool "Create iso with Joliet format (long filenames)"
 	default y
diff --git a/fs/iso9660/bootmsg.txt b/fs/iso9660/bootmsg.txt
new file mode 100644
index 0000000..efc9dfc
--- /dev/null
+++ b/fs/iso9660/bootmsg.txt
@@ -0,0 +1,4 @@
+Buildroot isolinux boot
+  buildroot) Launch linux from the CD-ROM
+  harddrive) Hard Drive (first partition)
+
diff --git a/fs/iso9660/iso9660.mk b/fs/iso9660/iso9660.mk
index 7ac84ca..d18538d 100644
--- a/fs/iso9660/iso9660.mk
+++ b/fs/iso9660/iso9660.mk
@@ -8,33 +8,63 @@
 ################################################################################
 
 ISO9660_TARGET_DIR = $(BUILD_DIR)/iso9660
-ISO9660_BOOT_MENU := $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
+ISO9660_INITRD_SED_CMD = '/initrd/Id'
 ISO9660_CHARSET = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_INPUT_CHARSET))
 ISO9660_NAME = $(call qstrip,$(BR2_TARGET_ROOTFS_ISO9660_NAME))
-ISO9660_KERNEL_DST = $(ISO9660_TARGET_DIR)/kernel
+ISO9660_KERNEL_DST = $(ISO9660_TARGET_DIR)/$(LINUX_IMAGE_NAME)
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
+ISO9660_BOOTLOADER_PACKAGE = grub
 ISO9660_BOOTLOADER_BIN = $(GRUB_DIR)/stage2/stage2_eltorito
 ISO9660_BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)/boot/grub/
+ISO9660_BOOTLOADER_SRC_CFG = $(call qstrip, \
+		$(BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU))
 ISO9660_BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/boot/grub/menu.lst
 ISO9660_ELTORITO_BOOT = boot/grub/stage2_eltorito
+endif
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+ISO9660_BOOTLOADER_PACKAGE = syslinux
+ISO9660_BOOTLOADER_BIN = $(BINARIES_DIR)/isolinux.bin
+ISO9660_BOOTLOADER_DIR = $(ISO9660_TARGET_DIR)
+ISO9660_BOOTLOADER_SRC_CFG = $(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_CONFIG_FILE)
+ISO9660_BOOTLOADER_DST_CFG = $(ISO9660_TARGET_DIR)/isolinux.cfg
+ISO9660_ELTORITO_BOOT = isolinux.bin
+ISO9660_BOOT_MESSAGE = $(call qstrip, \
+		$(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX_BOOT_MESSAGE))
+endif
 
-$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio grub
+$(BINARIES_DIR)/rootfs.iso9660: host-cdrkit host-fakeroot linux rootfs-cpio $(ISO9660_BOOTLOADER_PACKAGE)
 	@$(call MESSAGE,"Generating root filesystem image rootfs.iso9660")
 	@mkdir -p $(ISO9660_TARGET_DIR)
 	@mkdir -p $(ISO9660_BOOTLOADER_DIR)
 
 	@cp $(ISO9660_BOOTLOADER_BIN) $(ISO9660_BOOTLOADER_DIR)
-	@cp $(ISO9660_BOOT_MENU) $(ISO9660_BOOTLOADER_DST_CFG)
+	@cp $(ISO9660_BOOTLOADER_SRC_CFG) $(ISO9660_BOOTLOADER_DST_CFG)
 	@cp $(LINUX_IMAGE_PATH) $(ISO9660_KERNEL_DST)
 
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_GRUB),y)
 ifeq ($(BR2_TARGET_GRUB_SPLASH),)
 	@$(SED) '/^splashimage/d' $(ISO9660_BOOTLOADER_DST_CFG)
 else
 	@cp boot/grub/splash.xpm.gz $(ISO9660_TARGET_DIR)/
 endif # BR2_TARGET_GRUB_SPLASH
+endif # BR2_TARGET_ROOTFS_ISO9660_GRUB
+
+ifeq ($(BR2_TARGET_ROOTFS_ISO9660_ISOLINUX),y)
+ifeq ($(ISO9660_BOOT_MESSAGE),)
+	@$(SED) '/display bootmsg.txt/d' $(ISO9660_BOOTLOADER_DST_CFG)
+else
+	@cp $(ISO9660_BOOT_MESSAGE) \
+		$(ISO9660_TARGET_DIR)
+endif  # ISO9660_BOOT_MESSAGE
+endif  # BR2_TARGET_ROOTFS_ISO9660_ISOLINUX
+
+	@$(SED) 's/__LINUX_IMAGE_NAME__/'$(LINUX_IMAGE_NAME)'/g' \
+		$(ISO9660_BOOTLOADER_DST_CFG)
 
 ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
-	@$(SED) '/initrd/d'  $(ISO9660_BOOTLOADER_DST_CFG)
+	@$(SED) $(ISO9660_INITRD_SED_CMD)  $(ISO9660_BOOTLOADER_DST_CFG)
 else
 	@cp $(BINARIES_DIR)/rootfs.cpio$(ROOTFS_CPIO_COMPRESS_EXT) \
 		$(ISO9660_TARGET_DIR)/initrd
diff --git a/fs/iso9660/isolinux.cfg b/fs/iso9660/isolinux.cfg
new file mode 100644
index 0000000..947d441
--- /dev/null
+++ b/fs/iso9660/isolinux.cfg
@@ -0,0 +1,10 @@
+display bootmsg.txt
+default buildroot
+timeout 10
+prompt 1
+LABEL buildroot
+  KERNEL __LINUX_IMAGE_NAME__
+  INITRD initrd
+
+LABEL harddrive
+  LOCALBOOT 0x80
diff --git a/fs/iso9660/menu.lst b/fs/iso9660/menu.lst
index c0bbff6..8cfb5e0 100644
--- a/fs/iso9660/menu.lst
+++ b/fs/iso9660/menu.lst
@@ -12,7 +12,7 @@ foreground 	000000
 background 	cccccc
 
 title		Buildroot ISO9660 image
-kernel		/kernel
+kernel		/__LINUX_IMAGE_NAME__
 initrd		/initrd
 
 title		Hard Drive (first partition)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2014-03-02 21:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-16  9:22 [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader jean
2013-08-16 11:49 ` Jean Sorgemoel
2013-08-20 22:24 ` Arnout Vandecappelle
2014-01-28 16:25   ` Thomas Petazzoni
2014-01-28 17:33     ` Arnout Vandecappelle
2014-01-28 21:39       ` Thomas Petazzoni
2014-01-29  7:00         ` Arnout Vandecappelle
2014-01-29  8:25           ` Thomas Petazzoni
2014-02-01 21:33             ` jean.sorgemoel at laposte.net
2014-01-15  0:24 ` [Buildroot] [PATCH v2 1/1] update package isolinux bootloader - simplify code jean.sorgemoel at laposte.net
2014-01-28 16:27   ` Thomas Petazzoni
2014-01-29  7:02     ` Arnout Vandecappelle
2014-01-28 16:30 ` [Buildroot] [PATCH 1/1] new package - generate iso with isolinux bootloader Thomas Petazzoni
2014-02-01 21:17 ` [Buildroot] [PATCH v3 1/1] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
2014-02-02 16:28   ` Thomas Petazzoni
2014-02-04 23:49 ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image jean.sorgemoel at laposte.net
2014-02-04 23:49   ` [Buildroot] [PATCH v4 2/2] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
2014-02-17  7:02     ` Arnout Vandecappelle
2014-02-17  6:47   ` [Buildroot] [PATCH v4 1/2] add option for iso9660 filesystem image Arnout Vandecappelle
2014-03-01 21:00 ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) jean.sorgemoel at laposte.net
2014-03-01 21:00   ` [Buildroot] [PATCH v5 2/2] add bootloader option for iso9660 filesystem image (isolinux) jean.sorgemoel at laposte.net
2014-03-02 16:17   ` [Buildroot] [PATCH v5 1/2] modify bootloader option for iso9660 filesystem image (grub) Thomas Petazzoni
2014-03-02 19:04     ` jean.sorgemoel at laposte.net
2014-03-02 21:41 ` [Buildroot] [PATCH v6 1/2] adding bootloader option for iso9660 filesystem image jean.sorgemoel at laposte.net
2014-03-02 21:41   ` [Buildroot] [PATCH v6 2/2] add bootloader isolinux " jean.sorgemoel at laposte.net

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.