diff options
author | Ross Burton <ross@burtonini.com> | 2020-12-14 18:31:42 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-18 22:52:24 +0000 |
commit | a9755a33fa3e43944b36f9a95ea0d7e94329369e (patch) | |
tree | 1b2bcec6d08a56518725bb23dac1550e0abe1f12 /meta/recipes-devtools/syslinux | |
parent | ac452514ce95fd04e025f2c5f8922b5940fd8cae (diff) | |
download | poky-a9755a33fa3e43944b36f9a95ea0d7e94329369e.tar.gz |
syslinux: rewrite recipe so only target code is x86-specific
Currently the syslinux recipe set COMPATIBLE_HOST to 32/64-bit x86.
Whilst this makes sense for the target binaries as syslinux is
x86-specific, this also affects the native recipe which should be able
to be built on non-x86 build hosts (for example, arm64 build host,
qemux86 target).
syslinux itself has a somewhat fragile build system but with care it is
possible to build the installer for native/nativesdk, and the bootloader
for target.
(From OE-Core rev: 7273e131bfc7de83df9e90697e7983d54b713798)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/syslinux')
-rw-r--r-- | meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb | 84 |
1 files changed, 47 insertions, 37 deletions
diff --git a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb index 3e7eef3a75..1b0b45f2fa 100644 --- a/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb +++ b/meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb | |||
@@ -4,10 +4,7 @@ LICENSE = "GPLv2+" | |||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ |
5 | file://README;beginline=35;endline=41;md5=558f2c71cb1fb9ba511ccd4858e48e8a" | 5 | file://README;beginline=35;endline=41;md5=558f2c71cb1fb9ba511ccd4858e48e8a" |
6 | 6 | ||
7 | # If you really want to run syslinux, you need mtools. We just want the | ||
8 | # ldlinux.* stuff for now, so skip mtools-native | ||
9 | DEPENDS = "nasm-native util-linux e2fsprogs" | 7 | DEPENDS = "nasm-native util-linux e2fsprogs" |
10 | PV = "6.04-pre2" | ||
11 | 8 | ||
12 | SRC_URI = "https://www.zytor.com/pub/syslinux/Testing/6.04/syslinux-${PV}.tar.xz \ | 9 | SRC_URI = "https://www.zytor.com/pub/syslinux/Testing/6.04/syslinux-${PV}.tar.xz \ |
13 | file://syslinux-remove-clean-script.patch \ | 10 | file://syslinux-remove-clean-script.patch \ |
@@ -27,64 +24,77 @@ SRC_URI = "https://www.zytor.com/pub/syslinux/Testing/6.04/syslinux-${PV}.tar.xz | |||
27 | SRC_URI[md5sum] = "2b31c78f087f99179feb357da312d7ec" | 24 | SRC_URI[md5sum] = "2b31c78f087f99179feb357da312d7ec" |
28 | SRC_URI[sha256sum] = "4441a5d593f85bb6e8d578cf6653fb4ec30f9e8f4a2315a3d8f2d0a8b3fadf94" | 25 | SRC_URI[sha256sum] = "4441a5d593f85bb6e8d578cf6653fb4ec30f9e8f4a2315a3d8f2d0a8b3fadf94" |
29 | 26 | ||
27 | RECIPE_NO_UPDATE_REASON = "6.04-pre3 is broken" | ||
30 | UPSTREAM_CHECK_URI = "https://www.zytor.com/pub/syslinux/" | 28 | UPSTREAM_CHECK_URI = "https://www.zytor.com/pub/syslinux/" |
31 | UPSTREAM_CHECK_REGEX = "syslinux-(?P<pver>.+)\.tar" | 29 | UPSTREAM_CHECK_REGEX = "syslinux-(?P<pver>.+)\.tar" |
32 | UPSTREAM_VERSION_UNKNOWN = "1" | 30 | UPSTREAM_VERSION_UNKNOWN = "1" |
33 | 31 | ||
34 | COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)' | 32 | # We can build the native parts anywhere, but the target has to be x86 |
33 | COMPATIBLE_HOST_class-target = '(x86_64|i.86).*-(linux|freebsd.*)' | ||
34 | |||
35 | # Don't let the sanity checker trip on the 32 bit real mode BIOS binaries | 35 | # Don't let the sanity checker trip on the 32 bit real mode BIOS binaries |
36 | INSANE_SKIP_${PN}-misc = "arch" | 36 | INSANE_SKIP_${PN}-misc = "arch" |
37 | INSANE_SKIP_${PN}-chain = "arch" | 37 | INSANE_SKIP_${PN}-chain = "arch" |
38 | 38 | ||
39 | # When building the installer, CC is used to link. When building the bootloader, | ||
40 | # LD is used. However, these variables assume that GCC is used and break the | ||
41 | # build, so unset them. | ||
42 | TARGET_LDFLAGS = "" | ||
43 | SECURITY_LDFLAGS = "" | ||
44 | LDFLAGS_SECTION_REMOVAL = "" | ||
45 | |||
39 | EXTRA_OEMAKE = " \ | 46 | EXTRA_OEMAKE = " \ |
40 | BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \ | 47 | BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \ |
41 | DATADIR=${datadir} MANDIR=${mandir} INCDIR=${includedir} \ | 48 | DATADIR=${datadir} MANDIR=${mandir} INCDIR=${includedir} \ |
49 | CC="${CC} ${CFLAGS} ${LDFLAGS}" \ | ||
50 | LD="${LD} ${LDFLAGS}" \ | ||
51 | OBJDUMP="${OBJDUMP}" \ | ||
52 | OBJCOPY="${OBJCOPY}" \ | ||
53 | AR="${AR}" \ | ||
54 | STRIP="${STRIP}" \ | ||
55 | NM="${NM}" \ | ||
56 | RANLIB="${RANLIB}" \ | ||
42 | " | 57 | " |
43 | 58 | ||
59 | # | ||
60 | # Tasks for native/nativesdk which just build the installer. | ||
61 | # | ||
44 | do_configure() { | 62 | do_configure() { |
45 | # drop win32 targets or build fails | 63 | oe_runmake firmware="bios" clean |
46 | sed -e 's,win32/\S*,,g' -i Makefile | ||
47 | |||
48 | # clean installer executables included in source tarball | ||
49 | oe_runmake clean firmware="efi32" EFIINC="${includedir}" | ||
50 | # NOTE: There is a temporary work around above to specify | ||
51 | # the efi32 as the firmware else the pre-built bios | ||
52 | # files get erased contrary to the doc/distib.txt | ||
53 | # In the future this should be "bios" and not "efi32". | ||
54 | } | 64 | } |
55 | 65 | ||
56 | do_compile() { | 66 | do_compile() { |
57 | # Make sure the recompile is OK. | 67 | oe_runmake firmware="bios" installer |
58 | # Though the ${B} should always exist, still check it before find and rm. | ||
59 | [ -d "${B}" ] && find ${B} -name '.*.d' -type f -exec rm -f {} \; | ||
60 | |||
61 | # Rebuild only the installer; keep precompiled bootloaders | ||
62 | # as per author's request (doc/distrib.txt) | ||
63 | oe_runmake CC="${CC} ${CFLAGS}" \ | ||
64 | LD="${LD}" LDFLAGS="${LDFLAGS}" \ | ||
65 | OBJDUMP="${OBJDUMP}" \ | ||
66 | OBJCOPY="${OBJCOPY}" \ | ||
67 | AR="${AR}" \ | ||
68 | STRIP="${STRIP}" \ | ||
69 | NM="${NM}" \ | ||
70 | RANLIB="${RANLIB}" \ | ||
71 | firmware="bios" installer | ||
72 | } | 68 | } |
73 | 69 | ||
74 | do_install() { | 70 | do_install() { |
75 | oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" \ | 71 | install -d ${D}${bindir} |
76 | OBJDUMP="${OBJDUMP}" \ | 72 | install \ |
77 | OBJCOPY="${OBJCOPY}" \ | 73 | ${B}/bios/mtools/syslinux \ |
78 | AR="${AR}" \ | 74 | ${B}/bios/extlinux/extlinux \ |
79 | STRIP="${STRIP}" \ | 75 | ${B}/bios/utils/isohybrid \ |
80 | NM="${NM}" \ | 76 | ${D}${bindir} |
81 | RANLIB="${RANLIB}" \ | 77 | } |
82 | firmware="bios" install INSTALLROOT="${D}" | 78 | |
79 | # | ||
80 | # Tasks for target which ship the precompiled bootloader and installer | ||
81 | # | ||
82 | do_configure_class-target() { | ||
83 | # No need to do anything as we're mostly shipping the precompiled binaries | ||
84 | : | ||
85 | } | ||
86 | |||
87 | do_compile_class-target() { | ||
88 | # No need to do anything as we're mostly shipping the precompiled binaries | ||
89 | : | ||
90 | } | ||
91 | |||
92 | do_install_class-target() { | ||
93 | oe_runmake firmware="bios" install INSTALLROOT="${D}" | ||
83 | 94 | ||
84 | install -d ${D}${datadir}/syslinux/ | 95 | install -d ${D}${datadir}/syslinux/ |
85 | install -m 644 ${S}/bios/core/ldlinux.sys ${D}${datadir}/syslinux/ | 96 | install -m 644 ${S}/bios/core/ldlinux.sys ${D}${datadir}/syslinux/ |
86 | install -m 644 ${S}/bios/core/ldlinux.bss ${D}${datadir}/syslinux/ | 97 | install -m 644 ${S}/bios/core/ldlinux.bss ${D}${datadir}/syslinux/ |
87 | install -m 755 ${S}/bios/linux/syslinux-nomtools ${D}${bindir}/ | ||
88 | } | 98 | } |
89 | 99 | ||
90 | PACKAGES += "${PN}-nomtools ${PN}-extlinux ${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc" | 100 | PACKAGES += "${PN}-nomtools ${PN}-extlinux ${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc" |