From 2e7666002780e8e4b75092f20a7216d5ef989e5f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 3 Nov 2023 17:19:19 -0700 Subject: toybox: upgrade 0.8.8 -> 0.8.10 Signed-off-by: Khem Raj --- ...-Fix-timer_settime_wrap-for-32bit-systems.patch | 37 ------- meta-oe/recipes-core/toybox/toybox_0.8.10.bb | 113 ++++++++++++++++++++ meta-oe/recipes-core/toybox/toybox_0.8.8.bb | 115 --------------------- 3 files changed, 113 insertions(+), 152 deletions(-) delete mode 100644 meta-oe/recipes-core/toybox/toybox/0001-portability-Fix-timer_settime_wrap-for-32bit-systems.patch create mode 100644 meta-oe/recipes-core/toybox/toybox_0.8.10.bb delete mode 100644 meta-oe/recipes-core/toybox/toybox_0.8.8.bb (limited to 'meta-oe/recipes-core') diff --git a/meta-oe/recipes-core/toybox/toybox/0001-portability-Fix-timer_settime_wrap-for-32bit-systems.patch b/meta-oe/recipes-core/toybox/toybox/0001-portability-Fix-timer_settime_wrap-for-32bit-systems.patch deleted file mode 100644 index 8976b3748b..0000000000 --- a/meta-oe/recipes-core/toybox/toybox/0001-portability-Fix-timer_settime_wrap-for-32bit-systems.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7284c7ae0df9aa5a9c8aa0a81a018e17289fe2c4 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 8 Sep 2022 07:22:26 -0700 -Subject: [PATCH] portability: Fix timer_settime_wrap for 32bit systems with - 64bit time_t - -glibc does not define SYS_timer_settime if the 32bit syscall is not -available, new architectures like riscv32 has defaulted to 64bit time_t -from get go and avoided wiring 32bit syscall, therefore alias it to -64bit version here - -Upstream-Status: Submitted [https://github.com/landley/toybox/pull/373] -Signed-off-by: Khem Raj ---- - lib/portability.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/lib/portability.c b/lib/portability.c -index d955d081..4baa9367 100644 ---- a/lib/portability.c -+++ b/lib/portability.c -@@ -711,6 +711,12 @@ int timer_create_wrap(clockid_t c, struct sigevent *se, timer_t *t) - return 0; - } - -+#if !defined(SYS_timer_settime) && defined(SYS_timer_settime64) -+// glibc does not define defines SYS_timer_settime on 32-bit systems -+// with 64-bit time_t defaults e.g. riscv32 -+#define SYS_timer_settime SYS_timer_settime64 -+#endif -+ - int timer_settime_wrap(timer_t t, int flags, struct itimerspec *val, - struct itimerspec *old) - { --- -2.37.3 - diff --git a/meta-oe/recipes-core/toybox/toybox_0.8.10.bb b/meta-oe/recipes-core/toybox/toybox_0.8.10.bb new file mode 100644 index 0000000000..d747ebf36a --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox_0.8.10.bb @@ -0,0 +1,113 @@ +SUMMARY = "Toybox combines common utilities together into a single executable." +HOMEPAGE = "http://www.landley.net/toybox/" +DEPENDS = "attr virtual/crypt" + +LICENSE = "0BSD" +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] = "d3afee05ca90bf425ced73f527e418fecd626c5340b5f58711a14531f8d7d108" + +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.8.bb b/meta-oe/recipes-core/toybox/toybox_0.8.8.bb deleted file mode 100644 index 6836b14682..0000000000 --- a/meta-oe/recipes-core/toybox/toybox_0.8.8.bb +++ /dev/null @@ -1,115 +0,0 @@ -SUMMARY = "Toybox combines common utilities together into a single executable." -HOMEPAGE = "http://www.landley.net/toybox/" -DEPENDS = "attr virtual/crypt" - -LICENSE = "0BSD" -LIC_FILES_CHKSUM = "file://LICENSE;md5=78659a599b9325da368f2f1eb88f19c7" - -inherit cml1 update-alternatives - -SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \ - file://0001-portability-Fix-timer_settime_wrap-for-32bit-systems.patch \ - " -SRC_URI[sha256sum] = "dafd41978d40f02a61cf1be99a2b4a25812bbfb9c3157e679ee7611202d6ac58" - -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 1.2.3-korg