Skip to contentSkip to conversation

Bump and improve syslinux (branch yem/adopted)

PATCH Superseded Yann E. MORIN 3 participants 32 messages Apr 24, 2014 – Apr 28, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Bump and improve syslinux (branch yem/adopted)

From: "Yann E. MORIN" <[email protected]>

Hello All!

Here are a few patches to bump and enhance syslinux:
- patches 1..4: preparatory fixing and cleanup patches
- patches 5..6: new pacakges, dependency of the new syslinux
- patch 7 : actual syslinux bump
- patches 8..9: new options to install new types of blobs

To be noted, the syslinx build system is, well, a bit weird, to say the least. There is I hope extensive-enough information about this in the bump-patch. Please pay it a bit of attention, it is really convoluted, and would benefit from some in-depth review.

Thanks to Franck for his preliminary work on ucl and upx, and to Thomas L. whose extlinux patch prompted me to look at syslinux. ;-)

Regards,
Yann E. MORIN.

The following changes since commit ec6aaa4706d6826aca4e48ea65bbebbd893f76d6:

acpid: unavailable for external uClibc toolchains (2014-04-24 22:35:33 +0200)

are available in the git repository at:

git://gitorious.org/buildroot/buildroot.git yem/adopted

for you to fetch changes up to ccf1ac950371fe7411ff812bb17958a8824be30d:

boot/syslinux: add an option to install an MBR blob (2014-04-25 00:21:46 +0200)

----------------------------------------------------------------
Frank Hunleth (2):
package/ucl: new package
package/upx: new package

Yann E. MORIN (7):
boot/syslinux: needs an ia32-capable compiler boot/syslinux: prepare to install non-core images boot/syslinux: remove 'default y' in sub-options boot/syslinux: rewrite options prompts boot/syslinux: bump version
boot/syslinux: add option to install the EFI image boot/syslinux: add an option to install an MBR blob

 boot/syslinux/Config.in                            | 48 +++++++++++++++++++--
 .../syslinux-000-user-headers-from-sysroot.patch   | 37 ++++++++++++++++
 boot/syslinux/syslinux.mk                          | 50 ++++++++++++++++++----
 package/ucl/ucl.mk                                 | 12 ++++++
 package/upx/upx.mk                                 | 28 ++++++++++++
 5 files changed, 162 insertions(+), 13 deletions(-)
 create mode 100644 boot/syslinux/syslinux-000-user-headers-from-sysroot.patch
 create mode 100644 package/ucl/ucl.mk
 create mode 100644 package/upx/upx.mk
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/9 boot/syslinux: needs an ia32-capable compiler

From: "Yann E. MORIN" <[email protected]>

---
 boot/syslinux/Config.in | 1 +
 1 file changed, 1 insertion(+)
boot/syslinux/Config.in +1 -0
index 2c39e65..5b1122d 100644
@@ -1,6 +1,7 @@
 config BR2_TARGET_SYSLINUX
 	bool "syslinux"
 	depends on BR2_i386 || BR2_x86_64
+	select BR2_HOSTARCH_NEEDS_IA32_COMPILER
 	help
 	  The syslinux bootloader for x86 systems.
 	  This includes: syslinux, pxelinux, extlinux.
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/9 boot/syslinux: needs an ia32-capable compiler

Quoted 4 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

It would be good to mention in the commit log and/or the Config.in why
this dependency is needed. I thought it was because it uses -m32, but now I see that it doesn't...

Regards,
Arnout

Quoted 17 lines
---
 boot/syslinux/Config.in | 1 +
 1 file changed, 1 insertion(+)
boot/syslinux/Config.in +1 -0
index 2c39e65..5b1122d 100644
@@ -1,6 +1,7 @@
 config BR2_TARGET_SYSLINUX
 	bool "syslinux"
 	depends on BR2_i386 || BR2_x86_64
+	select BR2_HOSTARCH_NEEDS_IA32_COMPILER
 	help
 	  The syslinux bootloader for x86 systems.
 	  This includes: syslinux, pxelinux, extlinux.
Signature · 6 lines
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
#3 lore raw

PATCH 1/9 boot/syslinux: needs an ia32-capable compiler

Arnout, All,

On 2014-04-28 07:55 +0200, Arnout Vandecappelle spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 4 lines

From: "Yann E. MORIN" <[email protected]>

It would be good to mention in the commit log and/or the Config.in why
this dependency is needed. I thought it was because it uses -m32, but now I see that it doesn't...

Yes, it does:

    /usr/bin/gcc -idirafter /home/ymorin/dev/buildroot/O/host/usr/include
        -L/home/ymorin/dev/buildroot/O/host/lib
        -L/home/ymorin/dev/buildroot/O/host/usr/lib
        -Wl,-rpath,/home/ymorin/dev/buildroot/O/host/usr/lib
        -Wp,-MT,cpio.o,-MD,./.cpio.o.d
        -std=gnu99
-->     -m32                <----- Here. ;-)
        -march=i386
        -mpreferred-stack-boundary=2 -fno-stack-protector -fwrapv
        -freg-struct-return -Os -fPIC
        -fno-exceptions -fno-asynchronous-unwind-tables -fno-strict-aliasing
        -falign-functions=0 -falign-jumps=0 -falign-labels=0 -falign-loops=0
        -mregparm=3 -DREGPARM=3
        -W -Wall -Wstrict-prototypes -fomit-frame-pointer
        -D__COM32__
        -nostdinc
        -iwithprefix include
        -I/home/ymorin/dev/buildroot/O/build/syslinux-6.02/com32/libutil/include
        -I/home/ymorin/dev/buildroot/O/build/syslinux-6.02/com32/include
        -I/home/ymorin/dev/buildroot/O/build/syslinux-6.02/com32/include/sys
        -I/home/ymorin/dev/buildroot/O/build/syslinux-6.02/com32/gplinclude
        -c -o cpio.o
        /home/ymorin/dev/buildroot/O/build/syslinux-6.02/com32/libupload/cpio.c

If not, then I get the usual 'bits/predefs.h' problem that is solved by installing gcc-multilib.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 2/9 boot/syslinux: prepare to install non-core images

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Currently, we hard-code the path to the images we install, and expect them to be from the core/ sub-dir.

Not all images we can install are located in core/. For example, the efi boot images (to come later) are not located in core/.

Prepare the upcoming installation of extlinux by not expecting images are in core/.

Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/syslinux.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
boot/syslinux/syslinux.mk +3 -3
index 0faa81f..a1eb394 100644
@@ -28,12 +28,12 @@ define SYSLINUX_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) INSTALLROOT=$(HOST_DIR) install
 endef
 
-SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += isolinux.bin
-SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += pxelinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += core/isolinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += core/pxelinux.bin
 
 define SYSLINUX_INSTALL_IMAGES_CMDS
 	for i in $(SYSLINUX_IMAGES-y); do \
