Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 2/2] add bootloader option for iso9660 filesystem image (isolinux)
Date: Mon, 17 Feb 2014 08:02:47 +0100	[thread overview]
Message-ID: <5301B417.3030809@mind.be> (raw)
In-Reply-To: <1391557760-22893-2-git-send-email-jean.sorgemoel@laposte.net>

 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

  reply	other threads:[~2014-02-17  7:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5301B417.3030809@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox