aboutsummaryrefslogtreecommitdiff
path: root/scripts (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * hush: allow hush to run embedded scriptsRon Yorston2018-11-272-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Embedded scripts require a shell to be present in the BusyBox binary. Allow either ash or hush to be used for this purpose. If both are enabled ash takes precedence. The size of the binary is unchanged in the default configuration: both ash and hush are present but support for embedded scripts isn't compiled into hush. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Tweaks to build process for embedded scriptsRon Yorston2018-11-272-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Force a rebuild if a script in applets_sh is changed. - Move the dummy usage messages for custom applets to usage.h and change the name from 'dummy' to 'scripted'. - Hide an error from gen_build_files.sh if an embed directory exists but is empty. - Tidy up embedded_scripts script. v2: Remove a couple of unnecessary tests in embedded_scripts, as pointed out by Xabier Oneca. Drop the stripping of comments. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/trylink: be more clever when deciding that "lib elimination" has ↵Denys Vlasenko2018-11-191-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | finished: Before: Trying libraries: crypt m resolv Library crypt is not needed, excluding it Library m is needed, can't exclude it (yet) Library resolv is needed, can't exclude it (yet) Library m is needed, can't exclude it (yet) Library resolv is needed, can't exclude it (yet) Final link with: m resolv After: Trying libraries: crypt m resolv Library crypt is not needed, excluding it Library m is needed, can't exclude it (yet) Library resolv is needed, can't exclude it (yet) Final link with: m resolv Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Ensure build works when KBUILD_OUTPUT is set, closes 11511Ron Yorston2018-11-181-1/+1
| | | | | | | | | | | | | | | | The build process for embedded scripts didn't have consistent support for saving output to a different directory. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Treat custom and applet scripts as appletsRon Yorston2018-11-172-26/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * scripts/embedded_scripts: do not add superfluous NUL to script_names[]Denys Vlasenko2018-11-021-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: allow shell scripts to be embedded in the binaryDenys Vlasenko2018-11-011-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To assist in the deployment of shell scripts it may be convenient to embed them in the BusyBox binary. 'Embed scripts in the binary' takes any files in the directory 'embed', concatenates them with null separators, compresses them and embeds them in the binary. When scripts are embedded in the binary, scripts can be run as 'busybox SCRIPT [ARGS]' or by usual (sym)link mechanism. embed/nologin is provided as an example. function old new delta packed_scripts - 123 +123 unpack_scripts - 87 +87 ash_main 1103 1171 +68 run_applet_and_exit 78 128 +50 get_script_content - 32 +32 script_names - 10 +10 expmeta 663 659 -4 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 2/1 up/down: 370/-4) Total: 366 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox'Ron Yorston2018-07-252-17/+12
|\|
| * scripts/randomtest: disable CONFIG_NSLOOKUP for uclibcDenys Vlasenko2018-06-261-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/randomtest: disable CONFIG_FEATURE_INETD_RPC for glibcDenys Vlasenko2018-06-261-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/randomtest: disable CONFIG_FEATURE_MOUNT_NFS for glibcDenys Vlasenko2018-06-261-0/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Update release script to generate detached signatures and checksum filesEli Schwartz2018-06-091-17/+5
| | | | | | | | | | | | | | | | This is more usable for programmatically checking the validity of a release. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-04-092-1/+7
|\|
| * scripts/kconfig/mconf.c: survive is SIGWINCH is not definedDenys Vlasenko2018-04-061-0/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * placate gcc 8.0.1 sprintf overflow warnings in config toolsDenys Vlasenko2018-04-051-1/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-02-132-0/+3
|\|
| * scripts/randomtest: do not try building static libbysuboxDenys Vlasenko2017-12-311-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * randomconfig fixesDenys Vlasenko2017-12-311-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-09-271-2/+54
|\|
| * build system: fix a compiler warningDenys Vlasenko2017-09-071-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * build system: fix "allnoconfig" to clear all options. Closes 10296Denys Vlasenko2017-09-071-2/+52
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-08-222-1/+4
|\|
| * klibc-utils: new applets: resume, nuke, minipsDenys Vlasenko2017-08-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | minips is a pure alias to ps, just in case someone needs 100% klibc-utils compat. nuke is a primitive version of "rm -rf" without options and error checks. ~30 bytes. resume is a tool for initramfs which resumes from a given block device. function old new delta resume_main - 582 +582 packed_usage 31640 31712 +72 nuke_main - 28 +28 xstrtoull - 24 +24 applet_names 2646 2665 +19 applet_main 1532 1544 +12 applet_suid 96 97 +1 applet_install_loc 192 193 +1 applet_flags 96 97 +1 ------------------------------------------------------------------------------ (add/remove: 5/0 grow/shrink: 6/0 up/down: 740/0) Total: 740 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * do not use `a' quoting style in commentsDenys Vlasenko2017-08-021-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-241-0/+18
|\|
| * crond: do not assume setenv() does not leakDenys Vlasenko2017-07-221-0/+18
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-183-6/+44
|\|
| * build system: FEATURE_LIBBUSYBOX_STATIC - try to pull libc/libm into libbusyboxDenys Vlasenko2017-07-151-6/+12
| | | | | | | | | | | | It variously fails with different toolchains I tried... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fixes for bugs found by make_single_applets.shDenys Vlasenko2017-07-031-0/+26
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/randomtest: update things which can't be tested on uclibcDenys Vlasenko2017-07-031-0/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | kbuild: avoid warning when building with KBUILD_NO_NLSJohannes Schindelin2017-07-141-3/+3
| | | | | | | | | | | | | | The return values of bindtextdomain() and textdomain() are not actually used at all... Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | kbuild: simulate force-renaming on WindowsJohannes Schindelin2017-07-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling rename() when a file with the target name exists already fails on Windows. Let's simply delete the target file, if it exists. This is usually a dangerous thing as it leaves time between deleting and renaming, during which (theoretically) another thread or process could have created the same file, and the rename() would fail again. Practically, we are talking about the kbuild system used to configure the build, where it does not matter, as we do not expect any other thread or process to interfere with the configuration files. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | kbuild: support at least non-interactive mode on WindowsJohannes Schindelin2017-07-145-3/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | without POSIX, kbuild has some trouble compiling its support executables. Luckily, the parts that really lean on POSIX functionality are pretty much all only needed when configuring the build interactively. When compiling BusyBox for Win32, we do not actually need interactive configuration at all: we simply choose the default. Therefore, a lot of the stuff that is typically built for the Kconfig system is totally unnecessary (such as: compiling documentation via fork()&exec(), changing the window size, etc). Liberally put all of the problematic code behind #ifndef __MINGW32__ guards, just to get `make mingw64_defconfig` going in Git for Windows' SDK (which is a special-purpose version of MSYS2). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | fixdep: fix assumption that `long` is as large as `void *`Johannes Schindelin2017-07-144-33/+34
| | | | | | | | | | | | | | | | | | | | | | It is not. At least not in general. And in particular not on 64-bit Windows, where sizeof(long) == 4. What the code wanted to use is actually called intptr_t. Note: `intptr_t` is a C99 feature. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | fixdep: be careful about handling empty lines correctlyJohannes Schindelin2017-07-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code without this patch is seriously flawed, as it can easily overrun the buffer while looking for the *beginning* of the line. The symptom when trying to build without this patch in Git for Windows' SDK (which is a special-purpose version of MSYS2) is: $ make mingw64_defconfig && make -j15 HOSTCC scripts/basic/fixdep make[1]: *** [scripts/Makefile.host:104: scripts/basic/fixdep] Error 127 make: *** [Makefile:358: scripts_basic] Error 2 make: *** [Makefile:358: scripts_basic] Error 2 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | fixdep: read the dependency files in binary modeJohannes Schindelin2017-07-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to make sure that the original line endings are preserved, as fixdep hardcodes the assumption of Unix-type line endings. The symptom is this (kinda hard to understand) error when building in Git for Windows' SDK (which is a special-purpose version of MSYS2): $ make mingw64_defconfig && make -j15 HOSTCC scripts/basic/fixdep C:/git-sdk-64/mingw64/x86_64-w64-mingw32/include/ctype.h 64-w64-mingw32/include/ctype.h: Invalid argument fixdep: make[1]: *** [scripts/Makefile.host:104: scripts/basic/fixdep] Error 2 make: *** [Makefile:358: scripts_basic] Error 2 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-082-9/+9
|\|
| * remove "local" bashism from a few scriptsDenys Vlasenko2017-01-242-9/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-01-041-0/+1
|\|
| * randomconfig fixesDenys Vlasenko2016-12-121-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch busybox (up to "ash: comment out free(p) just before...")Ron Yorston2016-10-191-2/+2
|\|
| * trylink: use "mktemp tmp.XXXXXXXXXX" to placate OS XDenys Vlasenko2016-07-121-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-07-074-85/+53
|\|
| * build system: make CONFIG_FEATURE_USE_BSS_TAIL less funkyDenys Vlasenko2016-06-291-72/+28
| | | | | | | | | | | | | | | | | | | | CONFIG_FEATURE_USE_BSS_TAIL code was aliasing bb_common_bufsiz1 to _end. This is unreliable: _end may be not sufficiently aligned. Change code to simply enlarge COMMON_BUFSIZE when we detect that _end has significant amount of space to the end of page. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/trylink: libbusybox fixDenys Vlasenko2016-06-201-1/+1
| | | | | | | | | | | | gcc 6.1.1 can emit empty line with spaces Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * randomconfig fixes 2Denys Vlasenko2016-06-191-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * randomconfig fixesDenys Vlasenko2016-06-192-12/+22
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-05-162-0/+191
|\|
| * generate_BUFSIZ.sh: yet another tweakDenys Vlasenko2016-04-241-13/+41
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/trylink: document DATA_SEGMENT_ALIGN() hackDenys Vlasenko2016-04-221-0/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>