-		$(INSTALL) -D -m 0755 $(@D)/core/$$i $(BINARIES_DIR)/$$i; \
+		$(INSTALL) -D -m 0755 $(@D)/$$i $(BINARIES_DIR)/$${i##*/}; \
 	done
 endef
 
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH 3/9 boot/syslinux: remove 'default y' in sub-options

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Remove the 'default y' from sub-options, but ensure at least one is enabled anyway.

We keep the 'default y' to the default option, so that the menuconfig behaviour is not too surprising.

Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/syslinux/Config.in +1 -1
index 5b1122d..1b8c527 100644
@@ -2,6 +2,7 @@ config BR2_TARGET_SYSLINUX
 	bool "syslinux"
 	depends on BR2_i386 || BR2_x86_64
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
 	help
 	  The syslinux bootloader for x86 systems.
 	  This includes: syslinux, pxelinux, extlinux.
@@ -16,6 +17,5 @@ config BR2_TARGET_SYSLINUX_ISOLINUX
 
 config BR2_TARGET_SYSLINUX_PXELINUX
 	bool "Install pxelinux"
-	default y
 
 endif
Signature · 1 line
1.8.3.2
#6 lore raw

PATCH 3/9 boot/syslinux: remove 'default y' in sub-options

Quoted 7 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Remove the 'default y' from sub-options, but ensure at least one is enabled anyway.

We keep the 'default y' to the default option, so that the menuconfig behaviour is not too surprising.

The "surprising" part is that isolinux will be unselected when one of
the other options is selected. If you really want both isolinux and pxelinux, that indeed is surprising. But I think you usually want either, not both. So in that case the fact that you first have to select pxelinux and then unselect isolinux doesn't seem appropriate to me.

Otherwise, looks good to me.

Regards,
Arnout

Quoted 28 lines
Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/syslinux/Config.in +1 -1
index 5b1122d..1b8c527 100644
@@ -2,6 +2,7 @@ config BR2_TARGET_SYSLINUX
 	bool "syslinux"
 	depends on BR2_i386 || BR2_x86_64
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
 	help
 	  The syslinux bootloader for x86 systems.
 	  This includes: syslinux, pxelinux, extlinux.
@@ -16,6 +17,5 @@ config BR2_TARGET_SYSLINUX_ISOLINUX
 
 config BR2_TARGET_SYSLINUX_PXELINUX
 	bool "Install pxelinux"
-	default y
 
 endif
Signature · 6 lines
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
#7 lore raw

PATCH 3/9 boot/syslinux: remove 'default y' in sub-options

Arnout, All,

On 2014-04-25 00:55 +0200, Arnout Vandecappelle spake thusly:

Quoted 6 lines · Yann E. MORIN
Quoted 5 lines

From: "Yann E. MORIN" <[email protected]>

Remove the 'default y' from sub-options, but ensure at least one is enabled anyway.

Quoted 8 lines
Quoted 2 lines

We keep the 'default y' to the default option, so that the menuconfig behaviour is not too surprising.

The "surprising" part is that isolinux will be unselected when one of
the other options is selected. If you really want both isolinux and pxelinux, that indeed is surprising. But I think you usually want either, not both. So in that case the fact that you first have to select pxelinux and then unselect isolinux doesn't seem appropriate to me.

Yes, I was wondering what the expected behaviour would have been. I would expect that something that is forcibly ON by default stays ON, unless I explicitly disable it.

But the expected usage of syslinux is indeed that either is usually used, not both (or more, given the following addition of the MBR, too).

So, I don't really care either way. Let's see what others think, I'll rework the series if needed.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH 4/9 boot/syslinux: rewrite options prompts

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Rewrite the options prompt in preparation to adding a new type of image to install.

Add help entries to each option, too.

---
 boot/syslinux/Config.in | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
boot/syslinux/Config.in +9 -3
index 1b8c527..b92f28f 100644
@@ -12,10 +12,16 @@ config BR2_TARGET_SYSLINUX
 if BR2_TARGET_SYSLINUX
 
 config BR2_TARGET_SYSLINUX_ISOLINUX
-	bool "Install isolinux"
+	bool "isolinux"
 	default y
+	help
+	  Install the legacy BIOS 'isolinux' image, to boot off
+	  optical medias (CDROM, DVD.)
 
 config BR2_TARGET_SYSLINUX_PXELINUX
-	bool "Install pxelinux"
+	bool "pxelinux"
+	help
+	  Install the legacy BIOS 'pxelinux' image, to boot off
+	  the network using PXE.
 
-endif
+endif # BR2_TARGET_SYSLINUX
Signature · 1 line
1.8.3.2
#9 lore raw

PATCH 4/9 boot/syslinux: rewrite options prompts

Quoted 18 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Rewrite the options prompt in preparation to adding a new type of image to install.

Add help entries to each option, too.

---
 boot/syslinux/Config.in | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
boot/syslinux/Config.in +0 -0
index 1b8c527..b92f28f 100644

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 18

Quoted 8 lines
boot/syslinux/Config.in +3 -1
@@ -12,10 +12,16 @@ config BR2_TARGET_SYSLINUX
 if BR2_TARGET_SYSLINUX
 
 config BR2_TARGET_SYSLINUX_ISOLINUX
-	bool "Install isolinux"
+	bool "isolinux"
 	default y
+	help
+	  Install the legacy BIOS 'isolinux' image, to boot off

This sounds like it's a legacy image... I'd just skip the word "legacy".
BIOS is BIOS.

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 19

Quoted 1 line
boot/syslinux/Config.in +1 -0
+	  optical medias (CDROM, DVD.)

The plural of medium is media, without s.

Regards,
Arnout

Quoted 11 lines
boot/syslinux/Config.in +5 -2
 config BR2_TARGET_SYSLINUX_PXELINUX
-	bool "Install pxelinux"
+	bool "pxelinux"
+	help
+	  Install the legacy BIOS 'pxelinux' image, to boot off
+	  the network using PXE.
 
-endif
+endif # BR2_TARGET_SYSLINUX
 
Signature · 6 lines
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
#10 lore raw

PATCH 4/9 boot/syslinux: rewrite options prompts

Arnout, All,

On 2014-04-28 07:57 +0200, Arnout Vandecappelle spake thusly:

Quoted 21 lines · Yann E. MORIN
Quoted 20 lines

From: "Yann E. MORIN" <[email protected]>

Rewrite the options prompt in preparation to adding a new type of image to install.

Add help entries to each option, too.

---
 boot/syslinux/Config.in | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
boot/syslinux/Config.in +0 -0
index 1b8c527..b92f28f 100644
@@ -12,10 +12,16 @@ config BR2_TARGET_SYSLINUX
 if BR2_TARGET_SYSLINUX
 
Quoted 9 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 18

Quoted 6 lines
boot/syslinux/Config.in +3 -1
 config BR2_TARGET_SYSLINUX_ISOLINUX
-	bool "Install isolinux"
+	bool "isolinux"
 	default y
+	help
+	  Install the legacy BIOS 'isolinux' image, to boot off

This sounds like it's a legacy image... I'd just skip the word "legacy".
BIOS is BIOS.

Hmmm. OK.

Side-channel rant: I always wonder how I should call the EFI 'firmware':
- EFI BIOS
- EFI firmware
- BIOS
- firmware
- EFI (but that more a spec than an implementation)

So, I usually refer to what we called BIOS in the early days as the "lecagy BIOS", which is also what you'd find in most EFI BIOSes when you enable "legacy BIOS" (often as a simple and efficient way to by-pass the secure-boot.)

Quoted 3 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 19

Quoted 1 line
boot/syslinux/Config.in +1 -0
+	  optical medias (CDROM, DVD.)

The plural of medium is media, without s.

Yep, it always bites me... Thanks.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH 4/9 boot/syslinux: rewrite options prompts

Quoted 43 lines · Yann E. MORIN

Arnout, All,

On 2014-04-28 07:57 +0200, Arnout Vandecappelle spake thusly:

Quoted 21 lines · Yann E. MORIN
Quoted 20 lines

From: "Yann E. MORIN" <[email protected]>

Rewrite the options prompt in preparation to adding a new type of image to install.

Add help entries to each option, too.

---
 boot/syslinux/Config.in | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
boot/syslinux/Config.in +0 -0
index 1b8c527..b92f28f 100644
@@ -12,10 +12,16 @@ config BR2_TARGET_SYSLINUX
 if BR2_TARGET_SYSLINUX
 
Quoted 9 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 18

Quoted 6 lines
boot/syslinux/Config.in +3 -1
 config BR2_TARGET_SYSLINUX_ISOLINUX
-	bool "Install isolinux"
+	bool "isolinux"
 	default y
+	help
+	  Install the legacy BIOS 'isolinux' image, to boot off

This sounds like it's a legacy image... I'd just skip the word "legacy".
BIOS is BIOS.

Hmmm. OK.

Side-channel rant: I always wonder how I should call the EFI 'firmware':
- EFI BIOS
- EFI firmware
- BIOS
- firmware
- EFI (but that more a spec than an implementation)

Quoted 4 lines

So, I usually refer to what we called BIOS in the early days as the "lecagy BIOS", which is also what you'd find in most EFI BIOSes when you enable "legacy BIOS" (often as a simple and efficient way to by-pass the secure-boot.)

OK, good point. So "legacy BIOS" and "EFI BIOS" it is, then.

Regards,
Arnout

Quoted 10 lines
Quoted 4 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 19

Quoted 2 lines
boot/syslinux/Config.in +1 -0
+	  optical medias (CDROM, DVD.)

The plural of medium is media, without s.

Yep, it always bites me... Thanks.

Regards,
Yann E. MORIN.

Signature · 6 lines
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
#12 lore raw

PATCH 5/9 package/ucl: new package

In reply to Yann E. MORIN

From: Frank Hunleth <[email protected]>

UCL implements a number of compression algorithms that achieve an excellent compression ratio while allowing *very* fast decompression. Decompression requires no additional memory.

This is needed for UPX, which is needed for syslinux 6.x.

[yann.morin.1998 at free.fr: don't add a menuconfig entry, since it
currently is for internal use only]

---
 package/ucl/ucl.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 package/ucl/ucl.mk
package/ucl/ucl.mk new file +12 -0
new file mode 100644
index 0000000..225ad7c
@@ -0,0 +1,12 @@
+################################################################################
+#
+# ucl
+#
+################################################################################
+
+UCL_VERSION = 1.03
+UCL_SITE = http://www.oberhumer.com/opensource/ucl/download/
+UCL_LICENSE = GPLv2+
+UCL_LICENSE_FILES = COPYING
+
+$(eval $(host-autotools-package))
Signature · 1 line
1.8.3.2
#13 lore raw

PATCH 6/9 package/upx: new package

In reply to Yann E. MORIN

From: Frank Hunleth <[email protected]>

UPX is a free, portable, extendable, high-performance executable packer for several executable formats.

This is needed for syslinux 6.x.

[yann.morin.1998 at free.fr: builds fine in parallel; fix build to
locate libucl; fix installation; don't add a menuconfig entry]

---
 package/upx/upx.mk | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/upx/upx.mk
package/upx/upx.mk new file +28 -0
new file mode 100644
index 0000000..a039376
@@ -0,0 +1,28 @@
+################################################################################
+#
+# upx
+#
+################################################################################
+
+UPX_VERSION = 3.91
+UPX_SITE = http://upx.sourceforge.net/download/
+UPX_SOURCE = upx-$(UPX_VERSION)-src.tar.bz2
+UPX_LICENSE = GPLv2+
+UPX_LICENSE_FILES = COPYING
+
+HOST_UPX_DEPENDENCIES = host-ucl
+
+# We need to specify all, otherwise the default target only prints a message
+# stating to "please choose a target for 'make'"... :-(
+define HOST_UPX_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) CPPFLAGS="$(HOST_CPPFLAGS)" \
+	    LDFLAGS="$(HOST_LDFLAGS)" UPX_UCLDIR=$(HOST_DIR)/usr \
+	    -C $(@D) all
+endef
+
+# UPX has no install procedure, so install it manually.
+define HOST_UPX_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/src/upx.out $(HOST_DIR)/usr/bin/upx
+endef
+
+$(eval $(host-generic-package))
Signature · 1 line
1.8.3.2
#14 lore raw

PATCH 6/9 package/upx: new package

Quoted 4 lines · Yann E. MORIN

From: Frank Hunleth <[email protected]>

UPX is a free, portable, extendable, high-performance executable packer for several executable formats.

Just for my understanding: this builds a self-extractor, right? So my
guess is that it won't be able to build a cross-self-extractor... Since we don't have a Config.in, there's no way to encode that information, but perhaps it's worth to add a comment that this tool will only work if target-arch == host-arch.

Quoted 24 lines

This is needed for syslinux 6.x.

[yann.morin.1998 at free.fr: builds fine in parallel; fix build to
locate libucl; fix installation; don't add a menuconfig entry]

---
 package/upx/upx.mk | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/upx/upx.mk
package/upx/upx.mk new file +6 -0
new file mode 100644
index 0000000..a039376
@@ -0,0 +1,28 @@
+################################################################################
+#
+# upx
+#
+################################################################################
+

package/upx/upx.mk line 16

Quoted 10 lines
package/upx/upx.mk new file +10 -0
+UPX_VERSION = 3.91
+UPX_SITE = http://upx.sourceforge.net/download/
+UPX_SOURCE = upx-$(UPX_VERSION)-src.tar.bz2
+UPX_LICENSE = GPLv2+
+UPX_LICENSE_FILES = COPYING
+
+HOST_UPX_DEPENDENCIES = host-ucl
+
+# We need to specify all, otherwise the default target only prints a message
+# stating to "please choose a target for 'make'"... :-(

This comment is entirely redundant IMHO.

package/upx/upx.mk line 18

Quoted 2 lines
package/upx/upx.mk new file +2 -0
+define HOST_UPX_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) CPPFLAGS="$(HOST_CPPFLAGS)" \

Is there something wrong with $(HOST_CONFIGURE_OPTS) ?

package/upx/upx.mk line 23

Quoted 5 lines
package/upx/upx.mk new file +5 -0
+	    LDFLAGS="$(HOST_LDFLAGS)" UPX_UCLDIR=$(HOST_DIR)/usr \
+	    -C $(@D) all
+endef
+
+# UPX has no install procedure, so install it manually.

We also usually don't have this type of comment. It's kind of obvious
that if we install it manually, it's because there is no install procedure.

Regards,
Arnout

Quoted 6 lines
package/upx/upx.mk new file +5 -0
+define HOST_UPX_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/src/upx.out $(HOST_DIR)/usr/bin/upx
+endef
+
+$(eval $(host-generic-package))
Signature · 6 lines
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
#15 lore raw

PATCH 6/9 package/upx: new package

On 2014-04-28 08:03 +0200, Arnout Vandecappelle spake thusly:

Quoted 11 lines · Yann E. MORIN
Quoted 4 lines

From: Frank Hunleth <[email protected]>

UPX is a free, portable, extendable, high-performance executable packer for several executable formats.

Just for my understanding: this builds a self-extractor, right? So my
guess is that it won't be able to build a cross-self-extractor... Since we don't have a Config.in, there's no way to encode that information, but perhaps it's worth to add a comment that this tool will only work if target-arch == host-arch.

Well, that was my (and Frank's) fear, but:

    $ ./host/usr/bin/upx -h
    [--SNIP--]
    This version supports:
        AMD64-darwin.macho               Mach/AMD64
        ARMEL-darwin.macho               Mach/ARMEL
        amd64-linux.elf                  linux/ElfAMD
        amd64-linux.kernel.vmlinux       vmlinux/AMD64
        amd64-win64.pe                   win64/pe
        arm-linux.elf                    linux/armel
        arm-linux.kernel.vmlinux         vmlinux/armel
        arm-wince.pe                     arm/pe
        armeb-linux.elf                  linux/armeb
        armeb-linux.kernel.vmlinux       vmlinux/armeb
        armel-linux.kernel.vmlinuz       vmlinuz/armel
        fat-darwin.macho                 Mach/fat
        i086-dos16.com                   dos/com
        i086-dos16.exe                   dos/exe
        i086-dos16.sys                   dos/sys
        i386-bsd.elf.execve              BSD/386
        i386-darwin.macho                Mach/i386
        i386-dos32.djgpp2.coff           djgpp2/coff
        i386-dos32.tmt.adam              tmt/adam
        i386-dos32.watcom.le             watcom/le
        i386-freebsd.elf                 BSD/elf386
        i386-linux.elf                   linux/elf386
        i386-linux.elf.execve            linux/386
        i386-linux.elf.shell             linux/sh386
        i386-linux.kernel.bvmlinuz       bvmlinuz/386
        i386-linux.kernel.vmlinux        vmlinux/386
        i386-linux.kernel.vmlinuz        vmlinuz/386
        i386-netbsd.elf                  netbsd/elf386
        i386-openbsd.elf                 opnbsd/elf386
        i386-win32.pe                    win32/pe
        m68k-atari.tos                   atari/tos
        mips-linux.elf                   linux/mipseb
        mipsel-linux.elf                 linux/mipsel
        mipsel.r3000-ps1                 ps1/exe
        powerpc-darwin.macho             Mach/ppc32
        powerpc-linux.elf                linux/ElfPPC
        powerpc-linux.kernel.vmlinux     vmlinux/ppc32

So it seems it does not mind being build natively and generate self-extractors for all these archs in the same binary.

But even is it would be only target-arch == host-arch, this is _currently_ not a problem, as the only way to get host-upx is to select syslinux, which is already only available in this case (eg. host and target are both x86) anyway.

Maybe that would warrant a bit of comment in the .mk too.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#16 lore raw

PATCH 7/9 boot/syslinux: bump version

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

This new version has a very, very weird build system. There are different images that syslinux can now build:
- the plain legacy-bios images we already supported previously
- two new EFI32 and EFI64 applications

To build one or the other, the Makefile accepts one or more of:

    make (bios|efi32|efi64)

Specify all of them, and it builds all. Specify 'install', and it installs all of them, as one may expect.

Still a regular behaviour, is to build only a subset (down to one):
make bios <-- builds just the legacy-bios images
make efi32 bios <-- builds just the legacy-bios and efi32 images

Where it gets weird is the install procedure. Can you guess how it's done?
Hint: the syslinux guys have invented the multiple-argument parsing in pure Makefiles. To build then install only the bios images, one would do:
make bios
make bios install

Yep, that's it. make bios install. Two arguments, one action.

That makes for some funky workarounds in our install procedure...

'bios' is the only image we support so far, with efi to come in a future patch.

Using MAKE1, as there are issues with highly-parallel builds.

---
 boot/syslinux/syslinux.mk | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
boot/syslinux/syslinux.mk +24 -8
index a1eb394..bec132f 100644
@@ -4,32 +4,48 @@
 #
 ################################################################################
 
-SYSLINUX_VERSION = 4.07
-SYSLINUX_SOURCE  = syslinux-$(SYSLINUX_VERSION).tar.bz2
-SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/4.xx/
+SYSLINUX_VERSION = 6.02
+SYSLINUX_SOURCE  = syslinux-$(SYSLINUX_VERSION).tar.xz
+SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/
 
 SYSLINUX_LICENSE = GPLv2+
 SYSLINUX_LICENSE_FILES = COPYING
 
 SYSLINUX_INSTALL_IMAGES = YES
 
-SYSLINUX_DEPENDENCIES = host-nasm host-util-linux
+SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
+
+# The syslinux tarball comes with pre-compiled binaries.
+# Since timestamps might not be in the correct order, a rebuild is
+# not always triggered for all the different images.
+# Cleanup the mess even before we attempt a build, so we indeed
+# build everything from source.
+define SYSLINUX_CLEANUP
+	rm -rf $(@D)/bios $(@D)/efi32 $(@D)/efi64
+endef
+SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
 
 # syslinux build system has no convenient way to pass CFLAGS,
 # and the internal zlib should take precedence so -I shouldn't
 # be used.
 define SYSLINUX_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" AR="$(HOSTAR)" -C $(@D)
+	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
+	    AR="$(HOSTAR)" -C $(@D) bios
 endef
 
 define SYSLINUX_INSTALL_TARGET_CMDS
 	# While the actual bootloader is compiled for the target, several
 	# utilities for installing the bootloader are meant for the host.
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) INSTALLROOT=$(HOST_DIR) install
+	# Repeat the target, otherwise syslinux will try to build everything
+	# Repeat CC and AR, since syslinux really wants to check them at
+	# install time
+	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
+	    AR="$(HOSTAR)" INSTALLROOT=$(HOST_DIR) \
+	    -C $(@D) bios install
 endef
 
-SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += core/isolinux.bin
-SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += core/pxelinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
 
 define SYSLINUX_INSTALL_IMAGES_CMDS
 	for i in $(SYSLINUX_IMAGES-y); do \
Signature · 1 line
1.8.3.2
#17 lore raw

PATCH 7/9 boot/syslinux: bump version

Quoted 56 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

This new version has a very, very weird build system. There are different images that syslinux can now build:
- the plain legacy-bios images we already supported previously
- two new EFI32 and EFI64 applications

To build one or the other, the Makefile accepts one or more of:

    make (bios|efi32|efi64)

Specify all of them, and it builds all. Specify 'install', and it installs all of them, as one may expect.

Still a regular behaviour, is to build only a subset (down to one):
make bios <-- builds just the legacy-bios images
make efi32 bios <-- builds just the legacy-bios and efi32 images

Where it gets weird is the install procedure. Can you guess how it's done?
Hint: the syslinux guys have invented the multiple-argument parsing in pure Makefiles. To build then install only the bios images, one would do:
make bios
make bios install

Yep, that's it. make bios install. Two arguments, one action.

That makes for some funky workarounds in our install procedure...

'bios' is the only image we support so far, with efi to come in a future patch.

Using MAKE1, as there are issues with highly-parallel builds.

---
 boot/syslinux/syslinux.mk | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)
