Somebody needs to go through all busybox default apps and respective GNU coreutils, findutils, diffutils, etc. packages and evaluate which apps would need patching.
I briefly considered doing a patch for that 1-2 years ago, but did not have energy for completing that.
I still have my notes about coreutils apps:
Default in busybox, but no conflict (in /bin)
cat chgrp chmod chown cp date dd echo kill ln ls mkdir mknod mktemp mv nice pwd rm rmdir sleep sync touch true uname
Default in busybox, conflict in /usr/bin:
basename cut dirname du env head id md5sum mkfifo readlink seq sort sha256sum tail tee test tr uniq uptime wc yes
Default in busybox, conflict in /usr/sbin:
No conflict or not default in busybox
base64 chcon cksum comm expand factor false fold groups hostid install link logname nl nohup nproc od paste printenv printf realpath runcon sha1sum sha224sum sha384sum sha512sum shred shuf split stat stty sum tac timeout tty unlink users truncate unexpand who whoami
COREUTILS_APPLETS := \
dir dircolorsexpr \
fmt join \
pathchk pinky pr ptx \
(That was just for coreutils. Findutils, diffutils, ... are in addition to that)
Possible long-term solutions are to
- patch busybox sources so that the bb apps are installed into /bin instead of /usr/*bin
Sources would need to be patched by app in style of changing bb definitions from BB_DIR_USR_BIN to BB_DIR_BIN for each app.
Below are example definitions grepped from bb sources, which show that this approach would require patching dozens of files in busybox sources, increasing the maintenance work at version upgrades:
coreutils/basename.c://applet:IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename))
selinux/chcon.c://applet:IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP))
coreutils/cksum.c://applet:IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum))
coreutils/comm.c://applet:IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP))
- other alternative would be to define ALTERNATIVES definitions for each app in both busybox and respective GNU utils Makefiles in Openwrt.
This approach might be easier in the long run.