opan 3 days ago

IIRC this was made to solve a licensing issue with busybox (toybox being more permissive) and be included with Android. As a fan of copyleft, initially the idea annoyed me, but I eventually came to the conclusion that if it was the only way to include better tools in a particular OS out of the box, it was probably fine.

I recall busybox being often used for gpl enforcement, so I wonder now how widespread toybox is by various companies hoping to avoid that. Do modern Smart TVs and such use it?

  • GalaxyNova 3 days ago

    I believe most smart TVs use Android as the base, so I would think yes.

    • ChocolateGod 3 days ago

      I think Samsung still use Tizen (still Linux, seems to use Toybox) and LG uses WebOS (Linux again, not sure if it uses Toybox).

      • 6SixTy 3 days ago

        Just looked through my TV, webOS uses Busybox.

        • Imustaskforhelp 3 days ago

          please teach me how to do this, I have a webos lg tv which is literally not being used because my father used to watch youtube but then youtube almost stopped working on it and there are no more updates and I tried to root it but i couldn't and I just want to use it instead of it being a junk.

          Any guide on helping me prevent some e-waste at my home. I would prefer to have complete linux access of my lgtv and use something like tiny core linux on my webos tv or something, is something like this possible or?

          • numpad0 2 days ago

            Normally how you realize your TV runs busybox is by looking at the last parts of the manual, not by just casually sshing into it and running busybox --version.

            • KlutzySofa 2 days ago

              It is however a lot easier to SSH into it.

              root@lgwebostv:~# busybox

              BusyBox v1.29.2 (2024-06-12 00:33:13 UTC) multi-call binary.

          • BoredPositron 2 days ago

            Use it with a setup box?

            • Imustaskforhelp 2 days ago

              my parents bought the "smart" tv a decade ago to switch away from setup box

              It was kinda expensive at the time, its wild of sorts how cheap of sorts TV's have become right now but still we bought it and its just e-waste right now.

              I am thinking of setting up a raspberry pi but I am more interested in learning the inner details or how to do things preferably without raspberry pi as well

              • BoredPositron a day ago

                It's not e-waste. Your ignorance for the easy solution makes it e-waste. There is nothing to learn from bad embedded systems.

userbinator 3 days ago

As a contrast, in the DOS world the file COMMAND.COM provided both the shell as well as most of the basic file management commands which would be separate files on Unix-like systems (cp, ls, mkdir, mv, rm, rmdir, etc.); and some specialised DOS-compatible systems had the whole basic OS including the kernel, device drivers, and shell along with its builtins in a single flat-loaded binary.

M95D 2 days ago

It looks to me that busybox is abandoned [1]. Let's hope google money keeps toybox alive.

[1]https://lists.busybox.net/pipermail/busybox-cvs/2024-January...

  • f33d5173 2 days ago

    That is by no means the most recent message to the list, I don't see what causes you to claim it's abandoned.

    • JdeBP 2 days ago

      I don't understand the deduction, either.

      But it seems that no BusyBox bug-fixer has spotted an easy-to-fix error that is stopping the BusyBox Bugzilla from working, and causing the hyperlink in that e-mail to lead to an error message that dumps out a glob of SQL and stack trace in black on red. It has a table named groups, and Bugzilla is attempting to use the table without quoting the MySQL keyword.

      * https://github.com/bugzilla/bugzilla/commit/08679016bd83d2b1...

      This bug was fixed in Bugzilla over a year ago. BusyBox's instance of Bugzilla is still exhibiting it today. It makes Buzilla unusable. Thus I do wonder at all of the automated messages to that mailing list with hyperlinks to stuff that does not work. Perhaps no-one is reading the mailing list as well as no-one using the bug tracker.

throwaway2046 3 days ago

I really appreciate Toybox for its clean codebase and permissive license, hopefully it reaches feature parity with Busybox in the future. Version 0.8.13 is long overdue.

andai 3 days ago

See also, for Windows: w64devkit, and the included busybox-w32