boot/syslinux/syslinux.mk +3 -3
index a1eb394..bec132f 100644
@@ -4,32 +4,48 @@
 #
 ################################################################################
 
-SYSLINUX_VERSION = 4.07
-SYSLINUX_SOURCE  = syslinux-$(SYSLINUX_VERSION).tar.bz2
-SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/4.xx/
+SYSLINUX_VERSION = 6.02
+SYSLINUX_SOURCE  = syslinux-$(SYSLINUX_VERSION).tar.xz
+SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/
 
 SYSLINUX_LICENSE = GPLv2+
 SYSLINUX_LICENSE_FILES = COPYING
 

boot/syslinux/syslinux.mk line 22

Quoted 10 lines
boot/syslinux/syslinux.mk +7 -1
 SYSLINUX_INSTALL_IMAGES = YES
 
-SYSLINUX_DEPENDENCIES = host-nasm host-util-linux
+SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
+
+# The syslinux tarball comes with pre-compiled binaries.
+# Since timestamps might not be in the correct order, a rebuild is
+# not always triggered for all the different images.
+# Cleanup the mess even before we attempt a build, so we indeed
+# build everything from source.

Do we really need to build everything from source? We anyway already
check that our host compiler can build for ia32, so the included executables will work.

boot/syslinux/syslinux.mk line 30

