diff mbox

syslinux: install helper programs to the host

Message ID 1394996670-8037-1-git-send-email-fhunleth@troodon-software.com
State Accepted
Headers show

Commit Message

Frank Hunleth March 16, 2014, 7:04 p.m. UTC
Even though syslinux is built for the target, it does create helper
programs intended to be run on the host such as syslinux and extlinux.
This change installs these helper programs to the host so that they may be
called by post image creation scripts.

Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
---
 boot/syslinux/syslinux.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Arnout Vandecappelle March 17, 2014, 6:47 a.m. UTC | #1
On 03/16/14 20:04, Frank Hunleth wrote:
> Even though syslinux is built for the target, it does create helper
> programs intended to be run on the host such as syslinux and extlinux.
> This change installs these helper programs to the host so that they may be
> called by post image creation scripts.

 So what is host-syslinux for then?


 In fact, we currently have two ways for installing the host-tools of
bootloaders:

1. An explicit host-foo package, used by syslinux and u-boot. In the case
of u-boot, it's even a separate package u-boot-tools in package/

2. Implicit when installing to target, used by grub, and grub2 (and by
this patch as well). In the case of grub2, nothing is installed to target
in fact, instead it's installed to HOST_DIR.

 So maybe we should converge on a single mechanism for all
bootloader-host-tools. I'm personally in favour of option 1, but I have
no strong opinion.

 Regards,
 Arnout


> 
> Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
> ---
>  boot/syslinux/syslinux.mk | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/boot/syslinux/syslinux.mk b/boot/syslinux/syslinux.mk
> index eedc364..7b3f9cf 100644
> --- a/boot/syslinux/syslinux.mk
> +++ b/boot/syslinux/syslinux.mk
> @@ -11,7 +11,6 @@ SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/4.xx/
>  SYSLINUX_LICENSE = GPLv2+
>  SYSLINUX_LICENSE_FILES = COPYING
>  
> -SYSLINUX_INSTALL_TARGET = NO
>  SYSLINUX_INSTALL_IMAGES = YES
>  
>  SYSLINUX_DEPENDENCIES = host-nasm host-util-linux
> @@ -23,6 +22,12 @@ define SYSLINUX_BUILD_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" AR="$(HOSTAR)" -C $(@D)
>  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
> +endef
> +
>  SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += isolinux.bin
>  SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += pxelinux.bin
>  
>
Frank Hunleth March 17, 2014, 1:36 p.m. UTC | #2
On Mon, Mar 17, 2014 at 2:47 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>
> On 03/16/14 20:04, Frank Hunleth wrote:
> > Even though syslinux is built for the target, it does create helper
> > programs intended to be run on the host such as syslinux and extlinux.
> > This change installs these helper programs to the host so that they may be
> > called by post image creation scripts.
>
>  So what is host-syslinux for then?

This was confusing to me. host-syslinux isn't used anywhere and can't
be enabled, so it looks like it can be deleted. Additionally, the
Config.in has options for the target syslinux which makes you believe
that it's the way to go if you want syslinux.

>  In fact, we currently have two ways for installing the host-tools of
> bootloaders:
>
> 1. An explicit host-foo package, used by syslinux and u-boot. In the case
> of u-boot, it's even a separate package u-boot-tools in package/
>
> 2. Implicit when installing to target, used by grub, and grub2 (and by
> this patch as well). In the case of grub2, nothing is installed to target
> in fact, instead it's installed to HOST_DIR.
>
>  So maybe we should converge on a single mechanism for all
> bootloader-host-tools. I'm personally in favour of option 1, but I have
> no strong opinion.

This is my first x86/buildroot project, so I'm fine with whatever the
consensus decides.

Thanks,
Frank

>
>  Regards,
>  Arnout
>
>
> >
> > Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
> > ---
> >  boot/syslinux/syslinux.mk | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/boot/syslinux/syslinux.mk b/boot/syslinux/syslinux.mk
> > index eedc364..7b3f9cf 100644
> > --- a/boot/syslinux/syslinux.mk
> > +++ b/boot/syslinux/syslinux.mk
> > @@ -11,7 +11,6 @@ SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/4.xx/
> >  SYSLINUX_LICENSE = GPLv2+
> >  SYSLINUX_LICENSE_FILES = COPYING
> >
> > -SYSLINUX_INSTALL_TARGET = NO
> >  SYSLINUX_INSTALL_IMAGES = YES
> >
> >  SYSLINUX_DEPENDENCIES = host-nasm host-util-linux
> > @@ -23,6 +22,12 @@ define SYSLINUX_BUILD_CMDS
> >       $(TARGET_MAKE_ENV) $(MAKE) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" AR="$(HOSTAR)" -C $(@D)
> >  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
> > +endef
> > +
> >  SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += isolinux.bin
> >  SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += pxelinux.bin
> >
> >
>
>
> --
> 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
Thomas Petazzoni April 20, 2014, 9:57 a.m. UTC | #3
Dear Frank Hunleth,

On Sun, 16 Mar 2014 15:04:30 -0400, Frank Hunleth wrote:
> Even though syslinux is built for the target, it does create helper
> programs intended to be run on the host such as syslinux and extlinux.
> This change installs these helper programs to the host so that they may be
> called by post image creation scripts.
> 
> Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
> ---
>  boot/syslinux/syslinux.mk | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

