I have made some modifications to the busybox dpkg.c and dpkg-deb.c , this is based on the Debian busybox source version 1:1.22.0-9
For dpkg.c ,
- to run preinst install and postinst configure, instead of preinst and postinst without parameters. This is because the packages scripts may fail if called without any parameters. This would at least support the most basic scenario which is to install a new package.
- if postinst configure fails, set the package status to be half-configured, instead of aborting the installation without any status.
For dpkg-deb.c ,
- add dpkg-deb -R option , which extracts packages filesystem tree to directory and the control information files into a DEBIAN subdirectory.
Further, I use a shell script, dpkg to add the following dpkg options:
- dpkg -L package-name , to list installed files for package-name.
- dpkg -s (or --status) package-name , to display status info of package-name.
- dpkg -S filename-search-pattern , to search for a filename from installed packages.
- a non-standard -D1 to turn on logging to /var/log/idpkg.log for the dpkg commands, and -D0 to turn off logging and remove the idpkg.log
The shell script should be placed at /usr/bin/dpkg , the dpkg default location, so that it can handle the additional options, and then it will simply call the busybox dpkg link at /bin/dpkg to handle the other options.
For this arrangement to work, the PATH env variable should list /usr/bin before /bin so that /usr/bin/dpkg should be executed when using dpkg without any path.