Quoted 8 lines
boot/syslinux/syslinux.mk +4 -0
+define SYSLINUX_CLEANUP
+	rm -rf $(@D)/bios $(@D)/efi32 $(@D)/efi64
+endef
+SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
 
 # syslinux build system has no convenient way to pass CFLAGS,
 # and the internal zlib should take precedence so -I shouldn't
 # be used.

Actually, I'm not sure if this comment is still true. I haven't checked
in 6.02, but 4.07 already had a MYCFLAGS variables that can probably be used. Also, the HOST_LDFLAGS may no longer be needed.

boot/syslinux/syslinux.mk line 41

Quoted 13 lines
boot/syslinux/syslinux.mk +5 -2
 define SYSLINUX_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" AR="$(HOSTAR)" -C $(@D)
+	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
+	    AR="$(HOSTAR)" -C $(@D) bios
 endef
 
 define SYSLINUX_INSTALL_TARGET_CMDS
 	# While the actual bootloader is compiled for the target, several
 	# utilities for installing the bootloader are meant for the host.
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) INSTALLROOT=$(HOST_DIR) install
+	# Repeat the target, otherwise syslinux will try to build everything
+	# Repeat CC and AR, since syslinux really wants to check them at
+	# install time

These comments should come before the define, otherwise they'll be
printed while building.

Regards,
Arnout

Quoted 13 lines
boot/syslinux/syslinux.mk +5 -2
+	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
+	    AR="$(HOSTAR)" INSTALLROOT=$(HOST_DIR) \
+	    -C $(@D) bios install
 endef
 
-SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += core/isolinux.bin
-SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += core/pxelinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
 
 define SYSLINUX_INSTALL_IMAGES_CMDS
 	for i in $(SYSLINUX_IMAGES-y); do \
Signature · 6 lines
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
#18 lore raw

PATCH 7/9 boot/syslinux: bump version

On 2014-04-28 08:14 +0200, Arnout Vandecappelle spake thusly:

Quoted 2 lines · Yann E. MORIN
Quoted 1 line

From: "Yann E. MORIN" <[email protected]>

[--SNIP--]

Quoted 20 lines
Quoted 20 lines
boot/syslinux/syslinux.mk +3 -3
index a1eb394..bec132f 100644
@@ -4,32 +4,48 @@
 #
 ################################################################################
 
-SYSLINUX_VERSION = 4.07
-SYSLINUX_SOURCE  = syslinux-$(SYSLINUX_VERSION).tar.bz2
-SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/4.xx/
+SYSLINUX_VERSION = 6.02
+SYSLINUX_SOURCE  = syslinux-$(SYSLINUX_VERSION).tar.xz
+SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/
 
 SYSLINUX_LICENSE = GPLv2+
 SYSLINUX_LICENSE_FILES = COPYING
 
 SYSLINUX_INSTALL_IMAGES = YES
 
Quoted 12 lines

boot/syslinux/syslinux.mk line 22

Quoted 8 lines
boot/syslinux/syslinux.mk +7 -1
-SYSLINUX_DEPENDENCIES = host-nasm host-util-linux
+SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
+
+# The syslinux tarball comes with pre-compiled binaries.
+# Since timestamps might not be in the correct order, a rebuild is
+# not always triggered for all the different images.
+# Cleanup the mess even before we attempt a build, so we indeed
+# build everything from source.

Do we really need to build everything from source? We anyway already
check that our host compiler can build for ia32, so the included executables will work.

We're not only talking about the host utilities, but also the target images (pxelinux, isolinux, mbr, efi32/64).

Yes, we do want to build from sources, so we know how to reproduce a working system, and reproduce a failure so we can fix it, rather than try to debug a binary blob that may have no relation whatsoever with the sources it comes from.

Yes, ew do want to be sure that what gets distributed on the target is indeed coming from the sources (and not a lingering binary that comes in the tarball and may have no relation whatsoever with the souces) for which I can be rather confident I'm compliant.

<troll>
Heck, otherwise, let's just use those pesky proprietary bootloaders and operating systems and applications, no? :-) :-p ;-] (yes, many smileys, that's really just to tease you!)
</troll>

Quoted 5 lines
Quoted 5 lines
boot/syslinux/syslinux.mk +4 -0
+define SYSLINUX_CLEANUP
+	rm -rf $(@D)/bios $(@D)/efi32 $(@D)/efi64
+endef
+SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
 
Quoted 7 lines

boot/syslinux/syslinux.mk line 30

Quoted 3 lines
boot/syslinux/syslinux.mk +0 -0
 # syslinux build system has no convenient way to pass CFLAGS,
 # and the internal zlib should take precedence so -I shouldn't
 # be used.

Actually, I'm not sure if this comment is still true. I haven't checked
in 6.02, but 4.07 already had a MYCFLAGS variables that can probably be used. Also, the HOST_LDFLAGS may no longer be needed.

OK, I'll investigate those, but as a separate patch (it is working as-is, so a change would be a cleanup.)

Quoted 10 lines

boot/syslinux/syslinux.mk line 41

Quoted 7 lines
boot/syslinux/syslinux.mk +3 -1
 define SYSLINUX_INSTALL_TARGET_CMDS
 	# While the actual bootloader is compiled for the target, several
 	# utilities for installing the bootloader are meant for the host.
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) INSTALLROOT=$(HOST_DIR) install
+	# Repeat the target, otherwise syslinux will try to build everything
+	# Repeat CC and AR, since syslinux really wants to check them at
+	# install time

These comments should come before the define, otherwise they'll be
printed while building.

Hey! That's how the existing comments are. ;-)
Will see to clean up that, too.

Thank you for the review! :-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#19 lore raw

PATCH 8/9 boot/syslinux: add option to install the EFI image

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

syslinux can now also build an EFI application.

If the target is 64-bit, we build the 64-bit EFI app, otherwise we build the 32-bit EFI app.

---
 boot/syslinux/Config.in                            | 24 +++++++++++++-
 .../syslinux-000-user-headers-from-sysroot.patch   | 37 ++++++++++++++++++++++
 boot/syslinux/syslinux.mk                          | 21 ++++++++++--
 3 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 boot/syslinux/syslinux-000-user-headers-from-sysroot.patch
boot/syslinux/Config.in +23 -1
index b92f28f..d556c55 100644
@@ -2,7 +2,6 @@ config BR2_TARGET_SYSLINUX
 	bool "syslinux"
 	depends on BR2_i386 || BR2_x86_64
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER
-	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
 	help
 	  The syslinux bootloader for x86 systems.
 	  This includes: syslinux, pxelinux, extlinux.
@@ -11,6 +10,27 @@ config BR2_TARGET_SYSLINUX
 
 if BR2_TARGET_SYSLINUX
 
+choice
+	bool "Image type"
+
+config BR2_TARGET_SYSLINUX_LEGACY_BIOS
+	bool "bios (legacy)"
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
+	help
+	  Install one or more of the the legacy BIOS images:
+	    - isolinux
+	    - pxelinux
+
+config BR2_TARGET_SYSLINUX_EFI
+	bool "efi"
+	select BR2_PACKAGE_GNU_EFI
+	help
+	  Install the 'efi' image, to boot from an EFI environment.
+
+endchoice
+
+if BR2_TARGET_SYSLINUX_LEGACY_BIOS
+
 config BR2_TARGET_SYSLINUX_ISOLINUX
 	bool "isolinux"
 	default y
