back to article Busybox 1.37 is tiny but capable, the way we like Linux tools to be

Busybox is tiny, unobtrusive, and runs quite a lot of routers and other key bits of the internet – somewhat like Linux itself used to be. The Busybox developers have released version 1.37.0, with some 50 changes. It's now Year 2038-ready, its implementation of the late Dave Mills's NTP is Year 2036-safe, and it includes a …

  1. Lee D Silver badge

    Wouldn't Aboriginal Linux now need to start including Rust if it's to build the Linux kernel itself?

    1. jake Silver badge

      No. AL doesn't use or need the really, really small bit of the kernel that was written in rust.

      In fact, most things don't.

  2. Anonymous Coward
    Anonymous Coward

    Linux kernel (i.e vendor BSP) and busybox is the only thing that is barable these days anyway. The rest of the Linux stack is horribly messy.

    The busybox init system is actually very servicable too in comparison to alternatives.

    1. jake Silver badge

      Yes, busybox makes for an excellent init for small projects.

      I'm still sticking with Slackware's BSD/SysV hybrid for most stuff, though.

  3. Steve Graham
    Linux

    As it happens, I've just migrated my laptop and desktop from busybox's mdev device manager to eudev. This was prompted by the Thinkpad suddenly deciding that it had found a new, removable SATA drive of zero bytes, which it assigned to /dev/sda replacing the actual SSD. mdev doesn't provide disks by label or by UUID so I had no way of making the kernel find the right drive.

    eudev was looking dodgy for a while after Gentoo dropped it, but Devuan and Alpine developers have stepped up.

  4. Peter Gathercole Silver badge

    I'm not sure that Busybox fits into the UNIX "Do one thing well", as it does lots of things, although I will admit, most of the time it does them well.

    What trips me up sometimes is that some of the commands it provides are missing options that I use, but I can normally work around that.

    1. jake Silver badge

      "I'm not sure that Busybox fits into the UNIX "Do one thing well", as it does lots of things,"

      Arguably BusyBox does do one thing, and does it well... it packages a customizable set of core tools (including init and mdev, amongst other things) in as minimal a footprint as possible. Kinda handy in embedded work, and other low memory situations. Remember, you would need/want those capabilities even without busybox, but in a much larger footprint.

      "What trips me up sometimes is that some of the commands it provides are missing options that I use"

      So compile 'em in ... should be easy enough to figure out how for someone with you credentials. Busybox is nothing if not highly customizable.

      1. doublelayer Silver badge

        That might work if it just packaged them, but since it also implemented them, maybe not. Not that I care. I don't think that "do one thing and do it well" was meant as an unbreakable law rather than some advice for an approach that often helps.

        1. jake Silver badge

          "Do one thing and do it well" was never a law, it was a basic philosophy for the core tools of the system.

          There were always exceptions; EMACS being a particularly egregious example.

          Not that I think of EMACS as being a core tool, mind ...

    2. Baggypants

      Busybox gets a free pass because the screeching unix zelots are just hypocrites deep down.

  5. Bebu
    Windows

    A nice part of busybox

    ./busybox lists the programs that it implements.

    A lot of router/embedded Linux devices using busybox don't (sym)link all the programs that they built busybox to implement. Can be very useful if you need a program busybox provides - ./busybox program args...

    These days the likes of Poettering &co would have had a daemon busyboxd and and a client busyboxc that passes commands etc via IPC to the daemon. ;)

    1. Anonymous Coward
      Anonymous Coward

      Re: A nice part of busybox

      .... whilst changing all your DNS settings!

  6. Rich 2 Silver badge

    Busybox and Linux

    I’ve not used busybox for a while but as far as I remember, it has bugger-all to do with Linux

    You can use busybox with many different kernels (or no kennel at all).

    Why does everything have to be described as “Linux” these days? I’ve lost count of the number of times BSD seems to be described as “a sort-of Linux”. It’s annoying. BB is NOT Linux

    1. jj_0

      Re: Busybox and Linux

      How would you use busybox without any kernel at all?

      1. Anonymous Coward
        Anonymous Coward

        Re: Busybox and Linux

        Yeah, under the "Swiss Army knife" link in TFA, one finds the statement:

        "To create a working system, just add some device nodes in /dev, a few configuration files in /etc, and a Linux kernel"

        But it can actually be used with FreeBSD (at least) and possibly Hurd (or port abandoned?) as well.

        1. Liam Proven (Written by Reg staff) Silver badge

          Re: Busybox and Linux

          > But it can actually be used with FreeBSD (at least) and possibly Hurd (or port abandoned?) as well.

          Huh. OK then. My bad; not only did I not know that, I read a comment elsewhere that strongly implied that it _was_ just a Linux thing and xBSD didn't directly have anything like it, and I did not follow that up and investigate.

          I defer.

    2. jake Silver badge

      Re: Busybox and Linux

      "it has bugger-all to do with Linux"

      To be fair, if you read the headline it says "Linux tools", which Busybox clearly is.

      It's also a BSD tool. Etc.

    3. katrinab Silver badge
      Meh

      Re: Busybox and Linux

      Busybox is a stripped-down version of GNU, and like GNU, runs on top of a Linux kernel.

      1. Anonymous Coward
        Anonymous Coward

        Re: Busybox and Linux

        .... in some circumstances...

        GNU can run under BSD kernels too.

      2. jake Silver badge

        Re: Busybox and Linux

        Busybox is NOT "GNU", but it does contain some GNU tools (it doesn't have to).

        Many other things also contain (some) GNU tools. As was the intent of GNU right from the git-go.

    4. Lars Silver badge
      Linux

      Re: Busybox and Linux

      As Bruce Perens was mentioned first I think we can assume it was made for Linux.

  7. Anonymous Coward
    Anonymous Coward

    Windows

    Wait, so it's the Linux version of COMMAND.COM?

    1. Alan Brown Silver badge

      Re: Windows

      No, not even close

      1. Anonymous Coward
        Anonymous Coward

        Re: Windows

        Close enough: https://en.wikipedia.org/wiki/COMMAND.COM#Internal_commands

    2. jake Silver badge

      Re: Windows

      No, it is not. But it does include a Linux version of command.com.

    3. John Brown (no body) Silver badge

      Re: Windows

      "Wait, so it's the Linux version of COMMAND.COM?"

      Loosely. Very loosley :-) If by COMMAND.COM you also meant to include IO.SYS and MSDOS.SYS :-)

      Oh, and probably many external commands may need to be compiled in too...

  8. l8gravely

    and monsoonmultimedia.com is gone

    I love how busybox is still here, but monsoonmultimedia.com (linked to in the article linked to from this one) is now gone. Yes!

  9. Gene Cash Silver badge

    Static linked BB can save your arse

    Remember when /sbin was for statically linked binaries, thus the name? Pepperidge Farms remembers.

    Now everything is dynamically linked, so if something steps on libc6, it's a really bad day. Seeing "-bash: /bin/ls: cannot execute: required file not found" sucks.

    Having a statically linked busybox squirreled away somewhere really gives you a fighting chance to fix things without too much pain.

    However the version supplied with Debian is dynamically linked, which makes it about as useful as tits on a boar hog and forces you to compile it yourself.

    1. DoContra
      Boffin

      Re: Static linked BB can save your arse

      However the version supplied with Debian is dynamically linked (...)

      Debian does provide a busybox-static package which does exactly what it says on the tin. Although by the time a system is that far gone, I personally go straight to PXE, my Ventoy pendrive (complete with SystemRescueCD and the latest WhateverBuntu LTS), and/or (for RPis and similar), an SD reader + systemd-nspawn + qemu-user-static-whateverArchitectureTheImageUses.

    2. Jamie Jones Silver badge

      Re: Static linked BB can save your arse

      FreeBSD /rescue is statically linked. It contains many-binaries-as-one-binary concept like BusyBox does, covering the command you'd typically need in a rescue.

      The difference is that the source for each command is actually the full source that is used to create the individual dynamic commands, so it's not small. (almost 17Mb)

  10. Michael Hoffmann Silver badge
    Facepalm

    Incredibly useful...

    ... but the first time I saw "FROM busybox:latest"

    at the top of a Dockerfile, for a production deployment container cluster, I nearly screamed.

  11. Anonymous Coward
    Anonymous Coward

    What was the problem with the BusyBox license that spawned toybox?

    BusyBox is a standalone binary. Android can surely include that in the same way it includes the kernel - nothing propriety is linked to it without source code being available, and there would be no need to keep BusyBox tweaks (if any) private.

    1. doublelayer Silver badge

      Two things, neither completely justified. The first was that, until version 1.3.0, its license was GPL 2 or later. As of 1.3.0, it became GPL 2 only, same as the kernel. Before that, people didn't like the ambiguity involved in letting whatever might show up in GPL version 3 (then unreleased) to be a core part of their system. This was only partially justified because the clarification came in 2006, so it's not like there was much need to deal with it.

      The other reason was even less justified, namely that Busybox was a project well-known for pursuing their license rights. If you used Busybox, they would demand the source be released and sue you if you didn't. This rarely if ever gave the community useful code because anyone using Busybox didn't have much of a need to improve it, but it did certainly penalize people who don't comply with a really easy license. This shouldn't really be a problem, and it really wasn't, but some companies can't be bothered to release the source code they haven't changed and contains no secrets. I'm not sure why they find this so difficult, but having tried to get source code from them, I know they exist.

      In general, one of the maintainers of Busybox got annoyed at another one and went off to create Toybox. This was in 2006, so before Android really went anywhere. Android had to choose between the BSD-licensed Toybox, run by someone who had added a lot of stuff to Busybox, or the GPL2 Busybox which had lost a maintainer but still had more people working on it. There wasn't an obvious good and bad answer, and it probably isn't that surprising that they went with Toybox. Having done so, Toybox has focused on keeping itself functional for Android, so it's not surprising that they're still using it.

      1. Anonymous Coward
        Anonymous Coward

        Thanks for the reply. I had mistakenly thought that toybox had been created primarily for Android, despite BusyBox already existing.

  12. ognissanti

    busybox linux

    It's possible to run a statically linked busybox binary + kernel as your entire OS. If you want a package manager to install other packages after that you can use nix (yeah, I know, I know, bloat etc. but it works).

    https://github.com/damianoognissanti/bbl

    1. jake Silver badge

      Re: busybox linux

      "If you want a package manager to install other packages after that you can use tar, as gawd/ess(es) intended."

      FTFY

      1. keithpeter Silver badge
        Pint

        Re: busybox linux

        @ognissanti: very interesting thanks but that nix stuff looks complex.

        @jake: would I be a) untaring the source tars and compiling (hence installing gcc or clang itself built to use musl)?

        or

        b) would I be cross-compiling somehow from a musl based host system and untaring binary tars?

        Icon: the dawn of a possible project is visible dimly between the clouds

    2. Anonymous Coward
      Anonymous Coward

      Re: busybox linux

      "It's possible to run a statically linked busybox binary + kernel as your entire OS."

      Your base system is using bash (rather than Busybox ash/hush) so make that kernel + busybox + bash...

      1. jake Silver badge

        Re: busybox linux

        "Your base system is using bash"

        How do you figure?

        1. doublelayer Silver badge

          Re: busybox linux

          The post they replied to linked to this GitHub repository with instructions for building a minimal distro using mostly just busybox, but those instructions do indeed involve installing bash too. As far as I can tell, not for any reason other than preferring bash to busybox ash, which I certainly do.

          It goes on to also demonstrate adding nix, xorg, and tools for WiFi, but those are optional. The bash step is not written separately so even if you stop at the first bootable thing, the system they specify has bash in it. You don't have to do that.

          1. ognissanti

            Re: busybox linux

            That's absolutely right. You don't need bash, it's just a preference. Sorry for the confusion...

          2. ognissanti

            Re: busybox linux

            I have moved the bash instructions now and made it an optional step.

            Now all you need is busybox and a kernel for the system to work. Thanks for spotting this :-)

          3. ognissanti

            Re: busybox linux

            I have now moved the bash part to its own chapter and have made it optional. Thank you for pointing that out! I tested to follow the first chapters yesterday and got a running system up in no time (on a machine that already had a bootloader and a linux distro with the dependencies to build the kernel)

  13. DoctorPaul

    So many uses!

    Pretty sure that busybox is a key component in the wonderful Raydon firmware upgrade for the Humax FoxSat satellite receiver that I will big up here at every opportunity. Full on web server for admin and channel listings, FTP server, utilities all crammed into that little ROM. Mind you, the end result is a film collection currently around the 6,500 mark spanning 32Tb of storage - you have been warned.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like