[Toybox] Toybox Installer/setup routine?

Denys Nykula nykula at ukr.net
Mon Sep 2 16:10:53 PDT 2019


> > which awk 2>&1 >/dev/null || ln -fsv nawk /bin/awk
> > which vi 2>&1 >/dev/null || ln -fsv vim /bin/vi
> 
> Those last two are on the todo list. But after toysh and route, which mkroot
> needs. (And vi might be after make, and promoting half the stuff currently in
> pending.)

Implementing sh and make would definitely be most useful, as nobody has yet
written light build tools ready to drop in place of GNU monopoly. The weakest
bootstrap link would next be a subset of cmake interpreter enough to build
LLVM. While existing awks and editors with simple license are okay.

> > Since I symlink `/sbin` to `bin` and `/usr` to `.`,
> 
> I go the other way with /usr (symlink the top level bin/sbin/lib into usr)
> because I don't want more debris (include, local, share...) at the top level.

Most do the classic usrmerge but hierarchies are my pet peeve, and the
reversal seems slightly less complex with fewer total links.

> > for i in head ifconfig route sed; do ln -fsv busybox /bin/$i; done
> 
> What do you need head, ifconfig or sed for? (What is the toybox version missing
> and/or getting wrong?)

Head with negative -n value is used in Linux kernel build for atomics checks,
it prints all except last few lines. Ifconfig and route didn't work against a
pizza place Wi-Fi for unknown reason, busybox was okay there. For sed
I have in my notes this line from some Portage script:

if ! sed -n -e '/^# Generated by .*libtool/q0;4q1' "${f}"; then continue; fi

Libtool is supposed to help with portability, but portability in GNU speak
means nothing builds unless you run GNU, and distro maintainers use some
tricks with even more GNU dependency to unbreak some of the problems
libtool creates.

There are also patch -f and find -newerXY but these are both tricky and
unimportant compared to bootstrap tools.

> As long as it doesn't dereference the symlink and stomp the binary at its end.
> (The bzip2 installer used to do that to busybox. THAT was a fun one to debug.
> And this is why the "install" command has different defaults than the "cp"
> command. :)

Portage seems careful with symlinks, but I have fun with each GCC install
silently removing llvm-libunwind and no obvious line to blame for this.



More information about the Toybox mailing list