@@ -24,4 +44,6 @@ config BR2_TARGET_SYSLINUX_PXELINUX
 	  Install the legacy BIOS 'pxelinux' image, to boot off
 	  the network using PXE.
 
+endif # BR2_TARGET_SYSLINUX_LEGACY_BIOS
+
 endif # BR2_TARGET_SYSLINUX
boot/syslinux/syslinux-000-user-headers-from-sysroot.patch new file +37 -0
new file mode 100644
index 0000000..5edf79f
@@ -0,0 +1,37 @@
+efi: look for headers and libs in the sysroot
+
+Currently, syslinux hard-codes search paths to /usr/.... directories.
+This does not play well in cross-compilation.
+
+If $SYSROOT is defined, prepend it to the search paths.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+
+diff -durN syslinux-6.02.orig/efi/find-gnu-efi.sh syslinux-6.02/efi/find-gnu-efi.sh
+--- syslinux-6.02.orig/efi/find-gnu-efi.sh	2013-10-13 19:59:03.000000000 +0200
++++ syslinux-6.02/efi/find-gnu-efi.sh	2014-04-22 00:19:23.638483887 +0200
+@@ -9,7 +9,7 @@
+ find_include()
+ {
+     for d in $include_dirs; do
+-	found=`find $d -name efi -type d 2> /dev/null`
++	found=`find $SYSROOT$d -name efi -type d 2> /dev/null`
+ 	if [ "$found"x != "x" ] && [ -e $found/$ARCH/efibind.h ]; then
+ 	    echo $found
+ 	    break;
+@@ -20,12 +20,12 @@
+ find_lib()
+ {
+     for d in $lib_dirs; do
+-	found=`find $d -name libgnuefi.a 2> /dev/null`
++	found=`find $SYSROOT$d -name libgnuefi.a 2> /dev/null`
+ 	if [ "$found"x != "x" ]; then
+ 	    crt_name='crt0-efi-'$ARCH'.o'
+-	    crt=`find $d -name $crt_name 2> /dev/null`
++	    crt=`find $SYSROOT$d -name $crt_name 2> /dev/null`
+ 	    if [ "$crt"x != "x" ]; then
+-		echo $d
++		echo $SYSROOT$d
+ 		break;
+ 	    fi
+ 	fi
boot/syslinux/syslinux.mk +18 -3
index bec132f..bf0bae5 100644
@@ -15,6 +15,20 @@ SYSLINUX_INSTALL_IMAGES = YES
 
 SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
 
+ifeq ($(BR2_TARGET_SYSLINUX_LEGACY_BIOS),y)
+SYSLINUX_TARGET = bios
+endif
+
+ifeq ($(BR2_TARGET_SYSLINUX_EFI),y)
+ifeq ($(BR2_ARCH_IS_64),y)
+SYSLINUX_EFI_BITS = efi64
+else
+SYSLINUX_EFI_BITS = efi32
+endif # 64-bit
+SYSLINUX_DEPENDENCIES += gnu-efi
+SYSLINUX_TARGET = $(SYSLINUX_EFI_BITS)
+endif # EFI
+
 # The syslinux tarball comes with pre-compiled binaries.
 # Since timestamps might not be in the correct order, a rebuild is
 # not always triggered for all the different images.
@@ -30,7 +44,7 @@ SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
 # be used.
 define SYSLINUX_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
-	    AR="$(HOSTAR)" -C $(@D) bios
+	    AR="$(HOSTAR)" SYSROOT=$(STAGING_DIR) -C $(@D) $(SYSLINUX_TARGET)
 endef
 
 define SYSLINUX_INSTALL_TARGET_CMDS
@@ -40,12 +54,13 @@ define SYSLINUX_INSTALL_TARGET_CMDS
 	# Repeat CC and AR, since syslinux really wants to check them at
 	# install time
 	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
-	    AR="$(HOSTAR)" INSTALLROOT=$(HOST_DIR) \
-	    -C $(@D) bios install
+	    AR="$(HOSTAR)" SYSROOT=$(STAGING_DIR) INSTALLROOT=$(HOST_DIR) \
+	    -C $(@D) $(SYSLINUX_TARGET) install
 endef
 
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_EFI) += $(SYSLINUX_EFI_BITS)/efi/syslinux.efi
 
 define SYSLINUX_INSTALL_IMAGES_CMDS
 	for i in $(SYSLINUX_IMAGES-y); do \
Signature · 1 line
1.8.3.2
#20 lore raw

PATCH 8/9 boot/syslinux: add option to install the EFI image

Quoted 29 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

syslinux can now also build an EFI application.

If the target is 64-bit, we build the 64-bit EFI app, otherwise we build the 32-bit EFI app.

---
 boot/syslinux/Config.in                            | 24 +++++++++++++-
 .../syslinux-000-user-headers-from-sysroot.patch   | 37 ++++++++++++++++++++++
 boot/syslinux/syslinux.mk                          | 21 ++++++++++--
 3 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 boot/syslinux/syslinux-000-user-headers-from-sysroot.patch
boot/syslinux/Config.in +0 -1
index b92f28f..d556c55 100644
@@ -2,7 +2,6 @@ config BR2_TARGET_SYSLINUX
 	bool "syslinux"
 	depends on BR2_i386 || BR2_x86_64
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER
-	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
 	help
 	  The syslinux bootloader for x86 systems.
 	  This includes: syslinux, pxelinux, extlinux.

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 14

Quoted 5 lines
boot/syslinux/Config.in +2 -0
@@ -11,6 +10,27 @@ config BR2_TARGET_SYSLINUX
 
 if BR2_TARGET_SYSLINUX
 
+choice
+	bool "Image type"

Why is this a choice? It's possible to build both, no? Similar to
iso/pxe. So it makes more sense to me to add efi as a third option after iso and pxe.

Quoted 77 lines
boot/syslinux/Config.in +21 -0
+
+config BR2_TARGET_SYSLINUX_LEGACY_BIOS
+	bool "bios (legacy)"
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
+	help
+	  Install one or more of the the legacy BIOS images:
+	    - isolinux
+	    - pxelinux
+
+config BR2_TARGET_SYSLINUX_EFI
+	bool "efi"
+	select BR2_PACKAGE_GNU_EFI
+	help
+	  Install the 'efi' image, to boot from an EFI environment.
+
+endchoice
+
+if BR2_TARGET_SYSLINUX_LEGACY_BIOS
+
 config BR2_TARGET_SYSLINUX_ISOLINUX
 	bool "isolinux"
 	default y
@@ -24,4 +44,6 @@ config BR2_TARGET_SYSLINUX_PXELINUX
 	  Install the legacy BIOS 'pxelinux' image, to boot off
 	  the network using PXE.
 
+endif # BR2_TARGET_SYSLINUX_LEGACY_BIOS
+
 endif # BR2_TARGET_SYSLINUX
boot/syslinux/syslinux-000-user-headers-from-sysroot.patch new file +37 -0
new file mode 100644
index 0000000..5edf79f
@@ -0,0 +1,37 @@
+efi: look for headers and libs in the sysroot
+
+Currently, syslinux hard-codes search paths to /usr/.... directories.
+This does not play well in cross-compilation.
+
+If $SYSROOT is defined, prepend it to the search paths.
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+
+diff -durN syslinux-6.02.orig/efi/find-gnu-efi.sh syslinux-6.02/efi/find-gnu-efi.sh
+--- syslinux-6.02.orig/efi/find-gnu-efi.sh	2013-10-13 19:59:03.000000000 +0200
++++ syslinux-6.02/efi/find-gnu-efi.sh	2014-04-22 00:19:23.638483887 +0200
+@@ -9,7 +9,7 @@
+ find_include()
+ {
+     for d in $include_dirs; do
+-	found=`find $d -name efi -type d 2> /dev/null`
++	found=`find $SYSROOT$d -name efi -type d 2> /dev/null`
+ 	if [ "$found"x != "x" ] && [ -e $found/$ARCH/efibind.h ]; then
+ 	    echo $found
+ 	    break;
+@@ -20,12 +20,12 @@
+ find_lib()
+ {
+     for d in $lib_dirs; do
+-	found=`find $d -name libgnuefi.a 2> /dev/null`
++	found=`find $SYSROOT$d -name libgnuefi.a 2> /dev/null`
+ 	if [ "$found"x != "x" ]; then
+ 	    crt_name='crt0-efi-'$ARCH'.o'
+-	    crt=`find $d -name $crt_name 2> /dev/null`
++	    crt=`find $SYSROOT$d -name $crt_name 2> /dev/null`
+ 	    if [ "$crt"x != "x" ]; then
+-		echo $d
++		echo $SYSROOT$d
+ 		break;
+ 	    fi
+ 	fi
boot/syslinux/syslinux.mk +0 -0
index bec132f..bf0bae5 100644

boot/syslinux/syslinux.mk SYSLINUX_INSTALL_IMAGES = YES · line 19

Quoted 5 lines
boot/syslinux/syslinux.mk +2 -0
@@ -15,6 +15,20 @@ SYSLINUX_INSTALL_IMAGES = YES
 
 SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
 
+ifeq ($(BR2_TARGET_SYSLINUX_LEGACY_BIOS),y)
+SYSLINUX_TARGET = bios

If you follow my suggestion, this would become SYSLINUX_TARGETS of
course. And +=

Regards,
Arnout

Quoted 41 lines
boot/syslinux/syslinux.mk +16 -3
+endif
+
+ifeq ($(BR2_TARGET_SYSLINUX_EFI),y)
+ifeq ($(BR2_ARCH_IS_64),y)
+SYSLINUX_EFI_BITS = efi64
+else
+SYSLINUX_EFI_BITS = efi32
+endif # 64-bit
+SYSLINUX_DEPENDENCIES += gnu-efi
+SYSLINUX_TARGET = $(SYSLINUX_EFI_BITS)
+endif # EFI
+
 # The syslinux tarball comes with pre-compiled binaries.
 # Since timestamps might not be in the correct order, a rebuild is
 # not always triggered for all the different images.
@@ -30,7 +44,7 @@ SYSLINUX_POST_PATCH_HOOKS += SYSLINUX_CLEANUP
 # be used.
 define SYSLINUX_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
-	    AR="$(HOSTAR)" -C $(@D) bios
+	    AR="$(HOSTAR)" SYSROOT=$(STAGING_DIR) -C $(@D) $(SYSLINUX_TARGET)
 endef
 
 define SYSLINUX_INSTALL_TARGET_CMDS
@@ -40,12 +54,13 @@ define SYSLINUX_INSTALL_TARGET_CMDS
 	# Repeat CC and AR, since syslinux really wants to check them at
 	# install time
 	$(TARGET_MAKE_ENV) $(MAKE1) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" \
-	    AR="$(HOSTAR)" INSTALLROOT=$(HOST_DIR) \
-	    -C $(@D) bios install
+	    AR="$(HOSTAR)" SYSROOT=$(STAGING_DIR) INSTALLROOT=$(HOST_DIR) \
+	    -C $(@D) $(SYSLINUX_TARGET) install
 endef
 
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_EFI) += $(SYSLINUX_EFI_BITS)/efi/syslinux.efi
 
 define SYSLINUX_INSTALL_IMAGES_CMDS
 	for i in $(SYSLINUX_IMAGES-y); do \
Signature · 6 lines
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
#21 lore raw

PATCH 8/9 boot/syslinux: add option to install the EFI image

Arnout, All,

On 2014-04-28 08:18 +0200, Arnout Vandecappelle spake thusly:

Quoted 31 lines · Yann E. MORIN
Quoted 30 lines

From: "Yann E. MORIN" <[email protected]>

syslinux can now also build an EFI application.

If the target is 64-bit, we build the 64-bit EFI app, otherwise we build the 32-bit EFI app.

---
 boot/syslinux/Config.in                            | 24 +++++++++++++-
 .../syslinux-000-user-headers-from-sysroot.patch   | 37 ++++++++++++++++++++++
 boot/syslinux/syslinux.mk                          | 21 ++++++++++--
 3 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 boot/syslinux/syslinux-000-user-headers-from-sysroot.patch
boot/syslinux/Config.in +0 -1
index b92f28f..d556c55 100644
@@ -2,7 +2,6 @@ config BR2_TARGET_SYSLINUX
 	bool "syslinux"
 	depends on BR2_i386 || BR2_x86_64
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER
-	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
 	help
 	  The syslinux bootloader for x86 systems.
 	  This includes: syslinux, pxelinux, extlinux.
@@ -11,6 +10,27 @@ config BR2_TARGET_SYSLINUX
 
Quoted 8 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 14

Quoted 4 lines
boot/syslinux/Config.in +2 -0
 if BR2_TARGET_SYSLINUX
 
+choice
+	bool "Image type"

Why is this a choice? It's possible to build both, no? Similar to
iso/pxe. So it makes more sense to me to add efi as a third option after iso and pxe.

Well, the target will be either BIOS-based or an EFI-based, not both. So it seems more logical to make it a choice (Thomas seemed to agree on IRC, as well.)

But thinking of it, we could go even further: iso/pxe/mbr/efi are all _alternate_ methods of booting, so it does not make sense to have more than one selected at any one time.

The only reason pxe/iso are not a choice _currently_ (e.g. syslinux-4.0.7), is that they are always built, and there is a no way to only build one or the other. This is the same behaviour in 6.0.2: you can build any combination of {bios,efi32,efi64} (only one, two, or all of them). But bios will always build pxe and iso (and mbr, see next cset).

In the end, I don't really care, although I'd find it strange to be able to build both at the same time, since the target will have one or the other, not both (well, unless we target a desktop PC with legacy bios enabled in the EFI bios; but we ain't do that, do we?) At worse, I'd chamge it to a choice for everything (although I could understand a case where the user would want both pxe and iso and mbr at the same time.)

Quoted 6 lines
Quoted 6 lines
boot/syslinux/syslinux.mk +0 -0
index bec132f..bf0bae5 100644
@@ -15,6 +15,20 @@ SYSLINUX_INSTALL_IMAGES = YES
 
Quoted 7 lines

boot/syslinux/syslinux.mk SYSLINUX_INSTALL_IMAGES = YES · line 19

Quoted 4 lines
boot/syslinux/syslinux.mk +2 -0
 SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
 
+ifeq ($(BR2_TARGET_SYSLINUX_LEGACY_BIOS),y)
+SYSLINUX_TARGET = bios

If you follow my suggestion, this would become SYSLINUX_TARGETS of
course. And +=

Yes, of course. I already had that in the beginning, but I believe it does not really make sense.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#22 lore raw

PATCH 8/9 boot/syslinux: add option to install the EFI image

Quoted 5 lines · Yann E. MORIN

Arnout, All,

On 2014-04-28 08:18 +0200, Arnout Vandecappelle spake thusly:

Quoted 2 lines · Yann E. MORIN
Quoted 1 line

From: "Yann E. MORIN" <[email protected]>

[snip]

Quoted 15 lines
Quoted 6 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 14

Quoted 2 lines
boot/syslinux/Config.in +2 -0
+choice
+	bool "Image type"

Why is this a choice? It's possible to build both, no? Similar to
iso/pxe. So it makes more sense to me to add efi as a third option after iso and pxe.

Well, the target will be either BIOS-based or an EFI-based, not both. So it seems more logical to make it a choice (Thomas seemed to agree on IRC, as well.)

But thinking of it, we could go even further: iso/pxe/mbr/efi are all _alternate_ methods of booting, so it does not make sense to have more than one selected at any one time.

Quoted 5 lines

The only reason pxe/iso are not a choice _currently_ (e.g. syslinux-4.0.7), is that they are always built, and there is a no way to only build one or the other. This is the same behaviour in 6.0.2: you can build any combination of {bios,efi32,efi64} (only one, two, or all of them). But bios will always build pxe and iso (and mbr, see next cset).

Good point. But then of course, it also doesn't make sense to build both
U-Boot and syslinux :-)

So I'm OK with making iso/pxe/mbr/efi a choice.

When syslinux/extlinux is added, that does add some difficulty because
those can be combined with mbr. But that can be tackled when the problem arises :-).

Regards,
Arnout

Quoted 28 lines

In the end, I don't really care, although I'd find it strange to be able to build both at the same time, since the target will have one or the other, not both (well, unless we target a desktop PC with legacy bios enabled in the EFI bios; but we ain't do that, do we?) At worse, I'd chamge it to a choice for everything (although I could understand a case where the user would want both pxe and iso and mbr at the same time.)

Quoted 6 lines
Quoted 6 lines
boot/syslinux/syslinux.mk +0 -0
index bec132f..bf0bae5 100644
@@ -15,6 +15,20 @@ SYSLINUX_INSTALL_IMAGES = YES
 
Quoted 7 lines

boot/syslinux/syslinux.mk SYSLINUX_INSTALL_IMAGES = YES · line 19

Quoted 4 lines
boot/syslinux/syslinux.mk +2 -0
 SYSLINUX_DEPENDENCIES = host-nasm host-util-linux host-upx
 
+ifeq ($(BR2_TARGET_SYSLINUX_LEGACY_BIOS),y)
+SYSLINUX_TARGET = bios

If you follow my suggestion, this would become SYSLINUX_TARGETS of
course. And +=

Yes, of course. I already had that in the beginning, but I believe it does not really make sense.

Regards,
Yann E. MORIN.

Signature · 6 lines
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
#23 lore raw

PATCH 8/9 boot/syslinux: add option to install the EFI image

Arnout, All,

On 2014-04-28 21:16 +0200, Arnout Vandecappelle spake thusly:

Quoted 28 lines · Yann E. MORIN
Quoted 5 lines

Arnout, All,

On 2014-04-28 08:18 +0200, Arnout Vandecappelle spake thusly:

Quoted 2 lines · Yann E. MORIN
Quoted 1 line

From: "Yann E. MORIN" <[email protected]>

[snip]

Quoted 15 lines
Quoted 6 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 14

Quoted 2 lines
boot/syslinux/Config.in +2 -0
+choice
+	bool "Image type"

Why is this a choice? It's possible to build both, no? Similar to
iso/pxe. So it makes more sense to me to add efi as a third option after iso and pxe.

Well, the target will be either BIOS-based or an EFI-based, not both. So it seems more logical to make it a choice (Thomas seemed to agree on IRC, as well.)

But thinking of it, we could go even further: iso/pxe/mbr/efi are all _alternate_ methods of booting, so it does not make sense to have more than one selected at any one time.

Quoted 5 lines

The only reason pxe/iso are not a choice _currently_ (e.g. syslinux-4.0.7), is that they are always built, and there is a no way to only build one or the other. This is the same behaviour in 6.0.2: you can build any combination of {bios,efi32,efi64} (only one, two, or all of them). But bios will always build pxe and iso (and mbr, see next cset).

Quoted 8 lines

Good point. But then of course, it also doesn't make sense to build both
U-Boot and syslinux :-)

So I'm OK with making iso/pxe/mbr/efi a choice.

When syslinux/extlinux is added, that does add some difficulty because
those can be combined with mbr. But that can be tackled when the problem arises :-).