https://github.com/skeeto/w64devkit

https://frippery.org/busybox/

  • tredre3 3 days ago

    Although I love and use w64devkit myself, it seems like you should point people towards the original busybox rather than take two detours through an unrelated toolkit using an unofficial port of it?

    • andai 16 hours ago

      I guess? I haven't used Busybox on Windows directly. This is a more complete environment for C/C++ development, which is what I used it for -- i.e. a lightweight alternative to Visual Studio / figuring out how to setup MSYS/mingw and going thru its package manager.

      (As for MSYS, I somehow ended up with 4 separate installs of it due to each programming language bundling its own version!)

mcswell 3 days ago

But what IS it?

  • Nursie 2 days ago

    A static binary that contains a huge variety of useful posix commands (ls/cp/mv/cat/md5sum/nohup/mount etc etc), all baked into one program, which exhibits different behaviour depending on how it is called - if you name the executable to one of these, or provide a hard or soft link with that name, it will behave as that program.

    This generally makes things easier on devices with strict storage space constraints by reducing the overhead of having separate executables and/or libraries for the code for all these. It may reduce load times in very constrained systems compared to dynamic linking too, as everything is bundled in the one image, and in some cases it can exhibit performance gains.

    It's generally (but not exclusively) of interest to embedded device manufacturers. Toybox is licensed very permissively, compared to busybox's use of GPL, so manufacturers like it. IIRC it is now used in android.

    • pmarreck 2 days ago

      The Nixpkgs search page for it https://search.nixos.org/packages?channel=25.05&show=toybox&... shows the list of its outputs (executables):

          [ acpi arch ascii base32 base64 basename blkdiscard blkid blockdev bunzip2 bzcat cal cat chattr chgrp chmod chown chroot chrt chvt cksum clear cmp comm count cp cpio crc32 cut date dd deallocvt devmem df dirname dmesg dnsdomainname dos2unix du echo egrep eject env expand factor fallocate false fgrep file find flock fmt fold free freeramdisk fsfreeze fstype fsync ftpget ftpput getconf getopt gpiodetect gpiofind gpioget gpioinfo gpioset grep groups gunzip halt head help hexedit host hostname httpd hwclock i2cdetect i2cdump i2cget i2cset i2ctransfer iconv id ifconfig inotifyd insmod install ionice iorenice iotop kill killall killall5 link linux32 ln logger login logname losetup ls lsattr lsmod lspci lsusb makedevs mcookie md5sum memeater microcom mix mkdir mkfifo mknod mkpasswd mkswap mktemp modinfo mount mountpoint mv nbd-client nbd-server nc netcat netstat nice nl nohup nproc nsenter od oneit openvt partprobe paste patch pgrep pidof ping ping6 pivot_root pkill pmap poweroff printenv printf prlimit ps pwd pwdx pwgen readahead readelf readlink realpath reboot renice reset rev rfkill rm rmdir rmmod rtcwake sed seq setfattr setsid sha1sum sha224sum sha256sum sha384sum sha3sum sha512sum shred shuf sleep sntp sort split stat strings su swapoff swapon switch_root sync sysctl tac tail tar taskset tee test time timeout top touch toybox true truncate ts tsort tty tunctl uclampset ulimit umount uname unicode uniq unix2dos unlink unshare uptime usleep uudecode uuencode uuidgen vconfig vmstat w watch watchdog wc wget which who whoami xargs xxd yes zcat
      
      That's... an impressive set of Unix functionality in a single binary... AFAIK, if this works like Busybox does, these are all actually just wrappers that call into Toybox with this command as a parameter. EDIT: Nope, it's literally just symlinks with names detected by toybox that dictate how it will behave, and this is apparently called a "multicall binary"

      And yes, the [ (open bracket) is a command in POSIX shell.

    • mcswell 2 days ago

      thanks, that is the most understandable explanation I've seen!

  • chasil 3 days ago

    Toybox is a clone of Busybox with a less restrictive license.

    Toybox is used on Android to implement a number of POSIX.2 utilities.

    https://en.wikipedia.org/wiki/BusyBox#Controversy_over_Toybo...

    • MuffinFlavored 2 days ago

      Is it fair to say GNU coreutils "inspired" the need for Busybox?

      • chasil 2 days ago

        I'm actually surprised that there wasn't a fork of the last GPLv2 release.

        The benefit of starting over is that Landley was able to relicense Toybox as BSD, after he first released it as GPLv2. That would not have been possible with a fork.

        If this were commercial software, he would have been forced to "cleanroom" the new code.

  • tetris11 3 days ago

    I think... it builds a busybox system based on desired commands (similar to a dockerfile, but using a REPL?). I have to admit that the README is next to useless.

    • watusername 3 days ago

      > I think... it builds a busybox system based on desired commands (similar to a dockerfile, but using a REPL?).

      I am now very curious how you arrived at this conclusion. Did you make use of any LLM? If so, which model and what prompt did you use?

    • stonogo 3 days ago

      How would you improve the description in the readme file?

          The toybox build produces a multicall binary, a "swiss-army-knife" program
          that acts differently depending on the name it was called by (cp, mv, cat...).
          Installing toybox adds symlinks for each command name to the $PATH.
      • numpad0 2 days ago

        I think small but key context that needs to be mentioned here is that, Busybox always produced the memorable "Busybox v1.2.3(.*) multi-call binary" header line wherever appropriate, and used "The Swiss Army Knife of Embedded Linux" as project tagline. That's likely why that text is written that way, so that it pattern matches inside users' brains.

      • pbhjpbhj 3 days ago

        That's pretty good. I'd _consider_ flipping it around so the familiar part comes first?

        Perhaps, something like:

        «Toybox provides a set of utilities like cp, mv, cat, ..., which are each just links to a single binary (a "multicall binary").

        In this way `toybox` is like a Swiss Army knife -- several tools combined into one.

        Installing toybox adds a symlink for each [of the x] command name[s] to the $PATH.»

        The last sentence might be better if it said how many symlinks are added?

        Aside, Busybox uses the term "Swiss Army Knife" in their description. Using the same term like that, which isn't an inherent term, might open you up to a 'passing off' claim. Multi-tool, or EDC, may work?

      • skeledrew 3 days ago

        The app provides various subcommands, which can also be invoked based on its name. Symlinks are used to expose the subcommands as regular app names. My rewording/simplification of the description

        • ggm 3 days ago

          Symlinks or hardlinks.

          • knome 2 days ago

            I've generally seen symlinks, but it wouldn't really matter. It's just checking argument 0, the program name, and branching off that.

          • skeledrew 2 days ago

            Just going by what's in the parent quote.

      • hamdingers 3 days ago

        That's a good description but it's odd to put it after ~60 lines of instruction on downloading and building the program. Users may want to know what it is first.

        • mrbluecoat 3 days ago

          Addressing the obvious elephant in the room (busybox) is also buried:

          > I left busybox due to an argument over GPLv3.

Jotalea 3 days ago

I can't stop misreading this tool as "Toby Fox".

Anyways, I might use this in my own distro for fun.

flyer23 2 days ago

[flagged]

  • hbffbjnb 2 days ago

    Literally the first sentence in the readme

    Toybox: all-in-one Linux command line.

    I don't know what else you expect? It's common utilities in one executable

    • flyer23 2 days ago

      Really? You call that accurate description? I read that and immediatelly thought someone is doing some new Wayland terminal. Compare it to first sentence of BusyBox:

      BusyBox combines tiny versions of many common UNIX utilities into a single small executable.

      • sussmannbaka a day ago

        The actual first sentence of Toybox:

        Toybox combines many common Linux command line utilities together into a single BSD-licensed executable.

        • flyer23 a day ago

          Do a PR then to this repo and claim the glory, my point states valid until you do it

          • sussmannbaka 9 hours ago

            No, it’s literally the first sentence. Not the projects fault that people keep linking the source code repository instead of the website.