| git.druid.rocks | index | druid520 | ports | ports/ | networking/ | toybox/ | pkg.conf |
ports/networking/toybox/pkg.conf
pkg_name="toybox"
pkg_license="0bsd"
pkg_ver="git"
pkg_deps=""
pkg_fetch="git:https://github.com/landley/toybox.git"
# NOT this system's own coreutils/shell provider -- sbase/ubase/mksh
# stay exactly that. this exists purely to fill real gaps neither of
# those cover: networking tools (ip/ifconfig/arp/route/telnet/tftpd/
# traceroute/dhcp and friends, none of which this system had anything
# for at all before), a real git client subset (gitclone/gitfetch/
# gitcheckout/gitinit/gitremote), and a handful of other genuinely
# missing utilities (vi, strace, lsof, crond/crontab) -- see
# miniconfig's own selection, a real, working defconfig with just
# these specific "pending" (off-by-default) applets additionally
# enabled and TOYBOX_ZHELP turned back off (see install:'s own
# comment for why).
#
# a real, substantial patch series was needed to get here -- see each
# patches/*.patch's own comment for the full reasoning on every one:
# one genuine bash-only construct, a handful of gnu-vs-this-tree's-own
# sbase coreutils cli differences, a real musl regcomp() branch-count
# limit that needed a build-script rewrite (not a libc change) to stay
# under, and a real dhcp-client bug (a udp checksum check that
# rejects genuine replies on a veth-pair/virtualized interface with
# checksum offload enabled) found and fixed by actually running this
# against a real dhcp server, repeatedly, through real clean reboots
# -- not just a clean build.
install:
cp ../miniconfig .config
# TOYBOX_ZHELP (compressing every command's own --help text into an
# embedded gzip blob, decompressed at runtime) depends on this
# system's own real "gzip" existing and being invoked correctly at
# BUILD time -- confirmed for real, something about that pipeline
# doesn't survive being run through mksh/this tree's own coreutils
# faithfully: every command's own "--help" failed at runtime with
# "not gzip" once built this way. turned back off in miniconfig
# itself (plain, uncompressed help text instead) sidesteps the
# whole pipeline rather than chasing which specific step in it
# disagrees with gnu's own -- a real size/build-complexity
# tradeoff, not a functional loss.
mksh scripts/genconfig.sh -d .config
mkdir -p generated/unstripped
# LDOPTIMIZE=" ": tcc has no equivalent to gnu ld's --gc-sections/
# --as-needed (its own real default here) -- "invalid linker option"
# outright. a non-empty placeholder, not empty: portability.sh's own
# ": ${LDOPTIMIZE:=default}" treats an empty string the same as
# unset, so an empty override gets silently replaced right back
# with the real gnu-only default instead of actually taking effect.
#
# NOSTRIP=1: skips straight to the script's own already-real,
# already-correct "cp $UNSTRIPPED $OUTNAME" fallback path instead
# of ever invoking a "strip" binary this system doesn't have yet
# (see networking/elftoolchain, if/when this system gets one) --
# NOT "STRIP=true" (tried first, wrong): that command is also
# responsible for the actual copy-to-final-name step, and "true"
# silently discards every argument, so the real toybox binary never
# actually lands at its own final "toybox" path at all.
HOSTCC=$CC CC=$CC LDOPTIMIZE=" " NOSTRIP=1 mksh scripts/make.sh
# --symlink: a real hardlink (this script's own default) can't
# cross a filesystem boundary the way MP_PREFIX sometimes needs to;
# a symlink always works, and is what mp's own tree already expects
# from every other multi-call-style tool. PREFIX=$MP_PREFIX/bin, not
# $MP_PREFIX itself: without --long, this script's own install
# convention drops every command name FLAT into whatever PREFIX it's
# given (confirmed for real: "/usr/ip", "/usr/ifconfig", not "/usr/
# bin/ip") -- this tree's own convention (and $PATH) expects
# $MP_PREFIX/bin.
PREFIX=$MP_PREFIX/bin HOSTCC=$CC mksh scripts/install.sh --symlink --force
remove:
# a plain no-op, not install.sh's own "--uninstall" -- that would
# need the full source re-fetched and .config regenerated all over
# again just to recompute which command names this build enabled,
# purely to remove them one at a time. toybox is NOT a self-
# referential critical tool the way sbase/tcc/mksh are (nothing
# else on this system depends on it existing), so mp's own default,
# real manifest-driven cleanup already deletes every one of these
# symlinks (plus the toybox binary itself) correctly on its own --
# this phase exists only because mp's own lint requires SOME real
# remove phase to be declared at all (see mp's own verify.pl).
true