From efa72fe9565978bcffccfd01eec4554a8a5abc93 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Sun, 4 Dec 2016 10:42:25 +0000 Subject: toybox: Upgrade to 0.7.2 Patches are dropped as they are no longer needed. Signed-off-by: Paul Barker Signed-off-by: Martin Jansa --- .../toybox/toybox/0001-Fix-TOYBOX_VERSION.patch | 29 --------- .../toybox/0002-Fix-trimmed-printf-in-grep.patch | 34 ---------- meta-oe/recipes-core/toybox/toybox_0.7.1.bb | 74 ---------------------- meta-oe/recipes-core/toybox/toybox_0.7.2.bb | 72 +++++++++++++++++++++ 4 files changed, 72 insertions(+), 137 deletions(-) delete mode 100644 meta-oe/recipes-core/toybox/toybox/0001-Fix-TOYBOX_VERSION.patch delete mode 100644 meta-oe/recipes-core/toybox/toybox/0002-Fix-trimmed-printf-in-grep.patch delete mode 100644 meta-oe/recipes-core/toybox/toybox_0.7.1.bb create mode 100644 meta-oe/recipes-core/toybox/toybox_0.7.2.bb diff --git a/meta-oe/recipes-core/toybox/toybox/0001-Fix-TOYBOX_VERSION.patch b/meta-oe/recipes-core/toybox/toybox/0001-Fix-TOYBOX_VERSION.patch deleted file mode 100644 index 8af4305111..0000000000 --- a/meta-oe/recipes-core/toybox/toybox/0001-Fix-TOYBOX_VERSION.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 209fad8ebd17bf46d0431dafbb547f429a3cffdf Mon Sep 17 00:00:00 2001 -From: Paul Barker -Date: Sat, 4 Jun 2016 15:05:49 +0100 -Subject: [PATCH 1/2] Fix TOYBOX_VERSION - -The latest tagged version is 0.7.1. - -Signed-off-by: Paul Barker -Upstream-status: Submitted ---- - main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/main.c b/main.c -index eeae2f3..bedb333 100644 ---- a/main.c -+++ b/main.c -@@ -6,7 +6,7 @@ - #include "toys.h" - - #ifndef TOYBOX_VERSION --#define TOYBOX_VERSION "0.7.0" -+#define TOYBOX_VERSION "0.7.1" - #endif - - // Populate toy_list[]. --- -2.1.4 - diff --git a/meta-oe/recipes-core/toybox/toybox/0002-Fix-trimmed-printf-in-grep.patch b/meta-oe/recipes-core/toybox/toybox/0002-Fix-trimmed-printf-in-grep.patch deleted file mode 100644 index 37808d03bc..0000000000 --- a/meta-oe/recipes-core/toybox/toybox/0002-Fix-trimmed-printf-in-grep.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9c51a0d7690fb3b08871dae2486af4032d8442fb Mon Sep 17 00:00:00 2001 -From: Paul Barker -Date: Sat, 4 Jun 2016 15:42:48 +0100 -Subject: [PATCH 2/2] Fix trimmed printf in grep - -Using a default trim value of INT_MAX/2 when printing a line causes nothing to -be printed on a system built using OpenEmbedded for the qemux86 target. This may -also affect other systems. - -Signed-off-by: Paul Barker -Upstream-status: Submitted ---- - toys/posix/grep.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/toys/posix/grep.c b/toys/posix/grep.c -index 2ca02d2..f38c538 100644 ---- a/toys/posix/grep.c -+++ b/toys/posix/grep.c -@@ -74,7 +74,10 @@ static void outline(char *line, char dash, char *name, long lcount, long bcount, - if (!line || (lcount && (toys.optflags&FLAG_n))) - printf("%ld%c", lcount, line ? dash : TT.outdelim); - if (bcount && (toys.optflags&FLAG_b)) printf("%ld%c", bcount-1, dash); -- if (line) xprintf("%.*s%c", trim ? trim : INT_MAX/2, line, TT.outdelim); -+ if (line) { -+ if (trim) xprintf("%.*s%c", trim, line, TT.outdelim); -+ else xprintf("%s%c", line, TT.outdelim); -+ } - } - - // Show matches in one file --- -2.1.4 - diff --git a/meta-oe/recipes-core/toybox/toybox_0.7.1.bb b/meta-oe/recipes-core/toybox/toybox_0.7.1.bb deleted file mode 100644 index 032b138552..0000000000 --- a/meta-oe/recipes-core/toybox/toybox_0.7.1.bb +++ /dev/null @@ -1,74 +0,0 @@ -SUMMARY = "Toybox combines common utilities together into a single executable." -HOMEPAGE = "http://www.landley.net/toybox/" -DEPENDS = "attr" - -SRC_URI = " \ - http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \ - file://0001-Fix-TOYBOX_VERSION.patch \ - file://0002-Fix-trimmed-printf-in-grep.patch \ -" - -SRC_URI[md5sum] = "e959e5ff8c6806781eb06e56f302a393" -SRC_URI[sha256sum] = "5bb3069f58faf12940d5cfde3209ac7f63210bebdd9023979b0c20cede126ea7" - -LICENSE = "BSD-0-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=f0b8b3dd6431bcaa245da0a08bd0d511" - -SECTION = "base" - -TOYBOX_BIN = "generated/unstripped/toybox" - -do_configure() { - 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 -} - -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 -} - -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} -} - -inherit update-alternatives - -# 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 = "/bin/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.7.2.bb b/meta-oe/recipes-core/toybox/toybox_0.7.2.bb new file mode 100644 index 0000000000..93ef45bb5e --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox_0.7.2.bb @@ -0,0 +1,72 @@ +SUMMARY = "Toybox combines common utilities together into a single executable." +HOMEPAGE = "http://www.landley.net/toybox/" +DEPENDS = "attr" + +SRC_URI = " \ + http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \ +" + +SRC_URI[md5sum] = "372d8fdf6ea3675edbf1f6a4109b6db6" +SRC_URI[sha256sum] = "79da71c7c39cef0a5f7b834f0b17d0d436e7994dd33e912f581b4c12d3b1681f" + +LICENSE = "BSD-0-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=f0b8b3dd6431bcaa245da0a08bd0d511" + +SECTION = "base" + +TOYBOX_BIN = "generated/unstripped/toybox" + +do_configure() { + 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 +} + +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 +} + +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} +} + +inherit update-alternatives + +# 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 = "/bin/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