this post was submitted on 27 Jun 2024
35 points (78.7% liked)

Linux

8066 readers
63 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 1 year ago
MODERATORS
 

This is kind of a rant, but mostly a plea.

There are times when BusyBox is the only tool you can use. You've got some embedded device with 32k RAM or something; I get it. It's the right tool. But please, please, In begging you: don't use it just because you're lazy.

I find BusyBox used in places where it's not necessary. There's enough RAM, there's more than enough storage, and yet, it's got BusyBox.

BusyBox tooling is absolutely aenemic. Simple things, common things, like - oh, - capturing a regexp group from a simple match are practically impossible. But you can do this in bash; heck, it's built in! But BusyBox uses ash, which is barely a shell and certainly doesn't support regexp matching with group capture. Maybe awk? Well, gawk lets you, with -oP, but of course BusyBox doesn't use GNU awk, and so you can't get at the capture groups because it doesn't support perl REs. It'd be shocking if BusyBox provided any truly capable tools like ripgrep, in which this would be trivial. I haven't tried BB's sed yet, because sed's RE escaping is and has always been a bizarre nightmarish Frankenstein syntax, but I've got a dime riding on some restriction in BB's sed that prevents getting at capture groups there, too.

BusyBox serves a purpose; it is intentionally barely functional; size constraining trumps all other considerations. It achieves this well. My issue isn't with BusyBox, it's with people using it everywhere when they don't need to, making life hell for anyone who's trying to actually get any work done in it.

So please. For the sanity of your users: don't reach for BusyBox just because it's easy, or because you're tickled that you're going to save a megabyte or two; please spare a thought for your users on which you are inflicting these constraints. Use it when you have to, because otherwise it doesn't fit. Otherwise, chose a real shell, at least bash, and include some tools capable of more than less than the bare minimum.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 1 points 4 months ago (1 children)

I do get where they're coming from with Lua. With luci (the web interface), Lua must be installed as it's a requirement. However, it might be the stripped down version as well (AFAIK). Also, if you know bash & coreutils already, it might be counterproductive to have to learn something new.

I'm just glad that I could help. It's not fun to get stuck in such technical roadblock.

[โ€“] [email protected] 2 points 4 months ago

Yup!

On the OpenWRT issue, I ended up hacking a solution up in Lua, which won't help the next time I encounter an issue with a limited BB in something that isn't OpenWRT. And, in a month I won't remember the tiny bit of Lua I learned, because this is the first and probably last time I'll be forced to use it.

Nothing against Lua, per se; I'd just prefer to keep working with ubiquitous standards for simple stuff, and use strongly typed compiled languages for anything nontrivial.