[Toybox] mknod: -m not working without MKNOD_Z

Rob Landley rob at landley.net
Thu Mar 21 11:40:23 PDT 2019


On 3/21/19 10:16 AM, enh via Toybox wrote:
> i did notice the other day that not all of the security context stuff
> is compiled out, only some of it. is it actually worth the trouble of
> compiling it out?

When I started toybox I'd just left busybox, and micromanaging stuff to be small
was a thing that extensively did. The embedded libc du jour was uClibc which
could chop out all sorts of stuff from its build, so you couldn't be sure things
like regex support were there.

My opinion of that has gradually changed (micromanaging like that _is_ a form of
complexity), and these days I've been ripping config items out of toybox
commands, so "using the toybox version of this command" gives you consistent
behavior.

I've still got options in cat (historical reasons, the whole "cat -v considered
harmful" thing), cp --preserve, tail (seek mode), help -ah, netcat's server
options, and the truly sad password checking heuristics in passwd.

And really, none of them justify their existence. (There were _reasons_ for them
all, but... Yes I was argued into adding -v back to cat and didn't like it, but
as long as it's there... And the passwd heuristics just plain shouldn't BE
there, it should have some way to call out to a password validity checker and
NOT try to build in its own half-assed checks...)

The whole help text processing infrastucture was to splice together multiple
help entries based on what config was enabled, and if this can go that can go.
(Or at least be greatly simplified, I still need to _generate_ the header and
it's a heavy lift for sed. Might be doable though...)

That said, this bug was triggered by a global "do you want to build in selinux
support" and THAT's there because not all systems have that. I worry that a
toolchain won't have it when you cross compile to a small target where the build
has switched off xattr support, or on macos or bsd. Hmmm. It mostly has stub
functions in the headers to NOP this out, having a dead command line option when
the build environment can't do it isn't the end of the world. (Probably should
have an error message if you try though... Eh, throw it on the todo list...)

Oh, speaking of which, the probe for android:

  # Some commands are android-specific
  probesymbol TOYBOX_ON_ANDROID -c << EOF
    #ifndef __ANDROID__
    #error nope
    #endif

Is not triggering when I do:

LDFLAGS=--static
CROSS_COMPILE=~/android/android-ndk-r19b/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-
make distclean defconfig

Do I need to #include something to get that symbol, or is not in the NDK 19? My
menuconfig android menu's always empty because of that...

Rob



More information about the Toybox mailing list