I've applied your patch, and removed the code that implements the
host-syslinux variant (which BTW was originally added by Arnout in
9baaa5b4a39145f4cc64c6bba1a6aa8cec48f00a).

Frank, syslinux upstream is now at version 6.x. Since you're using
syslinux, could you take care of updating the package in Buildroot to
match the latest upstream version?

Thanks,

Thomas
Frank Hunleth April 21, 2014, 1:18 p.m. UTC | #4
Hi Thomas,


On Sun, Apr 20, 2014 at 5:57 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>
> Dear Frank Hunleth,
>
> On Sun, 16 Mar 2014 15:04:30 -0400, Frank Hunleth wrote:
> > Even though syslinux is built for the target, it does create helper
> > programs intended to be run on the host such as syslinux and extlinux.
> > This change installs these helper programs to the host so that they may be
> > called by post image creation scripts.
> >
> > Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
> > ---
> >  boot/syslinux/syslinux.mk | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
>
> I've applied your patch, and removed the code that implements the
> host-syslinux variant (which BTW was originally added by Arnout in
> 9baaa5b4a39145f4cc64c6bba1a6aa8cec48f00a).

Thanks!

>
> Frank, syslinux upstream is now at version 6.x. Since you're using
> syslinux, could you take care of updating the package in Buildroot to
> match the latest upstream version?

I looked into this some last night and got as far as porting two new
prerequisite packages for 6.x and then debugging issues with building
the new EFI code. I personally don't use EFI, and without more digging
into it I wasn't sure how to turn off its compilation.

It looks like it will take a little longer to make progress on this,
and I'm not sure when I'll have time again. In the mean time, if there
are any other interested syslinux users on this list, feel free to
contact me and I'll try to explain where I'm at with my partial work.

Frank
Yann E. MORIN April 21, 2014, 2:13 p.m. UTC | #5
Frank, Thomas, All,

On 2014-04-21 09:18 -0400, Frank Hunleth spake thusly:
> On Sun, Apr 20, 2014 at 5:57 AM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
> > Frank, syslinux upstream is now at version 6.x. Since you're using
> > syslinux, could you take care of updating the package in Buildroot to
> > match the latest upstream version?

To be noted: I am already working on this too. :-)

> I looked into this some last night and got as far as porting two new
> prerequisite packages for 6.x and then debugging issues with building
> the new EFI code. I personally don't use EFI, and without more digging
> into it I wasn't sure how to turn off its compilation.

syslinux is a pain to use in cross-compilation, as it assumes headers and
libs from gnu-efi to be in /usr/blabla so it's a pain to make it work in
Buildroot.

That, plus a few other nits here and there...

But I have a few patches here to fix the issue for us. It may even be
possible to shape them for upstream...

> It looks like it will take a little longer to make progress on this,
> and I'm not sure when I'll have time again. In the mean time, if there
> are any other interested syslinux users on this list, feel free to
> contact me and I'll try to explain where I'm at with my partial work.

As I am also working on this, if you just posted your changes (on the
list on in a public git tree), I can incorporate your changes I am
missing, and submit those.

Regards,
Yann E. MORIN.
Yann E. MORIN April 21, 2014, 2:40 p.m. UTC | #6
Frank, All,

On 2014-04-21 10:30 -0400, Frank Hunleth spake thusly:
> On Mon, Apr 21, 2014 at 10:13 AM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > As I am also working on this, if you just posted your changes (on the
> > list on in a public git tree), I can incorporate your changes I am
> > missing, and submit those.
> 
> I've attached my current progress just in case there's something of
> use, but I suspect that you're farther along.

Woot! :-) In fact, you are farther than me! I still did not had a need
for usl of upx.

This patch is missing your SoB. Could you just resend with your SoB
added? Then I'll handle all the nitty-gritty work of finishing this, and
pushing upstream.

Regards,
Yann E. MORIN.
diff mbox

Patch

diff --git a/boot/syslinux/syslinux.mk b/boot/syslinux/syslinux.mk
index eedc364..7b3f9cf 100644
--- a/boot/syslinux/syslinux.mk
+++ b/boot/syslinux/syslinux.mk
@@ -11,7 +11,6 @@  SYSLINUX_SITE    = $(BR2_KERNEL_MIRROR)/linux/utils/boot/syslinux/4.xx/
 SYSLINUX_LICENSE = GPLv2+
 SYSLINUX_LICENSE_FILES = COPYING
 
-SYSLINUX_INSTALL_TARGET = NO
 SYSLINUX_INSTALL_IMAGES = YES
 
 SYSLINUX_DEPENDENCIES = host-nasm host-util-linux
@@ -23,6 +22,12 @@  define SYSLINUX_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) CC="$(HOSTCC) -idirafter $(HOST_DIR)/usr/include $(HOST_LDFLAGS)" AR="$(HOSTAR)" -C $(@D)
 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
+endef
+
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_ISOLINUX) += isolinux.bin
 SYSLINUX_IMAGES-$(BR2_TARGET_SYSLINUX_PXELINUX) += pxelinux.bin