Not really, because extlinux is a host tools that prepares a partition to be booted from the mbr blob.

Here is the way you'd use extlinux:
- prepare a device with at least one partition
- format that partition as ext2/3/4
- run extlinux on that partition

     -> extlinux installs some files in that filesystem
     -> and then installs a special boot-record as the first sector of
        the partition (yes, the first sector of an ext2/3/4 FS is free
        to use)

- dump the mbr.bin blob as the MBR (eg. on the first sector of the partition)

So, we need not add an option of extlinux since it is not an image like pxelinux or isolinux, but really a host tool.

The addition of the mbr option in patch #9 is just so it is possible to indeed use extlinux.

Note: the initial patch that prompted me to write this series did try to install extlinux to $(IMAGE_DIR) but that's plain wrong; see:

    http://patchwork.ozlabs.org/patch/306958/

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#24 lore raw

PATCH 8/9 boot/syslinux: add option to install the EFI image

Quoted 51 lines · Yann E. MORIN

Arnout, All,

On 2014-04-28 21:16 +0200, Arnout Vandecappelle spake thusly:

Quoted 28 lines · Yann E. MORIN
Quoted 5 lines

Arnout, All,

On 2014-04-28 08:18 +0200, Arnout Vandecappelle spake thusly:

Quoted 2 lines · Yann E. MORIN
Quoted 1 line

