Question about adding toybox.mk.
My toybox project (http://landley.net/toybox) is another multicall binary posix command line implementation in the same genre as busybox. (Toybox is public domain instead of GPL and I think the code's a lot better, but I would, wouldn't I?) Point is, it potentially replaces a bunch of other packages.
Various people have added it to buildroot, the first google hit is:
So I was thinking of formally submitting a toybox.mk to you guys upstream, but I've hit a snag:
Busybox is kind of deeply embedded into buildroot, with 227 lines of busybox.mk covering a bunch of config symbols and special cases for selectively hiding and otherwise interacting with lots of other packages, and it's not just that one file:
$ grep -irl busybox buildroot/ | wc -l 89
Swapping out busybox for toybox seems about as intrusive as swapping out uClibc for musl. Does anyone have any hints how I should go about it before I start? (Having buildroot's toybox.mk define BLAH_BUSYBOX symbol names, seems... untidy?)
Suggestions?
Rob
(Yeah, I could wait until toybox's 1.0 release when I've run out of things that busybox does that toybox doesn't which I care about. But other people aren't waiting, so I thought I'd look into it. what's there is _useful_. My aboriginal linux project is slowly replacing busybox with toybox a command at a time, using them side by side in the meantime. The real issue here is buildroot is treating busybox as special when there may actually be 3 or 4 interesting alternate implementations of the same functionality. Has systemd implemented its own "mount" and "umount" commands yet? Wait for it...)
Quoted 18 lines · Rob Landley
My toybox project (http://landley.net/toybox) is another multicall binary posix command line implementation in the same genre as busybox. (Toybox is public domain instead of GPL and I think the code's a lot better, but I would, wouldn't I?) Point is, it potentially replaces a bunch of other packages.
Various people have added it to buildroot, the first google hit is:
So I was thinking of formally submitting a toybox.mk to you guys upstream, but I've hit a snag:
Busybox is kind of deeply embedded into buildroot, with 227 lines of busybox.mk covering a bunch of config symbols and special cases for selectively hiding and otherwise interacting with lots of other packages, and it's not just that one file:
Quoted 7 lines
$ grep -irl busybox buildroot/ | wc -l 89Swapping out busybox for toybox seems about as intrusive as swapping out uClibc for musl. Does anyone have any hints how I should go about it before I start? (Having buildroot's toybox.mk define
BLAH_BUSYBOXsymbol names, seems... untidy?)
The reason that busybox appears in so many other packages is just to make sure
that the executables from the full package override the ones from busybox. However, in a first step, it's OK to assume that the full package is not selected when you configure some feature of toybox. We can later correct it if necessary.
Regards,
Arnout
Quoted 19 lines
Suggestions?
Rob
(Yeah, I could wait until toybox's 1.0 release when I've run out of things that busybox does that toybox doesn't which I care about. But other people aren't waiting, so I thought I'd look into it. what's there is _useful_. My aboriginal linux project is slowly replacing busybox with toybox a command at a time, using them side by side in the meantime. The real issue here is buildroot is treating busybox as special when there may actually be 3 or 4 interesting alternate implementations of the same functionality. Has systemd implemented its own "mount" and "umount" commands yet? Wait for it...)
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 add toybox (was Re: Question about adding toybox.mk.)
Quoted 27 lines · Arnout Vandecappelle
Quoted 18 lines · Rob Landley
My toybox project (http://landley.net/toybox) is another multicall binary posix command line implementation in the same genre as busybox. (Toybox is public domain instead of GPL and I think the code's a lot better, but I would, wouldn't I?) Point is, it potentially replaces a bunch of other packages.
Various people have added it to buildroot, the first google hit is:
So I was thinking of formally submitting a toybox.mk to you guys upstream, but I've hit a snag:
Busybox is kind of deeply embedded into buildroot, with 227 lines of busybox.mk covering a bunch of config symbols and special cases for selectively hiding and otherwise interacting with lots of other packages, and it's not just that one file:
Quoted 7 lines
$ grep -irl busybox buildroot/ | wc -l 89Swapping out busybox for toybox seems about as intrusive as swapping out uClibc for musl. Does anyone have any hints how I should go about it before I start? (Having buildroot's toybox.mk define
BLAH_BUSYBOXsymbol names, seems... untidy?)
Quoted 5 lines
The reason that busybox appears in so many other packages is just to make sure
that the executables from the full package override the ones from busybox. However, in a first step, it's OK to assume that the full package is not selected when you configure some feature of toybox. We can later correct it if necessary.
Here's my first stab at it. To switch off busybox you have to disable busybox init in the system settings. For toybox to show up you have to switch on largefile and wchar in uClibc (or just use musl or glibc).
package/toybox/Config.in new file +24 -0
@@ -0,0 +1,24 @@ +config BR2_PACKAGE_TOYBOX + bool "Toybox" + depends on BR2_LARGEFILE && BR2_USE_WCHAR + help + Toybox combines common Linux command line utilities together into + a single executable that's simple, small, fast, and reasonably + standards compliant. + + It was started by an ex-maintainer of BusyBox, and uses the same + "multicall binary configured at build time via menuconfig" approach, + but is a fresh implementation that uses no busybox code. + + Toybox is licensed under a "zero clause" BSD variant which grants + the same blanket permissions but removes the requirement to copy + specific license text into derivative works, essentially placing + its code into the public domain. + +config BR2_PACKAGE_TOYBOX_CONFIG + string "Toybox configuration file:" + default "package/toybox/toybox.config" + depends on BR2_PACKAGE_TOYBOX + help + Specify an alternative config file location enabling a different + set of commands in toybox. The default file equals "make defconfig".
package/toybox/toybox-0001-portability.patch new file +14 -0
@@ -0,0 +1,14 @@ +Workaround for uClibc's lack of posix-2008 compliance. + +diff -r 74b29c369420 lib/portability.h +--- a/lib/portability.h ++++ b/lib/portability.h +@@ -74,6 +74,8 @@ + #include <unistd.h> + #include <stdio.h> + ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream); ++char *stpcpy(char *dest, const char *src); ++pid_t getsid(pid_t pid); + + // uClibc's last-ever release was in 2012, so of course it doesn't define + // any flag newer than MS_MOVE, which was added in 2001 (linux 2.5.0.5),
package/toybox/toybox.config new file +169 -0
169 lines not on this page · raw message
package/toybox/toybox.mk new file +26 -0
@@ -0,0 +1,26 @@ +################################################################################ +# +# toybox +# +################################################################################ + +TOYBOX_VERSION = 0.4.9 +TOYBOX_SITE = http://landley.net/toybox/downloads +TOYBOX_SOURCE = toybox-$(TOYBOX_VERSION).tar.bz2 +TOYBOX_LICENSE = Public domain, BSD-0c +TOYBOX_LICENSE_FILES = LICENSE + +TOYBOX_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_TOYBOX_CONFIG)) + +define TOYBOX_BUILD_CMDS + $(TARGET_MAKE_ENV) CROSS_COMPILE="$(TARGET_CROSS)" \ + $(MAKE) -C $(@D) +endef + +define TOYBOX_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) PREFIX="$(TARGET_DIR)" \ + $(MAKE) -C $(@D) install +endef + + +$(eval $(kconfig-package))
package/Config.in +1 -0
@@ -1,6 +1,7 @@ menu "Target packages" source "package/busybox/Config.in" + source "package/toybox/Config.in" menu "Audio and video applications" source "package/alsa-utils/Config.in"
Thanks,
Rob