[Bug 9786] [RFC] patch, ash: look for internal applets as last resource to find and execute a command
bugzilla at busybox.net
bugzilla at busybox.net
Thu Mar 30 14:16:20 UTC 2017
https://bugs.busybox.net/show_bug.cgi?id=9786
--- Comment #2 from Jordi Pujol <jordipujolp at gmail.com> ---
I include a new version of this modification, Now the ash shell works properly
as desired,
I have tested several commands: from the most common to complex ones like find,
which, xargs.
***************************************
~ $ PATH=/usr/local/bin:/usr/bin:/bin
~ $ # executing which command from filesystem
~ $ which -a uuencode df sleep
/usr/bin/uuencode
/bin/df
/bin/sleep
~ $ PATH=%applet:/usr/local/bin:/usr/bin:/bin
~ $ which -a uuencode df sleep
uuencode
/usr/bin/uuencode
df
/bin/df
sleep
/bin/sleep
***************************************
It also boots the system correctly using Debian initramfs, only two links to
/bin/busybox are needed to mount /proc, they are mkdir and mount. For this I
have modified /usr/share/initramfs-tools/hooks/zz-busybox script, included in
this message.
Another interesting script, also included. At the beginning of the process, it
sets PATH=%applet:$PATH so that busybox prefers the applets, uses only Busybox
commands and runs on a system that is in shutdown process, unmounting the
disks. Synchronizes data in memory with the disk and mounts the data partitions
in read-only mode.
In short, a single modified Busybox program satisfies two different needs,
first need is create and execute a simpler initramfs and second to execute a
script that prefers the applets before than other commands in the PATH.
Is it worth improving the development of this alternative?
Comments are welcome.
Note:
Debian repository. Have stored the corresponding packages in:
deb [arch=amd64,i386] http://livenet.ddns.net/ftp/debian/ sid main
deb-src http://livenet.ddns.net/ftp/debian/ sid main
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list