Patchwork [3/3] syslinux: Add new recipe for syslinux

login
register
mail settings
Submitter Esben Haabendal
Date March 4, 2013, 10:38 a.m.
Message ID <871ubvbgbt.fsf@arh128.prevas.dk>
Download mbox | patch
Permalink /patch/224684/
State RFC
Delegated to: Christian Sørensen
Headers show

Comments

Esben Haabendal - March 4, 2013, 10:38 a.m.
<christian.braunersorensen@prevas.dk> writes:

> From: Christian Sørensen <christian.braunersorensen@prevas.dk>
>
> ---
>  recipes/syslinux/syslinux_5.01.oe     | 59 +++++++++++++++++++++++++++++++++++
>  recipes/syslinux/syslinux_5.01.oe.sig |  1 +
>  2 files changed, 60 insertions(+)
>  create mode 100644 recipes/syslinux/syslinux_5.01.oe
>  create mode 100644 recipes/syslinux/syslinux_5.01.oe.sig
>
> diff --git a/recipes/syslinux/syslinux_5.01.oe b/recipes/syslinux/syslinux_5.01.oe
> new file mode 100644
> index 0000000..24c8e78
> --- /dev/null
> +++ b/recipes/syslinux/syslinux_5.01.oe
> @@ -0,0 +1,59 @@
> +DESCRIPTION = "A multi-purpose linux bootloader"
> +HOMEPAGE = "http://syslinux.zytor.com/"
> +LICENSE = "GPLv2+"
> +
> +RECIPE_TYPES = "native machine"
> +
> +inherit c make auto-package-utils
> +
> +require conf/fetch/kernelorg.conf
> +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/syslinux-${PV}.tar.bz2"
> +
> +DEPENDS += "libuuid"
> +
> +EXTRA_OEMAKE = " \
> +	BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \
> +	DATADIR=${datadir} MANDIR=${mandir} INCDIR=${includedir} \
> +"
> +# syslinux uses $LD for linking, strip `-Wl,' so it can work
> +export LDFLAGS = "`echo $LDFLAGS | sed 's/-Wl,//g'`"

What is this supposed to do?

> +
> +do_configure() {
> +	# drop win32 targets or build fails
> +	sed -e 's,win32/\S*,,g' -i Makefile
> +
> +	# clean installer executables included in source tarball
> +	oe_runmake clean
> +}
> +
> +do_compile() {
> +	# Rebuild only the installer; keep precompiled bootloaders
> +	# as per author's request (doc/distrib.txt)
> +	oe_runmake CC="${CC}" -C ${S}/com32/cmenu/
> +	oe_runmake CC="${CC}" installer

This is broken.  When building as native recipe, it will not find
staged headers (ie. uuid/uuid.h), and neither staged libraries
(libuuid).  Building on host without libuuid in host os will thus fail,
and building with is wrong (ie. not using the staged library version).
Building as machine recipe is of-course a bit worse, as the host arch
might not match machine arch.

Setting CC="${CC} ${CFLAGS} ${LDFLAGS}" seems to fix it.

> +}
> +
> +do_install() {
> +	oe_runmake install INSTALLROOT="${D}"
> +
> +	install -d ${D}${libdir}/syslinux/
> +	install -m 644 ${S}/core/ldlinux.sys ${D}${libdir}/syslinux/
> +	install -m 644 ${S}/core/ldlinux.bss ${D}${libdir}/syslinux/
> +}
> +
> +AUTO_PACKAGE_UTILS = "extlinux gethostip isohybrid isohybrid.pl \
> +		keytab-lilo lss16toppm md5pass memdiskfind \
> +		mkdiskimage ppmtolss16 pxelinux-options sha1pass \
> +		syslinux syslinux2ansi"
> +
> +PACKAGES += "${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc"
> +
> +FILES_${PN} = "${bindir}/syslinux"
> +FILES_${PN}-mbr = "${datadir}/${PN}/mbr.bin"
> +FILES_${PN}-chain = "${libdir}/${PN}/chain.c32"
> +FILES_${PN}-isolinux = "${libdir}/${PN}/isolinux.bin"
> +FILES_${PN}-pxelinux = "${libdir}/${PN}/pxelinux.0"
> +FILES_${PN}-dev += "${datadir}/${PN}/com32/lib*${SOLIBS} ${datadir}/${PN}/com32/include ${datadir}/${PN}/com32/com32.ld"
> +FILES_${PN}-staticdev += "${datadir}/${PN}/com32/lib*.a ${libdir}/${PN}/com32/lib*.a"
> +FILES_${PN}-misc = "${libdir}/${PN}/* ${bindir}/* ${datadir}"
> +
> diff --git a/recipes/syslinux/syslinux_5.01.oe.sig b/recipes/syslinux/syslinux_5.01.oe.sig
> new file mode 100644
> index 0000000..566fee9
> --- /dev/null
> +++ b/recipes/syslinux/syslinux_5.01.oe.sig
> @@ -0,0 +1 @@
> +c41eecaad46a6d90bbdc7a855a6c2561aabc1e03  syslinux-5.01.tar.bz2