From: "Yann E. MORIN" <[email protected]>

[snip]

Quoted 15 lines
Quoted 6 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX · line 14

Quoted 2 lines
boot/syslinux/Config.in +2 -0
+choice
+	bool "Image type"

Why is this a choice? It's possible to build both, no? Similar to
iso/pxe. So it makes more sense to me to add efi as a third option after iso and pxe.

Well, the target will be either BIOS-based or an EFI-based, not both. So it seems more logical to make it a choice (Thomas seemed to agree on IRC, as well.)

But thinking of it, we could go even further: iso/pxe/mbr/efi are all _alternate_ methods of booting, so it does not make sense to have more than one selected at any one time.

Quoted 5 lines

The only reason pxe/iso are not a choice _currently_ (e.g. syslinux-4.0.7), is that they are always built, and there is a no way to only build one or the other. This is the same behaviour in 6.0.2: you can build any combination of {bios,efi32,efi64} (only one, two, or all of them). But bios will always build pxe and iso (and mbr, see next cset).

Quoted 8 lines

Good point. But then of course, it also doesn't make sense to build both
U-Boot and syslinux :-)

So I'm OK with making iso/pxe/mbr/efi a choice.

When syslinux/extlinux is added, that does add some difficulty because
those can be combined with mbr. But that can be tackled when the problem arises :-).

Not really, because extlinux is a host tools that prepares a partition to be booted from the mbr blob.

Here is the way you'd use extlinux:
- prepare a device with at least one partition
- format that partition as ext2/3/4
- run extlinux on that partition

     -> extlinux installs some files in that filesystem
     -> and then installs a special boot-record as the first sector of
        the partition (yes, the first sector of an ext2/3/4 FS is free
        to use)
Quoted 5 lines

- dump the mbr.bin blob as the MBR (eg. on the first sector of the partition)

So, we need not add an option of extlinux since it is not an image like pxelinux or isolinux, but really a host tool.

Yes, of course, thanks for the explanation. Next time I'll try to think
first :-)

Regards,
Arnout

Quoted 11 lines

The addition of the mbr option in patch #9 is just so it is possible to indeed use extlinux.

Note: the initial patch that prompted me to write this series did try to install extlinux to $(IMAGE_DIR) but that's plain wrong; see:

    http://patchwork.ozlabs.org/patch/306958/

Regards,
Yann E. MORIN.

Signature · 6 lines
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
#25 lore raw

PATCH 9/9 boot/syslinux: add an option to install an MBR blob

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

This MBR blob will look for an active partition, and boot the bootcode present in that partition. This can be used to boot an extlinux-prepared partition.

Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/Config.in   | 13 ++++++++++++-
 boot/syslinux/syslinux.mk |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)
boot/syslinux/Config.in +12 -1
index d556c55..7d4dd08 100644
@@ -15,7 +15,7 @@ choice
 
 config BR2_TARGET_SYSLINUX_LEGACY_BIOS
 	bool "bios (legacy)"
-	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
 	help
 	  Install one or more of the the legacy BIOS images:
 	    - isolinux
@@ -31,6 +31,9 @@ endchoice
 
 if BR2_TARGET_SYSLINUX_LEGACY_BIOS
 
+config BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
+	bool
+
 config BR2_TARGET_SYSLINUX_ISOLINUX
 	bool "isolinux"
 	default y
@@ -40,10 +43,18 @@ config BR2_TARGET_SYSLINUX_ISOLINUX
 
 config BR2_TARGET_SYSLINUX_PXELINUX
 	bool "pxelinux"
+	select BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
 	help
 	  Install the legacy BIOS 'pxelinux' image, to boot off
 	  the network using PXE.
 
+config BR2_TARGET_SYSLINUX_MBR
+	bool "mbr"
+	select BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
+	help
+	  Install the legacy BIOS 'mbr' image, to boot off a
+	  local MBR-partition.
+
 endif # BR2_TARGET_SYSLINUX_LEGACY_BIOS
 
 endif # BR2_TARGET_SYSLINUX
boot/syslinux/syslinux.mk +1 -0
index bf0bae5..c614b1d 100644
@@ -60,6 +60,7 @@ endef
 
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_MBR) += bios/mbr/mbr.bin
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_EFI) += $(SYSLINUX_EFI_BITS)/efi/syslinux.efi
 
 define SYSLINUX_INSTALL_IMAGES_CMDS
Signature · 1 line
1.8.3.2
#26 lore raw

PATCH 9/9 boot/syslinux: add an option to install an MBR blob

Quoted 19 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

This MBR blob will look for an active partition, and boot the bootcode present in that partition. This can be used to boot an extlinux-prepared partition.

Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/Config.in   | 13 ++++++++++++-
 boot/syslinux/syslinux.mk |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)
boot/syslinux/Config.in +0 -0
index d556c55..7d4dd08 100644

boot/syslinux/Config.in choice · line 18

Quoted 5 lines
boot/syslinux/Config.in +1 -1
@@ -15,7 +15,7 @@ choice
 
 config BR2_TARGET_SYSLINUX_LEGACY_BIOS
 	bool "bios (legacy)"
-	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_HAS_BIOS_IMG

Hm, I don't really like this very much. Adding complexity like this for
behaviour which is not even really perfect...

Maybe we should just have

comment "please select one or more images to generate"

config BR2_TARGET_SYSLINUX_ISOLINUX

config BR2_TARGET_SYSLINUX_PXELINUX

config BR2_TARGET_SYSLINUX_MBR

and drop all checking. I mean, if the user selects syslinux I guess he'll be smart enough to also select the actual tool(s) he needs. It's like
util-linux: if you just select the package without selecting anything else, you'll also just end up with nothing. And I've never heard anyone complain about that. Let's keep things simple.

Peter, judgement call on this one?

Note: this invalidates my comments on 3/9, of course.

Quoted 17 lines
boot/syslinux/Config.in +3 -0
 	help
 	  Install one or more of the the legacy BIOS images:
 	    - isolinux
@@ -31,6 +31,9 @@ endchoice
 
 if BR2_TARGET_SYSLINUX_LEGACY_BIOS
 
+config BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
+	bool
+
 config BR2_TARGET_SYSLINUX_ISOLINUX
 	bool "isolinux"
 	default y
@@ -40,10 +43,18 @@ config BR2_TARGET_SYSLINUX_ISOLINUX
 
 config BR2_TARGET_SYSLINUX_PXELINUX
 	bool "pxelinux"

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX_ISOLINUX · line 55

Quoted 10 lines
boot/syslinux/Config.in +6 -0
+	select BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
 	help
 	  Install the legacy BIOS 'pxelinux' image, to boot off
 	  the network using PXE.
 
+config BR2_TARGET_SYSLINUX_MBR
+	bool "mbr"
+	select BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
+	help
+	  Install the legacy BIOS 'mbr' image, to boot off a

See my comment in 4/9 about "legacy".

BTW, while you're at it, perhaps you can add options for syslinux (=fat)
and extlinux?

Regards,
Arnout

Quoted 18 lines
boot/syslinux/Config.in +2 -0
+	  local MBR-partition.
+
 endif # BR2_TARGET_SYSLINUX_LEGACY_BIOS
 
 endif # BR2_TARGET_SYSLINUX
