landley / toybox

toybox
http://landley.net/toybox
BSD Zero Clause License
2.39k stars 334 forks source link

Some commands aren't listed on the website #168

Closed firasuke closed 2 years ago

firasuke commented 4 years ago

I've come across some commands like fmt (from the Other commands section) and sntp (from the Networking section) that are part of toybox but don't seem to be listed on the website (particularly the status page).

Is this behavior intended? Could there be other commands as well that are part of toybox but aren't listed on the website?

landley commented 4 years ago

It's because I hadn't updated roadmap.html yet, so I when I did a "make distclean defconfig toybox" and then ran "scripts/mkstatus.sh" in a clean checkup, it went:

Collecting data... Analyzing... all commands=319 uncategorized: ascii crc32 devmem fmt i2cdetect i2cdump i2cget i2cset mcookie prlimit sntp ulimit uuidgen dhcp6 ipaddr iplink iproute iprule iptunnel cd exit toysh bash -sh -toysh -bash traceroute6 implemented=204

The "uncategorized" means "could not find this command in the roadmap to put it in the appropriate section". If I run it against git master, it says:

Collecting data... Analyzing... all commands=343 barf readelf uncategorized: readelf getopt readelf -sh -toysh -bash implemented=205

Where the "barf" means "defconfig built something out of pending" which shouldn't happen and I need to fix it but I was halfway through cleaning it up so I could promote it, instead, until http://lists.landley.net/pipermail/toybox-landley.net/2020-February/011453.html happened and I deleted my cleanup work. I should switch it to defconfig n if I'm going to leave it in pending.

Anyway, most of those unlisted command should show up next release. It was because I hadn't categorized them in the roadmap yet. (New commands that aren't already in the roadmap generally go in "requests" at the end, I just haven't done the filing yet.)

firasuke commented 4 years ago

Fair enough, thanks for taking the time to reply.

I was wondering if you could provide an alternate categorization for current toybox commands based on what piece of software they're intended to replace. While I understand that the current categorization is sane enough, it's still somewhat confusing from a distribution-maintainer point of view.

In other words, it would be prettier (again from a distribution-maintainer perspective) if commands that replace coreutils are in one place, while those that replace util-linux are in another place (same goes for procps, e2fsprogs, iputils...).

landley commented 4 years ago

I haven't been developing them that way, but I can presumably look it up. To start with, running this on my devuan box:

for i in $(toybox); do X=$(dpkg-query -S $(PATH=/sbin:/usr/sbin:$PATH which $i) 2>/dev/null); [ -z "$X" ] && echo none $i || echo ${X/:*/} $i; done | sort -u | (X=""; while read a b; do [ "$a" != "$X" ] && echo -ne "\n$a:"; X="$a"; echo -n " $b"; done); echo

says:

binutils: strings bsdmainutils: cal bsdutils: logger renice bzip2: bunzip2 bzcat coreutils: arch base64 basename cat chgrp chmod chown chroot cksum comm cp cut date df dirname du echo env expand factor false fmt groups head id install link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od paste printenv printf pwd readlink realpath rm rmdir seq sha1sum shred sleep sort split stat sync tac tail tee test timeout true truncate tty uname uniq unlink wc who whoami yes cpio: cpio diffutils: cmp e2fsprogs: chattr lsattr eject: eject file: file findutils: find xargs grep: egrep fgrep grep gzip: gunzip zcat hostname: dnsdomainname hostname iputils-ping: ping ping6 kbd: chvt kmod: insmod lsmod modinfo rmmod libc-bin: getconf iconv login: login su mount: losetup mount swapoff swapon umount ncurses-bin: clear reset net-tools: ifconfig netstat none: acpi ascii catv count crc32 devmem dos2unix freeramdisk fstype fsync ftpget ftpput help hexedit i2cdetect i2cdump i2cget i2cset inotifyd iorenice iotop makedevs microcom mix nbd-client nc netcat oneit readahead setfattr sntp time touch tunctl ulimit unix2dos usleep uudecode uuencode uuidgen vconfig w which parted: partprobe passwd: passwd patch: patch pciutils: lspci procps: free kill pgrep pkill pmap ps pwdx sysctl top uptime vmstat watch psmisc: killall rfkill: rfkill sed: sed sysvinit-core: halt poweroff reboot sysvinit-utils: killall5 pidof tar: tar usbutils: lsusb util-linux: blkid blockdev chrt dmesg fallocate flock fsfreeze hwclock ionice mcookie mkswap mountpoint nsenter pivot_root prlimit rev setsid switch_root taskset unshare whois: mkpasswd xxd: xxd

Except A) the "none" category just says I don't have that package installed on the host (or something weird happened like the /usr/bin/touch symlink hiding coreutils having installed /bin/touch), 2) that doesn't tell you what a debian package does install that we don't.

But http://www.linuxfromscratch.org/lfs/downloads/9.0/LFS-BOOK-9.0-NOCHUNKS.html should have the list in chapter 6, and I could presumably go through that? (Bit of a slog and I'd have to redo it every year or so.)

firasuke commented 4 years ago

This looks much better in my opinion, but yes I have to agree that it highly depends on the distribution and what its packages provide.

I believe Linux From Scratch (LFS) is a sane option as it's somewhat related to the goals of toybox (being able to build Linux From Scratch using toybox) and it's personally what I'd consider as it's the closest to upstream in its current state.

enh-google commented 2 years ago

(status has been updated since the original report, and i don't think there's a plan to add the "which package?" information. i'm also not sure how helpful that would even be, since it doesn't tell you whether toybox completely replaces a package or not ... you'd still need to check command-by-command and even option-by-option, as we're doing for Android AOSP/kernel/NDK builds.)

landley commented 2 years ago

I added a package view to the roadmap: https://landley.net/toybox/roadmap.html#packages

I haven't updated it recently, and should probably remember to do so every time I do an OS version upgrade, but it's something...