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?
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?
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.
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
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.
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.
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?
It's sort of a remastered Version of busybox. Please refer to Rob himself for explaining.
There's a good intro on yt [1] and a "demo" in [2]
edit: Well Sorry, [2] was about mkroot. I just skipped through the video. I thought it was related to toybox/busybox. Maybe somewhere in the talk. Has been a while since I last watched it.
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.
[ 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.
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.
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.
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.
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?
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
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.
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?
The license page and linked blog posts mentions this: https://landley.net/toybox/license.html
I like the 0BSD license (see my https://xn--gba.st), AWS also uses the semantically equivalent MIT-0 license for code samples, etc.
I believe most smart TVs use Android as the base, so I would think yes.
I think Samsung still use Tizen (still Linux, seems to use Toybox) and LG uses WebOS (Linux again, not sure if it uses Toybox).
Just looked through my TV, webOS uses Busybox.
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?
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.
Use it with a setup box?
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
Try https://cani.rootmy.tv/
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.
BusyBox got its name from a collection of toys in one assembly/container:
https://www.google.com/search?udm=2&q=fisher+price+busy+box
I wonder if Toybox got its name from the Soundgarden song of the same name or if it was chosen due to the similarity of Busybox's collection of toys.
I guess it has already been posted in 2021: https://news.ycombinator.com/item?id=28627433
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.
I can't stop misreading this tool as "Toby Fox".
Anyways, I might use this in my own distro for fun.
See also, for Windows: w64devkit, and the included busybox-w32
https://github.com/skeeto/w64devkit
https://frippery.org/busybox/
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?
But what IS it?
It's sort of a remastered Version of busybox. Please refer to Rob himself for explaining.
There's a good intro on yt [1] and a "demo" in [2]
edit: Well Sorry, [2] was about mkroot. I just skipped through the video. I thought it was related to toybox/busybox. Maybe somewhere in the talk. Has been a while since I last watched it.
[1] https://www.youtube.com/watch?v=MkJkyMuBm3g [2] https://www.youtube.com/watch?v=Sk9TatW9ino
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...
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.
The Nixpkgs search page for it https://search.nixos.org/packages?channel=25.05&show=toybox&... shows the list of its outputs (executables):
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.
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.
> 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?
How would you improve the description in the readme file?
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.
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?
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
Symlinks or hardlinks.
I've generally seen symlinks, but it wouldn't really matter. It's just checking argument 0, the program name, and branching off that.
Just going by what's in the parent quote.
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.
Addressing the obvious elephant in the room (busybox) is also buried:
> I left busybox due to an argument over GPLv3.