From 43448e97f1b66becc5f550548e6301934ce8888f Mon Sep 17 00:00:00 2001 From: Zang Ruochen Date: Fri, 30 Oct 2020 13:59:41 +0800 Subject: toybox: upgrade 0.8.3 -> 0.8.4 0001-Tackle-SIGEMT-and-SIGSTKFLT-is-not-glibc-specific.patch mips-no-STKFLT.patch Removed since these are included in 0.8.4 Signed-off-by: Zang Ruochen Signed-off-by: Khem Raj --- ...IGEMT-and-SIGSTKFLT-is-not-glibc-specific.patch | 30 ------ .../toybox/toybox/mips-no-STKFLT.patch | 25 ----- meta-oe/recipes-core/toybox/toybox_0.8.3.bb | 116 --------------------- meta-oe/recipes-core/toybox/toybox_0.8.4.bb | 114 ++++++++++++++++++++ 4 files changed, 114 insertions(+), 171 deletions(-) delete mode 100644 meta-oe/recipes-core/toybox/toybox/0001-Tackle-SIGEMT-and-SIGSTKFLT-is-not-glibc-specific.patch delete mode 100644 meta-oe/recipes-core/toybox/toybox/mips-no-STKFLT.patch delete mode 100644 meta-oe/recipes-core/toybox/toybox_0.8.3.bb create mode 100644 meta-oe/recipes-core/toybox/toybox_0.8.4.bb diff --git a/meta-oe/recipes-core/toybox/toybox/0001-Tackle-SIGEMT-and-SIGSTKFLT-is-not-glibc-specific.patch b/meta-oe/recipes-core/toybox/toybox/0001-Tackle-SIGEMT-and-SIGSTKFLT-is-not-glibc-specific.patch deleted file mode 100644 index faabc597ee..0000000000 --- a/meta-oe/recipes-core/toybox/toybox/0001-Tackle-SIGEMT-and-SIGSTKFLT-is-not-glibc-specific.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 9e5b1420b89813ee3c58c2b792077fa8bb71f327 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 21 May 2020 13:53:27 -0700 -Subject: [PATCH] Tackle SIGEMT and SIGSTKFLT is not glibc specific - -Signed-off-by: Khem Raj ---- - lib/portability.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/lib/portability.c b/lib/portability.c -index 294141c6..1c7ebc12 100644 ---- a/lib/portability.c -+++ b/lib/portability.c -@@ -430,8 +430,11 @@ static const struct signame signames[] = { - // Non-POSIX signals that cause termination - SIGNIFY(PROF), SIGNIFY(IO), - #ifdef __linux__ --# if !defined(__GLIBC__) && !defined(__mips__) -+# ifdef SIGSTKFLT - SIGNIFY(STKFLT), -+# endif -+# ifdef SIGEMT -+ SIGNIFY(EMT), - # endif - SIGNIFY(POLL), SIGNIFY(PWR), - #elif defined(__APPLE__) --- -2.26.2 - diff --git a/meta-oe/recipes-core/toybox/toybox/mips-no-STKFLT.patch b/meta-oe/recipes-core/toybox/toybox/mips-no-STKFLT.patch deleted file mode 100644 index 7ab95932cf..0000000000 --- a/meta-oe/recipes-core/toybox/toybox/mips-no-STKFLT.patch +++ /dev/null @@ -1,25 +0,0 @@ -glibc on mips is missing SIGSTKFLT - -Do not therefore assume it being available linuxwide - -Fixes -| lib/portability.c:433:3: error: use of undeclared identifier 'SIGSTKFLT' -| SIGNIFY(STKFLT), SIGNIFY(POLL), SIGNIFY(PWR), -| ^ - -Upstream-Status: Submitted [https://github.com/landley/toybox/pull/195] -Signed-off-by: Khem Raj ---- a/lib/portability.c -+++ b/lib/portability.c -@@ -430,7 +430,10 @@ static const struct signame signames[] = - // Non-POSIX signals that cause termination - SIGNIFY(PROF), SIGNIFY(IO), - #ifdef __linux__ -- SIGNIFY(STKFLT), SIGNIFY(POLL), SIGNIFY(PWR), -+# if !defined(__GLIBC__) && !defined(__mips__) -+ SIGNIFY(STKFLT), -+# endif -+ SIGNIFY(POLL), SIGNIFY(PWR), - #elif defined(__APPLE__) - SIGNIFY(EMT), SIGNIFY(INFO), - #endif diff --git a/meta-oe/recipes-core/toybox/toybox_0.8.3.bb b/meta-oe/recipes-core/toybox/toybox_0.8.3.bb deleted file mode 100644 index 1513255c46..0000000000 --- a/meta-oe/recipes-core/toybox/toybox_0.8.3.bb +++ /dev/null @@ -1,116 +0,0 @@ -SUMMARY = "Toybox combines common utilities together into a single executable." -HOMEPAGE = "http://www.landley.net/toybox/" -DEPENDS = "attr virtual/crypt" - -LICENSE = "BSD-0-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=78659a599b9325da368f2f1eb88f19c7" - -inherit cml1 update-alternatives - -SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \ - file://mips-no-STKFLT.patch \ - file://0001-Tackle-SIGEMT-and-SIGSTKFLT-is-not-glibc-specific.patch \ - " -SRC_URI[sha256sum] = "eab28fd29d19d4e61ef09704e5871940e6f35fd35a3bb1285e41f204504b5c01" - -SECTION = "base" - -RDEPENDS_${PN} = "${@["", "toybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'toybox')]}" - -TOYBOX_BIN = "generated/unstripped/toybox" - -# Toybox is strict on what CC, CFLAGS and CROSS_COMPILE variables should contain. -# Fix CC, CFLAGS, CROSS_COMPILE to match expectations. -# CC = compiler name -# CFLAGS = only compiler flags -# CROSS_COMPILE = compiler prefix -CFLAGS += "${TOOLCHAIN_OPTIONS} ${TUNE_CCARGS}" - -COMPILER_toolchain-clang = "clang" -COMPILER ?= "gcc" - -PACKAGECONFIG ??= "no-iconv no-getconf" - -PACKAGECONFIG[no-iconv] = ",," -PACKAGECONFIG[no-getconf] = ",," - -EXTRA_OEMAKE = 'CROSS_COMPILE="${HOST_PREFIX}" \ - CC="${COMPILER}" \ - STRIP="strip" \ - CFLAGS="${CFLAGS}" \ - HOSTCC="${BUILD_CC}" CPUS=${@oe.utils.cpu_count()} V=1' - -do_configure() { - # allow user to define their own defconfig in bbappend, taken from kernel.bbclass - if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then - mv "${S}/.config" "${B}/.config" - fi - - # Copy defconfig to .config if .config does not exist. This allows - # recipes to manage the .config themselves in do_configure_prepend(). - if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then - cp "${WORKDIR}/defconfig" "${B}/.config" - fi - - oe_runmake oldconfig || oe_runmake defconfig - - # Disable killall5 as it isn't managed by update-alternatives - sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config - - # Disable swapon as it doesn't handle the '-a' argument used during boot - sed -e 's/CONFIG_SWAPON=y/# CONFIG_SWAPON is not set/' -i .config - - # Enable init if toybox was set as init manager - if ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','toybox','true','false',d)}; then - sed -e 's/# CONFIG_INIT is not set/CONFIG_INIT=y/' -i .config - fi -} - -do_compile() { - oe_runmake ${TOYBOX_BIN} - - # Create a list of links needed - ${BUILD_CC} -I . scripts/install.c -o generated/instlist - ./generated/instlist long | sed -e 's#^#/#' > toybox.links - if ${@bb.utils.contains('PACKAGECONFIG','no-iconv','true','false',d)}; then - sed -i -e '/iconv$/d' toybox.links - fi - if ${@bb.utils.contains('PACKAGECONFIG','no-getconf','true','false',d)}; then - sed -i -e '/getconf$/d' toybox.links - fi -} - -do_install() { - # Install manually instead of using 'make install' - install -d ${D}${base_bindir} - if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then - install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox - else - install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox - fi - - install -d ${D}${sysconfdir} - install -m 0644 ${B}/toybox.links ${D}${sysconfdir} -} - -# If you've chosen to install toybox you probably want it to take precedence -# over busybox where possible but not over other packages -ALTERNATIVE_PRIORITY = "60" - -python do_package_prepend () { - # Read links from /etc/toybox.links and create appropriate - # update-alternatives variables - - dvar = d.getVar('D') - pn = d.getVar('PN') - target = d.expand("${base_bindir}/toybox") - - f = open('%s/etc/toybox.links' % (dvar), 'r') - for alt_link_name in f: - alt_link_name = alt_link_name.strip() - alt_name = os.path.basename(alt_link_name) - d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) - d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) - d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) - f.close() -} diff --git a/meta-oe/recipes-core/toybox/toybox_0.8.4.bb b/meta-oe/recipes-core/toybox/toybox_0.8.4.bb new file mode 100644 index 0000000000..cc98b9ec07 --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox_0.8.4.bb @@ -0,0 +1,114 @@ +SUMMARY = "Toybox combines common utilities together into a single executable." +HOMEPAGE = "http://www.landley.net/toybox/" +DEPENDS = "attr virtual/crypt" + +LICENSE = "BSD-0-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=78659a599b9325da368f2f1eb88f19c7" + +inherit cml1 update-alternatives + +SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \ + " +SRC_URI[sha256sum] = "cb2a565a8d30015d08d73628795dca51a85b99b149aeabbbecd9e8dbdbd8fddc" + +SECTION = "base" + +RDEPENDS_${PN} = "${@["", "toybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'toybox')]}" + +TOYBOX_BIN = "generated/unstripped/toybox" + +# Toybox is strict on what CC, CFLAGS and CROSS_COMPILE variables should contain. +# Fix CC, CFLAGS, CROSS_COMPILE to match expectations. +# CC = compiler name +# CFLAGS = only compiler flags +# CROSS_COMPILE = compiler prefix +CFLAGS += "${TOOLCHAIN_OPTIONS} ${TUNE_CCARGS}" + +COMPILER_toolchain-clang = "clang" +COMPILER ?= "gcc" + +PACKAGECONFIG ??= "no-iconv no-getconf" + +PACKAGECONFIG[no-iconv] = ",," +PACKAGECONFIG[no-getconf] = ",," + +EXTRA_OEMAKE = 'CROSS_COMPILE="${HOST_PREFIX}" \ + CC="${COMPILER}" \ + STRIP="strip" \ + CFLAGS="${CFLAGS}" \ + HOSTCC="${BUILD_CC}" CPUS=${@oe.utils.cpu_count()} V=1' + +do_configure() { + # allow user to define their own defconfig in bbappend, taken from kernel.bbclass + if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then + mv "${S}/.config" "${B}/.config" + fi + + # Copy defconfig to .config if .config does not exist. This allows + # recipes to manage the .config themselves in do_configure_prepend(). + if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then + cp "${WORKDIR}/defconfig" "${B}/.config" + fi + + oe_runmake oldconfig || oe_runmake defconfig + + # Disable killall5 as it isn't managed by update-alternatives + sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config + + # Disable swapon as it doesn't handle the '-a' argument used during boot + sed -e 's/CONFIG_SWAPON=y/# CONFIG_SWAPON is not set/' -i .config + + # Enable init if toybox was set as init manager + if ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','toybox','true','false',d)}; then + sed -e 's/# CONFIG_INIT is not set/CONFIG_INIT=y/' -i .config + fi +} + +do_compile() { + oe_runmake ${TOYBOX_BIN} + + # Create a list of links needed + ${BUILD_CC} -I . scripts/install.c -o generated/instlist + ./generated/instlist long | sed -e 's#^#/#' > toybox.links + if ${@bb.utils.contains('PACKAGECONFIG','no-iconv','true','false',d)}; then + sed -i -e '/iconv$/d' toybox.links + fi + if ${@bb.utils.contains('PACKAGECONFIG','no-getconf','true','false',d)}; then + sed -i -e '/getconf$/d' toybox.links + fi +} + +do_install() { + # Install manually instead of using 'make install' + install -d ${D}${base_bindir} + if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then + install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox + else + install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox + fi + + install -d ${D}${sysconfdir} + install -m 0644 ${B}/toybox.links ${D}${sysconfdir} +} + +# If you've chosen to install toybox you probably want it to take precedence +# over busybox where possible but not over other packages +ALTERNATIVE_PRIORITY = "60" + +python do_package_prepend () { + # Read links from /etc/toybox.links and create appropriate + # update-alternatives variables + + dvar = d.getVar('D') + pn = d.getVar('PN') + target = d.expand("${base_bindir}/toybox") + + f = open('%s/etc/toybox.links' % (dvar), 'r') + for alt_link_name in f: + alt_link_name = alt_link_name.strip() + alt_name = os.path.basename(alt_link_name) + d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) + d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) + f.close() +} -- cgit v1.2.3-54-g00ecf