boot/syslinux/syslinux.mk +1 -0
index bf0bae5..c614b1d 100644
@@ -60,6 +60,7 @@ endef
 
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += bios/core/isolinux.bin
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += bios/core/pxelinux.bin
+SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_MBR) += bios/mbr/mbr.bin
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_EFI) += $(SYSLINUX_EFI_BITS)/efi/syslinux.efi
 
 define SYSLINUX_INSTALL_IMAGES_CMDS
Signature · 6 lines
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
#27 lore raw

PATCH 9/9 boot/syslinux: add an option to install an MBR blob

Arnout, All,

On 2014-04-28 18:23 +0200, Arnout Vandecappelle spake thusly:

              ^^^^^

I don't know why, but I only received it now (delivered to my server at 21:03:30 +0200) ? ... :-/

Quoted 21 lines · Yann E. MORIN
Quoted 20 lines

From: "Yann E. MORIN" <[email protected]>

This MBR blob will look for an active partition, and boot the bootcode present in that partition. This can be used to boot an extlinux-prepared partition.

Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/Config.in   | 13 ++++++++++++-
 boot/syslinux/syslinux.mk |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)
boot/syslinux/Config.in +0 -0
index d556c55..7d4dd08 100644
@@ -15,7 +15,7 @@ choice
 
Quoted 7 lines

boot/syslinux/Config.in choice · line 18

Quoted 4 lines
boot/syslinux/Config.in +1 -1
 config BR2_TARGET_SYSLINUX_LEGACY_BIOS
 	bool "bios (legacy)"
-	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_HAS_BIOS_IMG

Hm, I don't really like this very much. Adding complexity like this for
behaviour which is not even really perfect...

Since you replied to my other reply (he!), I think switching all of this to a all-choice makes this comment moot, right? :-)

Quoted 7 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX_ISOLINUX · line 55

Quoted 5 lines
boot/syslinux/Config.in +5 -0
+config BR2_TARGET_SYSLINUX_MBR
+	bool "mbr"
+	select BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
+	help
+	  Install the legacy BIOS 'mbr' image, to boot off a

See my comment in 4/9 about "legacy".

Ditto, already covered.

Quoted 2 lines

BTW, while you're at it, perhaps you can add options for syslinux (=fat)
and extlinux?

For extlinux, please see my previous answer.

I'll have a look at syslinux, but I believe it is the same as extlinux.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#28 lore raw

PATCH 9/9 boot/syslinux: add an option to install an MBR blob

Yann and all,

Quoted 48 lines · Yann E. MORIN

Arnout, All,

On 2014-04-28 18:23 +0200, Arnout Vandecappelle spake thusly:

              ^^^^^

I don't know why, but I only received it now (delivered to my server at 21:03:30 +0200) ? ... :-/

Quoted 21 lines · Yann E. MORIN
Quoted 20 lines

From: "Yann E. MORIN" <[email protected]>

This MBR blob will look for an active partition, and boot the bootcode present in that partition. This can be used to boot an extlinux-prepared partition.

Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/Config.in   | 13 ++++++++++++-
 boot/syslinux/syslinux.mk |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)
boot/syslinux/Config.in +0 -0
index d556c55..7d4dd08 100644
@@ -15,7 +15,7 @@ choice
 
Quoted 7 lines

boot/syslinux/Config.in choice · line 18

Quoted 4 lines
boot/syslinux/Config.in +1 -1
 config BR2_TARGET_SYSLINUX_LEGACY_BIOS
    bool "bios (legacy)"
-   select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
+   select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_HAS_BIOS_IMG

Hm, I don't really like this very much. Adding complexity like this for
behaviour which is not even really perfect...

Since you replied to my other reply (he!), I think switching all of this to a all-choice makes this comment moot, right? :-)

Quoted 7 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX_ISOLINUX · line 55

Quoted 5 lines
boot/syslinux/Config.in +5 -0
+config BR2_TARGET_SYSLINUX_MBR
+   bool "mbr"
+   select BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
+   help
+     Install the legacy BIOS 'mbr' image, to boot off a

See my comment in 4/9 about "legacy".

Quoted 8 lines

Ditto, already covered.

Quoted 2 lines

BTW, while you're at it, perhaps you can add options for syslinux (=fat)
and extlinux?

For extlinux, please see my previous answer.

I'll have a look at syslinux, but I believe it is the same as extlinux.

I'm actually using syslinux. E.g. in a post build script, I run "output/host/usr/bin/syslinux -i myfatbootpartition.vfat" and then use the MBR in "output/host/user/share/syslinux/mbr.bin".

Yann - your patch series appears to work fine for me! I'm using the same syslinux.cfg file that I was using with 4.0.7, so it has been a pretty easy upgrade. Thanks!

Frank

#29 lore raw

PATCH 9/9 boot/syslinux: add an option to install an MBR blob

Frank, All,

On 2014-04-28 15:58 -0400, Frank Hunleth spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 9 lines
Quoted 1 line

I'll have a look at syslinux, but I believe it is the same as extlinux.

I'm actually using syslinux. E.g. in a post build script, I run "output/host/usr/bin/syslinux -i myfatbootpartition.vfat" and then use the MBR in "output/host/user/share/syslinux/mbr.bin".

Yann - your patch series appears to work fine for me! I'm using the same syslinux.cfg file that I was using with 4.0.7, so it has been a pretty easy upgrade. Thanks!

OK, I'll soon re-spin a new version of this series after I complete the changes suggested by Arnout.

Will you care to send your Tested-by on this upcoming series if it still works for you, please? Having Tested-by tags helps the maintainer see the the patches work at least to some extent.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#30 lore raw

PATCH 9/9 boot/syslinux: add an option to install an MBR blob

Yann,

Quoted 15 lines · Yann E. MORIN

Frank, All,

On 2014-04-28 15:58 -0400, Frank Hunleth spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 9 lines
Quoted 1 line

I'll have a look at syslinux, but I believe it is the same as extlinux.

I'm actually using syslinux. E.g. in a post build script, I run "output/host/usr/bin/syslinux -i myfatbootpartition.vfat" and then use the MBR in "output/host/user/share/syslinux/mbr.bin".

Yann - your patch series appears to work fine for me! I'm using the same syslinux.cfg file that I was using with 4.0.7, so it has been a pretty easy upgrade. Thanks!

Quoted 6 lines

OK, I'll soon re-spin a new version of this series after I complete the changes suggested by Arnout.

Will you care to send your Tested-by on this upcoming series if it still works for you, please? Having Tested-by tags helps the maintainer see the the patches work at least to some extent.

Definitely. Thanks again for finishing off the syslinux upgrade.

Frank

#31 lore raw

PATCH 9/9 boot/syslinux: add an option to install an MBR blob

In reply to Yann E. MORIN
Quoted 7 lines · Yann E. MORIN

Arnout, All,

On 2014-04-28 18:23 +0200, Arnout Vandecappelle spake thusly:

              ^^^^^

I don't know why, but I only received it now (delivered to my server at 21:03:30 +0200) ? ... :-/

That's because I read and reply to my buildroot mail on the train,
offline. It then sits on my mail server until I turn on my laptop again in the evening (or sometimes the following day...).

Quoted 30 lines
Quoted 22 lines · Yann E. MORIN
Quoted 20 lines

From: "Yann E. MORIN" <[email protected]>

This MBR blob will look for an active partition, and boot the bootcode present in that partition. This can be used to boot an extlinux-prepared partition.

Cc Thomas Lundquist <[email protected]>
Cc Frank Hunleth <[email protected]>
---
 boot/syslinux/Config.in   | 13 ++++++++++++-
 boot/syslinux/syslinux.mk |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)
boot/syslinux/Config.in +0 -0
index d556c55..7d4dd08 100644
@@ -15,7 +15,7 @@ choice
 
Quoted 7 lines

boot/syslinux/Config.in choice · line 18

Quoted 4 lines
boot/syslinux/Config.in +1 -1
 config BR2_TARGET_SYSLINUX_LEGACY_BIOS
 	bool "bios (legacy)"
-	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_PXELINUX
+	select BR2_TARGET_SYSLINUX_ISOLINUX if !BR2_TARGET_SYSLINUX_HAS_BIOS_IMG

Hm, I don't really like this very much. Adding complexity like this for
behaviour which is not even really perfect...

Quoted 2 lines

Since you replied to my other reply (he!), I think switching all of this to a all-choice makes this comment moot, right? :-)

Indeed, as I said in that reply :-)

Regards,
Arnout

Quoted 21 lines
Quoted 8 lines

boot/syslinux/Config.in config BR2_TARGET_SYSLINUX_ISOLINUX · line 55

Quoted 6 lines
boot/syslinux/Config.in +5 -0
+config BR2_TARGET_SYSLINUX_MBR
+	bool "mbr"
+	select BR2_TARGET_SYSLINUX_HAS_BIOS_IMG
+	help
+	  Install the legacy BIOS 'mbr' image, to boot off a

See my comment in 4/9 about "legacy".

Ditto, already covered.

Quoted 2 lines

BTW, while you're at it, perhaps you can add options for syslinux (=fat)
and extlinux?

For extlinux, please see my previous answer.

I'll have a look at syslinux, but I believe it is the same as extlinux.

Regards,
Yann E. MORIN.

Signature · 6 lines
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