aboutsummaryrefslogtreecommitdiff
path: root/applets
Commit message (Collapse)AuthorAgeFilesLines
* fix "warning array subscript has type 'char'"Gravatar Denys Vlasenko2021-04-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applets/usage_pod.c: placate gccGravatar Denys Vlasenko2021-02-151-1/+1
| | | | | | "error: format not a string literal and no format arguments" Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use fputs_stdoutGravatar Ron Yorston2021-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta fputs_stdout - 12 +12 zxc_vm_process 7237 7230 -7 yes_main 85 78 -7 write_block 380 373 -7 wrapf 305 298 -7 strings_main 437 430 -7 show_bridge 353 346 -7 rev_main 384 377 -7 put_prompt_custom 58 51 -7 put_cur_glyph_and_inc_cursor 168 161 -7 print_numbered_lines 152 145 -7 print_named_ascii 130 123 -7 print_name 135 128 -7 print_login_issue 386 379 -7 print_ascii 208 201 -7 powertop_main 1249 1242 -7 od_main 1789 1782 -7 logread_main 518 511 -7 head_main 804 797 -7 display_process_list 1319 1312 -7 cut_main 1002 995 -7 bb_dump_dump 1550 1543 -7 bb_ask_noecho 393 386 -7 baseNUM_main 702 695 -7 expand_main 755 745 -10 dumpleases_main 497 487 -10 write1 12 - -12 putcsi 37 23 -14 print_login_prompt 55 41 -14 paste_main 525 511 -14 cat_main 440 426 -14 print_it 245 230 -15 print_addrinfo 1188 1171 -17 print_rule 770 750 -20 print_linkinfo 842 822 -20 httpd_main 791 771 -20 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/34 up/down: 12/-341) Total: -329 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fixes for Hurd buildGravatar Denys Vlasenko2020-12-171-0/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: prevent duplicate applet namesGravatar Ron Yorston2018-11-271-1/+9
| | | | | | | | | | | | The embedded script feature makes it easier to create applets with duplicate names. Currently in such cases the build succeeds but the resulting executable doesn't work as the developer intended. Catch duplicate names when the applet tables are being generated and make the build fail. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Treat custom and applet scripts as appletsGravatar Ron Yorston2018-11-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* install.sh: don't clobber dangling symlinksGravatar Baruch Siach2018-07-311-1/+1
| | | | | | | | | | | | | | Symlinks in a subdirectory that is to become target rootfs are sometimes dangling because they link to canonical file names that are not present on the host, but are present relative to the target rootfs root. Don't copy over dangling symlinks when noclobber is enabled The -e test treats dangling symlinks as non-existent files. Add -h test that returns true for all symlinks. Cc: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applets/install: don't try to install nothingGravatar Yann E. MORIN2018-04-151-2/+4
| | | | | | | | | | | | | | | | | Commit 952d5a6024e7 (applets/install: accept more than one install option) changed the way we handle install options: before that commit, a missing install type would mean to install nothing; after, we would iterate over options, so we would never notice there was a mising option. Fix that by introducing an explicit --none option to specify to install nothing. Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: fix parallel building issueGravatar Michael Olbrich2018-04-141-2/+14
| | | | | | | | | | | | | | | | The files generated by the include/config/MARKER target are in the dependency list for applets/applet_tables. If applets/applet_tables is created first during applets_dir then it will be created again later as part of $(busybox-dirs). As a result include/applet_tables.h is created again. This time while other build commands may need it. Let applets_dir depend on include/config/MARKER to avoid this particular race condition and create the header files atomically to ensure that the compiler never sees incomplete files. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix install with hardlinks and a custom PREFIX. Closes 10801Gravatar Denys Vlasenko2018-02-231-9/+9
| | | | | | | | | | | | Trying to install busybox with hardlinks and a custom PREFIX will fail for applets not in the /bin directory, because relative pathnames are used. applets/install.sh is *supposed to* use the absolute pathname for hardlinks but it fails to do so because the wrong check is used in the if statement. While fixing it, shore up other sloppy coding in applets/install.sh Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applets/install: accept more than one install optionGravatar Yann E. MORIN2018-01-041-12/+16
| | | | | | | | Currently, it is impossible to pass more than one option to the isntall script, so it totally prevents using --noclobber. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applets/install: respect noclobber for script wrappers tooGravatar Yann E. MORIN2018-01-041-12/+8
| | | | | | | | Simplify the handling of --noclobber so that it applies to all types of installation types, even to script wrappers. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Automatically disable FEATURE_COMPRESS_USAGE for small builds.Gravatar Denys Vlasenko2017-01-061-0/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: always rewrite NUM_APPLETS.hGravatar Denys Vlasenko2016-08-231-10/+11
| | | | | | | Conditional rewrite can keep NUM_APPLETS.h mtime old, this causes make to try to regenerate it at every invocation. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: different fix for include/applet_tables.h/include/NUM_APPLETS.hGravatar Denys Vlasenko2016-08-211-3/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: fix include/NUM_APPLETS.h generationGravatar Denys Vlasenko2016-08-141-5/+2
| | | | | | TBH, it's more like "work around my bad makefile-fu" than "fix"... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: disentangle PREFER_APPLETS from SH_STANDALONE and SH_NOFORKGravatar Denys Vlasenko2016-07-221-1/+3
| | | | | | | | On user request. I thought enabling/disabling them all together is more consistent. Evidently, some people do want them to be separately selectable. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: fix a few warnings for allnoconfig buildGravatar Denys Vlasenko2016-07-051-0/+2
| | | | | | Not that allnoconfig build is useful in any way... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: finer-grained selection of search speedup table.Gravatar Denys Vlasenko2016-04-021-32/+33
| | | | | | | | | | | KNOWN_APPNAME_OFFSETS=8 versus KNOWN_APPNAME_OFFSETS=0: function old new delta find_applet_by_name 55 136 +81 applet_nameofs - 14 +14 run_applet_and_exit 757 758 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applet_tables: save space by removing applet name offsetsGravatar Ron Yorston2016-03-301-18/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The array applet_nameofs consumes two bytes per applet. It encodes nofork/noexec flags suid flags the offset of the applet name in the applet_name string Change the applet_table build tool to store the flags in two separate arrays (applet_flags and applet_suid). Replace applet_nameofs[] with a smaller version that only stores a limited number of offsets. This requires changes to the macros APPLET_IS_NOFORK, APPLET_IS_NOEXEC and APPLET_SUID. According to Valgrind the original find_applet_by_name required 353 cycles per call, averaged over all names. Adjusting the number of known offsets allows space to be traded off against execution time: KNOWN_OFFSETS cycles bytes (wrt KNOWN_OFFSETS = 0) 0 9057 - 2 4604 32 4 2407 75 8 1342 98 16 908 130 32 884 194 This patch uses KNOWN_OFFSETS = 8. v2: Remove some dead code from the applet_table tool; Treat the applet in the middle of the table as a special case. v3: Use the middle applet to adjust the start of the linear search as well as the last applet found. v4: Use an augmented linear search in find_applet_by_name. Drop the special treatment of the middle name from get_applet_name: most of the advantage now derives from the last stored value. v5: Don't store index in applet_nameofs, it can be calculated. v6: Tweaks by Denys function old new delta find_applet_by_name 25 125 +100 applet_suid - 92 +92 run_applet_no_and_exit 452 460 +8 run_applet_and_exit 695 697 +2 applet_name_compare 31 - -31 applet_nameofs 734 14 -720 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 3/1 up/down: 202/-751) Total: -549 bytes text data bss dec hex filename 925464 906 17160 943530 e65aa busybox_old 924915 906 17160 942981 e6385 busybox_unstripped Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Aboriginal linux/musl build fixesGravatar Denys Vlasenko2015-10-051-0/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applets: Add installation of individual binariesGravatar Clayton Shotwell2015-07-011-2/+24
| | | | | | | | Adding support to install individual binaries if the option is enabled. This also installs the shared libbusybox.so.* library. Signed-off-by: Clayton Shotwell <clshotwe@rockwellcollins.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* false: make "false --help" exit with 1Gravatar Denys Vlasenko2014-09-181-0/+17
| | | | | | | function old new delta run_applet_no_and_exit 447 445 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: use od -b instead of od -t x1Gravatar Denys Vlasenko2013-11-261-6/+6
| | | | | | od -t is not available in non-CONFIG_DESKTOPed busybox od Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: do not generate MAX_APPLET_NAME_LEN (unused)Gravatar Denys Vlasenko2013-11-261-5/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* buildsys: Add helper to list suid appletsGravatar Bernhard Reutner-Fischer2013-07-261-0/+54
| | | | | | | | | | | | | Add a helper script that lists all applets that - do or may require SUID provileges (busybox.cfg.suid) - do not require SUID provileges (busybox.cfg.nosuid) Some setups prefer to build two busybox binaries, one that is suid which contains all applets that do or may require suid privileges, and a second one for all the rest (which drops suid). To ease splitting these two binaries, generate a list of CONFIG_ items for the suid binary. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* style fixes, no code changesGravatar Denys Vlasenko2012-09-021-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix one-applet build for tcpsvdGravatar Denys Vlasenko2012-03-191-8/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applet_tables: fix single applet build failure. Closes 4009Gravatar Denys Vlasenko2011-09-161-1/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applets/install.sh: afer quoting of variablesGravatar Denys Vlasenko2011-04-051-35/+34
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix install.shGravatar Denys Vlasenko2011-04-041-6/+10
| | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* applet_tables: do not include libbb.h, that header ir for target buildsGravatar Denys Vlasenko2011-03-281-2/+8
| | | | | | ...and applets/applet_tables.c is built on *host*. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix bit rot in scripts/Makefile.IMA #2Gravatar Denys Vlasenko2011-03-061-0/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* .gitignore: add missing ignoresGravatar Bjørn Forsman2011-03-061-0/+1
| | | | | | | Ignore output files created by "make defconfig; make". Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix "make install"Gravatar Bernd Jendrissek2011-02-201-1/+1
| | | | | Signed-off-by: Bernd Jendrissek <bernd.jendrissek@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesGravatar Denys Vlasenko2011-02-031-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* simpler check for odGravatar Denys Vlasenko2010-09-161-1/+2
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* build system: test that od is present in the host systemGravatar Denys Vlasenko2010-09-161-0/+6
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* *: make GNU licensing statement forms more regularGravatar Denys Vlasenko2010-08-166-6/+6
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: fix "see file License ..." - the file is named LICENSE (in uppercase)Gravatar Denys Vlasenko2010-08-162-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make usage_compressed.h generation _always_ update mtimeGravatar Denys Vlasenko2010-07-081-5/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesGravatar Denys Vlasenko2010-07-051-2/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Yet another attempt to stamp out "make -j" problemsGravatar Denys Vlasenko2010-07-041-1/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: do not rebuild ash and hush on any change to any .c fileGravatar Denys Vlasenko2010-06-262-3/+23
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove defconfig. Now "make defconfig" simply uses defaults from Config.inGravatar Denys Vlasenko2010-06-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make it possible to have include/applets.h-esque entries in .c filesGravatar Denys Vlasenko2010-06-061-3/+3
| | | | | | As an example, bunzip2 and bzcat is changed to use it. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Remove requirement that include/applets.h must be sortedGravatar Denys Vlasenko2010-06-053-37/+75
| | | | | | | | First, I _again_ violated it - two xz-related applets are in wrong positions. Second, planned in-applet help text thing will be so much easier without this requirement... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mass renaming Kbuild -> Kbuild.src, Config.in -> Config.srcGravatar Denys Vlasenko2010-06-041-0/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: make it possible to build them individuallyGravatar Denys Vlasenko2010-03-231-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesGravatar Denys Vlasenko2010-01-251-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>