ndk-busybox/util-linux
Ron Yorston 3778898f97 Treat custom and applet scripts as applets
BusyBox has support for embedded shell scripts.  Two types can be
distinguished:  custom scripts and scripts implementing applets.

Custom scripts should be placed in the 'embed' directory at build
time.  They are given a default applet configuration and appear
as applets to the user but no further configuration is possible.

Applet scripts are integrated with the BusyBox build system and
are intended to be used to ship standard applets that just happen
to be implemented as scripts.  They can be configured at build time
and appear just like native applets.

Such scripts should be placed in the 'applets_sh' directory.  A stub
C program should be written to provide the usual applet configuration
details and placed in a suitable subsystem directory.  It may be
helpful to have a configuration option to enable any dependencies the
script requires:  see the 'nologin' applet for an example.

function                                             old     new   delta
scripted_main                                          -      41     +41
applet_names                                        2773    2781      +8
applet_main                                         1600    1604      +4
i2cdetect_main                                       672     674      +2
applet_suid                                          100     101      +1
applet_install_loc                                   200     201      +1
applet_flags                                         100     101      +1
packed_usage                                       33180   33179      -1
tryexec                                              159     152      -7
evalcommand                                         1661    1653      -8
script_names                                           9       -      -9
packed_scripts                                       123     114      -9
complete_cmd_dir_file                                826     811     -15
shellexec                                            271     254     -17
find_command                                        1007     990     -17
busybox_main                                         642     624     -18
run_applet_and_exit                                  100      78     -22
find_script_by_name                                   51       -     -51
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 6/9 up/down: 58/-174)          Total: -116 bytes
   text	   data	    bss	    dec	    hex	filename
 950034	    477	   7296	 957807	  e9d6f	busybox_old
 949918	    477	   7296	 957691	  e9cfb	busybox_unstripped

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2018-11-17 21:16:33 +01:00
..
volume_id restore documentation on the build config language 2018-06-06 15:16:48 +02:00
acpid.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
blkdiscard.c blkdiscard: Only build on Linux 2017-10-30 14:55:01 +01:00
blkid.c blkid: make it NOEXEC, make FEATURE_BLKID_TYPE=y default 2017-08-06 20:16:28 +02:00
blockdev.c blockdev, fsfreeze, fstrim, mountpoint: make NOEXEC 2017-08-05 01:29:12 +02:00
cal.c cal: make it NOEXEC 2018-01-14 14:32:11 +01:00
chrt.c chrt: code shrink 2018-01-25 09:34:23 +01:00
Config.src restore documentation on the build config language 2018-06-06 15:16:48 +02:00
dmesg.c config: deindent all help texts 2017-07-21 09:50:55 +02:00
eject.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
fallocate.c regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00
fatattr.c fatattr: make NOEXEC 2017-08-07 22:21:54 +02:00
fbset.c config: deindent all help texts 2017-07-21 09:50:55 +02:00
fdformat.c whitespace and comment format fixes, no code changes 2017-10-05 15:33:28 +02:00
fdisk_aix.c *: make GNU licensing statement forms more regular 2010-08-16 20:14:46 +02:00
fdisk_gpt.c unzip: use printable_string() for printing filenames 2018-09-30 16:56:56 +02:00
fdisk_osf.c Fix build failures if MAXHOSTNAMELEN or MAXPATHLEN is not defined 2017-10-31 15:59:19 +01:00
fdisk_sgi.c fdisk: sync up with some util-linux 2.31 behavior 2018-07-25 13:52:30 +02:00
fdisk_sun.c fdisk: sync up with some util-linux 2.31 behavior 2018-07-25 13:52:30 +02:00
fdisk.c fdisk: code shrink 2018-07-25 14:42:53 +02:00
findfs.c config: trim/improve item names and help texts, take 2 2017-07-27 10:53:09 +02:00
flock.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
freeramdisk.c freeramdisk: make NOEXEC 2017-08-07 23:17:14 +02:00
fsck_minix.c fsck_minix,mkfs_minix: fix "strict-aliasing" warnings 2017-08-16 11:53:48 +02:00
fsfreeze.c regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00
fstrim.c fstrim: do not check that specified file is on a block device 2018-03-29 16:05:10 +02:00
getopt.c whitespace and comment format fixes, no code changes 2017-10-05 14:40:24 +02:00
hexdump_xxd.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
hexdump.c config: deindent all help texts 2017-07-21 09:50:55 +02:00
hwclock.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
ionice.c make 17 state-changing execing applets (ex: "nice PROG ARGS") noexec 2017-08-04 19:55:01 +02:00
ipcrm.c ipcrm,ipcs: make them NOEXEC 2017-08-09 19:24:19 +02:00
ipcs.c ipcs: further code shrink 2018-03-08 13:23:06 +01:00
Kbuild.src Convert all util-linux/* applets to "new style" applet definitions 2016-11-23 11:46:32 +01:00
last_fancy.c Sort some miscutils/ applets into coreutils or util-linux 2017-04-12 13:58:40 +02:00
last.c config: deindent all help texts 2017-07-21 09:50:55 +02:00
losetup.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
lspci.c lspci,lsscsi,lsusb: make them NOEXEC 2017-08-05 23:28:19 +02:00
lsusb.c lspci,lsscsi,lsusb: make them NOEXEC 2017-08-05 23:28:19 +02:00
mdev.c regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00
mesg.c regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00
minix.h more bionic fixes 2016-03-14 19:34:15 +01:00
mkfs_ext2_test.sh fix more instances of ": $((a++))" in shell scripts 2017-07-15 19:20:45 +02:00
mkfs_ext2.c move storage helpers to libbb.h 2018-09-28 15:13:04 +02:00
mkfs_ext2.txt mkfs_ext2: use compatible inode sizes; add -I <inodesize>. (by Vladimir) 2009-10-22 12:12:17 +02:00
mkfs_minix.c fsck_minix,mkfs_minix: fix "strict-aliasing" warnings 2017-08-16 11:53:48 +02:00
mkfs_reiser.c move storage helpers to libbb.h 2018-09-28 15:13:04 +02:00
mkfs_vfat.c move storage helpers to libbb.h 2018-09-28 15:13:04 +02:00
mkswap.c whitespace and comment format fixes, no code changes 2017-10-05 15:33:28 +02:00
more.c config: deindent all help texts 2017-07-21 09:50:55 +02:00
mount.c inetd,mount: add comment with example of flags to build with libtirpc 2018-02-13 18:20:28 +01:00
mountpoint.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
nologin.c Treat custom and applet scripts as applets 2018-11-17 21:16:33 +01:00
nsenter.c nsenter: fix parsing of -t, -S and -G options 2018-05-13 20:14:07 +02:00
pivot_root.c pivot_root: make it NOFORK 2017-08-05 01:51:12 +02:00
rdate.c libbb: new option FEATURE_ETC_SERVICES: if off, /etc/services reads often avoided 2018-04-17 12:43:54 +02:00
rdev.c regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00
readprofile.c readprofile: code shrink 2018-03-11 19:35:58 +01:00
renice.c libbb.h: always include sys/resource.h 2018-04-08 17:23:27 +02:00
rev.c config: deindent all help texts 2017-07-21 09:50:55 +02:00
rtcwake.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
script.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
scriptreplay.c script: make -t independent of scriptreplay 2017-08-07 01:53:17 +02:00
setarch.c make 17 state-changing execing applets (ex: "nice PROG ARGS") noexec 2017-08-04 19:55:01 +02:00
setpriv.c setpriv: placete "declaration of 'index' shadows a global declaration" warning 2017-08-29 15:34:38 +02:00
setsid.c getopt32: remove opt_complementary 2017-08-08 21:55:02 +02:00
swaponoff.c swapon: do not use FEATURE_MOUNT_LABEL, have your own FEATURE_SWAPONOFF_LABEL 2017-07-27 10:58:08 +02:00
switch_root.c libbb: compile capability code only if FEATURE_SETPRIV_CAPABILITIES or RUN_INIT 2018-02-21 20:13:39 +01:00
taskset.c regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00
uevent.c uevent: placate gcc 2017-08-16 11:45:09 +02:00
umount.c umount: fix "umount -t FSTYPE MNTPOINT" acting as if -a is specified 2018-02-20 17:58:19 +01:00
unshare.c whitespace fixes 2018-07-17 15:04:17 +02:00
wall.c regularize format of source file headers, no code changes 2017-09-18 16:28:43 +02:00