From ae867dc3ecd67cddc4b4cad1240d37d8187c3690 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Tue, 21 Oct 2014 14:01:03 +0000 Subject: toybox: Upgrade to v0.5.0 The patch applied to toybox is rebased onto the new release and updated. Signed-off-by: Paul Barker Signed-off-by: Martin Jansa --- .../toybox/0001-Match-paths-with-busybox.patch | 44 ++++++++++----- meta-oe/recipes-core/toybox/toybox_0.4.9.bb | 64 ---------------------- meta-oe/recipes-core/toybox/toybox_0.5.0.bb | 64 ++++++++++++++++++++++ 3 files changed, 95 insertions(+), 77 deletions(-) delete mode 100644 meta-oe/recipes-core/toybox/toybox_0.4.9.bb create mode 100644 meta-oe/recipes-core/toybox/toybox_0.5.0.bb (limited to 'meta-oe') diff --git a/meta-oe/recipes-core/toybox/toybox/0001-Match-paths-with-busybox.patch b/meta-oe/recipes-core/toybox/toybox/0001-Match-paths-with-busybox.patch index 2213559438..e071f22b16 100644 --- a/meta-oe/recipes-core/toybox/toybox/0001-Match-paths-with-busybox.patch +++ b/meta-oe/recipes-core/toybox/toybox/0001-Match-paths-with-busybox.patch @@ -1,4 +1,4 @@ -From cbd9ac1d0769338411297d2cb97f1608c17c8ae9 Mon Sep 17 00:00:00 2001 +From 27f5ca9f1e212e5ab00cde0bfc91282fc7ff5e16 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 18 Aug 2014 12:18:16 +0000 Subject: [PATCH] Match paths with busybox @@ -8,11 +8,16 @@ update-alternatives, the paths of the links installed by toybox should match those installed by busybox. This is accomplished by changing the flags of a few tools within toybox. +v2: + - Forward ported from v0.4.9 to v0.5.0 + - Move new 'mount' command + Signed-off-by: Paul Barker Upstream-status: Inappropriate (specific to update-alternatives use in OpenEmbedded) --- + toys/lsb/mount.c | 2 +- toys/lsb/pidof.c | 2 +- toys/other/chvt.c | 2 +- toys/other/ifconfig.c | 2 +- @@ -37,8 +42,21 @@ Upstream-status: Inappropriate toys/posix/tee.c | 2 +- toys/posix/uniq.c | 2 +- toys/posix/who.c | 2 +- - 24 files changed, 28 insertions(+), 28 deletions(-) + 25 files changed, 29 insertions(+), 29 deletions(-) +diff --git a/toys/lsb/mount.c b/toys/lsb/mount.c +index 01f5c32..65a5aa2 100644 +--- a/toys/lsb/mount.c ++++ b/toys/lsb/mount.c +@@ -6,7 +6,7 @@ + * Note: -hV is bad spec, haven't implemented -FsLU yet + * no mtab (/proc/mounts does it) so -n is NOP. + +-USE_MOUNT(NEWTOY(mount, "?O:afnrvwt:o*[-rw]", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT)) ++USE_MOUNT(NEWTOY(mount, "?O:afnrvwt:o*[-rw]", TOYFLAG_BIN|TOYFLAG_STAYROOT)) + USE_NFSMOUNT(NEWTOY(nfsmount, "?<2>2", TOYFLAG_USR|TOYFLAG_BIN|TOYFLAG_STAYROOT)) + + config MOUNT diff --git a/toys/lsb/pidof.c b/toys/lsb/pidof.c index 51b742f..a8fc8ef 100644 --- a/toys/lsb/pidof.c @@ -66,7 +84,7 @@ index 6544265..a93327f 100644 config CHVT bool "chvt" diff --git a/toys/other/ifconfig.c b/toys/other/ifconfig.c -index a84e26a..66c7179 100644 +index f5d4215..5e7c54c 100644 --- a/toys/other/ifconfig.c +++ b/toys/other/ifconfig.c @@ -6,7 +6,7 @@ @@ -226,10 +244,10 @@ index 8e57ca1..0c6c640 100644 config SYSCTL bool "sysctl" diff --git a/toys/posix/cut.c b/toys/posix/cut.c -index 38f136e..87a1f0d 100644 +index 7f10c5e..1ab3ce8 100644 --- a/toys/posix/cut.c +++ b/toys/posix/cut.c -@@ -4,7 +4,7 @@ +@@ -5,7 +5,7 @@ * * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cut.html @@ -265,7 +283,7 @@ index e8517d4..3ac4373 100644 config HEAD bool "head" diff --git a/toys/posix/id.c b/toys/posix/id.c -index a03a097..cfe0b59 100644 +index b4d9c00..df79419 100644 --- a/toys/posix/id.c +++ b/toys/posix/id.c @@ -6,10 +6,10 @@ @@ -274,11 +292,11 @@ index a03a097..cfe0b59 100644 -USE_ID(NEWTOY(id, ">1nGgru[!Ggu]", TOYFLAG_BIN)) +USE_ID(NEWTOY(id, ">1nGgru[!Ggu]", TOYFLAG_USR|TOYFLAG_BIN)) - USE_ID_GROUPS(OLDTOY(groups, id, NULL, TOYFLAG_USR|TOYFLAG_BIN)) --USE_ID_LOGNAME(OLDTOY(logname, id, ">0", TOYFLAG_BIN)) --USE_ID_LOGNAME(OLDTOY(whoami, id, ">0", TOYFLAG_BIN)) -+USE_ID_LOGNAME(OLDTOY(logname, id, ">0", TOYFLAG_USR|TOYFLAG_BIN)) -+USE_ID_LOGNAME(OLDTOY(whoami, id, ">0", TOYFLAG_USR|TOYFLAG_BIN)) + USE_GROUPS(OLDTOY(groups, id, NULL, TOYFLAG_USR|TOYFLAG_BIN)) +-USE_LOGNAME(OLDTOY(logname, id, ">0", TOYFLAG_BIN)) +-USE_LOGNAME(OLDTOY(whoami, id, ">0", TOYFLAG_BIN)) ++USE_LOGNAME(OLDTOY(logname, id, ">0", TOYFLAG_USR|TOYFLAG_BIN)) ++USE_LOGNAME(OLDTOY(whoami, id, ">0", TOYFLAG_USR|TOYFLAG_BIN)) config ID bool "id" @@ -335,7 +353,7 @@ index 0388510..5574088 100644 config TEE bool "tee" diff --git a/toys/posix/uniq.c b/toys/posix/uniq.c -index bd41d4a..374ceab 100644 +index 3cfdb94..c127cfe 100644 --- a/toys/posix/uniq.c +++ b/toys/posix/uniq.c @@ -4,7 +4,7 @@ @@ -361,5 +379,5 @@ index 2c8a2e6..d5cd001 100644 config WHO bool "who" -- -2.0.4 +2.1.2 diff --git a/meta-oe/recipes-core/toybox/toybox_0.4.9.bb b/meta-oe/recipes-core/toybox/toybox_0.4.9.bb deleted file mode 100644 index ec76bd61a1..0000000000 --- a/meta-oe/recipes-core/toybox/toybox_0.4.9.bb +++ /dev/null @@ -1,64 +0,0 @@ -SUMMARY = "Toybox combines common utilities together into a single executable." -HOMEPAGE = "http://www.landley.net/toybox/" - -SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.bz2 \ - file://0001-Match-paths-with-busybox.patch" -SRC_URI[md5sum] = "a8f1022175689defec51cf5a71c41326" -SRC_URI[sha256sum] = "e6dc9052826a3bdae1923e3301c9e3542e890af5ed66534052943f8412255bff" - -LICENSE = "BSD-0-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=57cc240a6204b2ea8c68450d42f9d33f" - -SECTION = "base" - -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 -} - -do_compile() { - oe_runmake toybox_unstripped - - # Create a list of links needed - oe_runmake 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_unstripped ${D}${base_bindir}/toybox - else - install -m 0755 ${B}/toybox_unstripped ${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', True) - pn = d.getVar('PN', True) - 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.5.0.bb b/meta-oe/recipes-core/toybox/toybox_0.5.0.bb new file mode 100644 index 0000000000..9bdba4da5c --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox_0.5.0.bb @@ -0,0 +1,64 @@ +SUMMARY = "Toybox combines common utilities together into a single executable." +HOMEPAGE = "http://www.landley.net/toybox/" + +SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.bz2 \ + file://0001-Match-paths-with-busybox.patch" +SRC_URI[md5sum] = "2cb6e8b34134038d86048e117f77765f" +SRC_URI[sha256sum] = "2718b42154be041435df48d5b5140f4e307767c36b1017e0c8d0da7f75b327a7" + +LICENSE = "BSD-0-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=f0b8b3dd6431bcaa245da0a08bd0d511" + +SECTION = "base" + +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 +} + +do_compile() { + oe_runmake toybox_unstripped + + # Create a list of links needed + oe_runmake 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_unstripped ${D}${base_bindir}/toybox + else + install -m 0755 ${B}/toybox_unstripped ${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', True) + pn = d.getVar('PN', True) + 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 v1.2.3-54-g00ecf