The following commit can at least build.  Do you have a setup where you
can test if it still works?

/Esben


commit 07f6d6132a0a231e630f9b619c00f41b860dda49
Author: Esben Haabendal <esben.haabendal@prevas.dk>
Date:   Mon Mar 4 11:36:40 2013 +0100

    syslinux: Add new recipe for syslinux
    
    Based on original patch from Christian B Sørensen.
    
    Signed-off-by: Esben Haabendal <esben.haabendal@prevas.dk>

Patch

diff --git a/recipes/syslinux/syslinux.inc b/recipes/syslinux/syslinux.inc
new file mode 100644
index 0000000..72f2a8c
--- /dev/null
+++ b/recipes/syslinux/syslinux.inc
@@ -0,0 +1,59 @@ 
+DESCRIPTION = "A multi-purpose linux bootloader"
+HOMEPAGE = "http://syslinux.zytor.com/"
+
+RECIPE_TYPES = "native machine"
+
+COMPATIBLE_HOST_ARCHS = "i.86- x86_64-"
+
+inherit c make auto-package-utils
+
+require conf/fetch/kernelorg.conf
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/syslinux-${PV}.tar.bz2"
+
+DEPENDS += "libuuid"
+
+EXTRA_OEMAKE = "\
+	BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \
+	DATADIR=${datadir} MANDIR=${mandir} INCDIR=${includedir} \
+"
+
+do_configure() {
+	# drop win32 targets or build fails
+	sed -e 's,win32/\S*,,g' -i Makefile
+
+	# clean installer executables included in source tarball
+	oe_runmake clean
+}
+
+EXTRA_OEMAKE_COMPILE = 'CC="${CC} ${CFLAGS} ${LDFLAGS}"'
+
+do_compile() {
+	# Rebuild only the installer; keep precompiled bootloaders
+	# as per author's request (doc/distrib.txt)
+	oe_runmake ${EXTRA_OEMAKE_COMPILE} -C ${S}/com32/cmenu/
+	oe_runmake ${EXTRA_OEMAKE_COMPILE} installer
+}
+
+do_install() {
+	oe_runmake install INSTALLROOT="${D}"
+
+	install -d ${D}${libdir}/syslinux/
+	install -m 644 ${S}/core/ldlinux.sys ${D}${libdir}/syslinux/
+	install -m 644 ${S}/core/ldlinux.bss ${D}${libdir}/syslinux/
+}
+
+AUTO_PACKAGE_UTILS = "extlinux gethostip isohybrid isohybrid.pl \
+	keytab-lilo lss16toppm md5pass memdiskfind \
+	mkdiskimage ppmtolss16 pxelinux-options sha1pass \
+	syslinux syslinux2ansi"
+
+PACKAGES += "${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc"
+
+FILES_${PN} = "${bindir}/syslinux"
+FILES_${PN}-mbr = "${datadir}/${PN}/mbr.bin"
+FILES_${PN}-chain = "${libdir}/${PN}/chain.c32"
+FILES_${PN}-isolinux = "${libdir}/${PN}/isolinux.bin"
+FILES_${PN}-pxelinux = "${libdir}/${PN}/pxelinux.0"
+FILES_${PN}-dev += "${datadir}/${PN}/com32/lib*${SOLIBS} ${datadir}/${PN}/com32/include ${datadir}/${PN}/com32/com32.ld"
+FILES_${PN}-staticdev += "${datadir}/${PN}/com32/lib*.a ${libdir}/${PN}/com32/lib*.a"
+FILES_${PN}-misc = "${libdir}/${PN}/* ${bindir}/* ${datadir}"
diff --git a/recipes/syslinux/syslinux_5.01.oe b/recipes/syslinux/syslinux_5.01.oe
new file mode 100644
index 0000000..9b75917
--- /dev/null
+++ b/recipes/syslinux/syslinux_5.01.oe
@@ -0,0 +1,2 @@ 
+require ${PN}.inc
+LICENSE = "GPLv2+"
diff --git a/recipes/syslinux/syslinux_5.01.oe.sig b/recipes/syslinux/syslinux_5.01.oe.sig
new file mode 100644
index 0000000..566fee9
--- /dev/null
+++ b/recipes/syslinux/syslinux_5.01.oe.sig
@@ -0,0 +1 @@ 
+c41eecaad46a6d90bbdc7a855a6c2561aabc1e03  syslinux-5.01.tar.bz2