aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * testsuite/tree.tests: fix false positive failureDenys Vlasenko2023-01-021-18/+20
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: fix use of non-initialized dataDenys Vlasenko2023-01-021-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xargs: implement -o, closes 15146Denys Vlasenko2022-12-221-34/+51
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta .rodata 105225 105259 +34 d6_listen_socket 150 180 +30 packed_usage 34512 34532 +20 d6_read_interface 595 581 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 84/-14) Total: 70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: fix binding to network aliasesDenys Vlasenko2022-12-151-4/+9
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcp: add a few comments, no code changesDenys Vlasenko2022-12-152-0/+11
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: use a different default config scriptDenys Vlasenko2022-12-152-3/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: align FF02__1_2[]Denys Vlasenko2022-12-153-5/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * more: accept and ignore -eNatanael Copa2022-12-141-1/+2
| | | | | | | | | | | | | | | | Accept and ignore -e which is specified in POSIX. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/more.html Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: add some commentsDenys Vlasenko2022-12-142-12/+39
| | | | | | | | | | | | RFCs for DHCPv6 are written rather badly... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: remove stray commentDenys Vlasenko2022-12-131-1/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: shrink del_loop()Denys Vlasenko2022-12-131-1/+1
| | | | | | | | | | | | | | function old new delta del_loop 52 49 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * loop: restore the correct return vaule of set_loop()Denys Vlasenko2022-12-131-4/+8
| | | | | | | | | | | | It is only used by mount's error path, though... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * loop: optionally use ioctl(LOOP_CONFIGURE) to set up loopdevsDenys Vlasenko2022-12-132-9/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOOP_CONFIGURE is added to Linux 5.8 function old new delta NO_LOOP_CONFIGURE (old code): set_loop 784 782 -2 LOOP_CONFIGURE: set_loop 784 653 -131 TRY_LOOP_CONFIGURE: set_loop 784 811 +27 Based on a patch by Xiaoming Ni <nixiaoming@huawei.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * testsuite/mount.tests: accomodate umount failure seen on 5.18.0Denys Vlasenko2022-12-131-1/+13
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * loop: refactor: extract subfunction set_loopdev_params()Xiaoming Ni2022-12-131-39/+51
| | | | | | | | | | | | | | | | | | | | Extract subfunction set_loop_info() from set_loop() function old new delta set_loop 760 784 +24 Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * loop: simplify code of LOOP_SET_FD failureXiaoming Ni2022-12-121-7/+3
| | | | | | | | | | | | | | | | function old new delta set_loop 790 760 -30 Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * loop: refactor: extract subfunction get_next_free_loop()Xiaoming Ni2022-12-121-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Extract subfunction get_next_free_loop() from set_loop() Also fix miss free(try) when stat(try) and mknod fail function old new delta set_loop 807 790 -17 Fixes: 3448914e8cc5 ("mount,losetup: use /dev/loop-control is it exists") Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: fix typo in trivial usageBrandon Maier2022-12-081-1/+1
| | | | | | | | | | Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unzip -l: add missed big-endian conversions date and timePeter Kaestle2022-11-291-0/+2
| | | | | | | | | | | | | | | | When calling unzip -l the date and time output was missing big-endian conversions. Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Remove "select PLATFORM_LINUX"Denys Vlasenko2022-11-2954-70/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Fix non-Linux buildsSamuel Thibault2022-11-2956-3/+89
| | | | | | | | | | | | | | | | | | | | | | Various tools are Linuxish and should thus only attempted to build on Linux only. Some features are also Linux-only. Also, libresolv is used on all GNU platforms, notably GNU/Hurd and GNU/kfreeBSD. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fbset: support setting pixel clock rateDario Binacchi2022-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | Only in case the FEATURE_FBSET_FANCY configuration is enabled. function old new delta fbset_main 733 766 +33 Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fbset: abort on not handled optionsDario Binacchi2022-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all options are actually implemented. In this case, return a message and an error code to make it clear that the requested command has not been executed. function old new delta .rodata 105200 105224 +24 fbset_main 747 733 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 24/-14) Total: 10 bytes Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * loop: fix a race when a free loop device is snatchedXiaoming Ni2022-11-151-1/+10
| | | | | | | | | | | | | | | | | | | | | | When /dev/loop-control exists and *device is empty, the mount may fail if a concurrent mount is running. function old new delta set_loop 809 807 -2 Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * pkill: add -e to display the name and PID of the process being killedLouis Sautier2022-10-141-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This mimics the behaviour of pkill -e / --echo from procps. function old new delta .rodata 105179 105200 +21 packed_usage 34523 34516 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 21/-7) Total: 14 bytes Signed-off-by: Louis Sautier <sautier.louis@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: revised implementation of setlinebuf(3)Ron Yorston2022-12-311-1/+1
| | | | | | | | | | | | | | | | | | Microsoft Windows' setvbuf() doesn't support line buffering and doesn't accept 0 as a valid value for the buffer size argument. Replace the old macro definition with an implementation that doesn't do anything. It's only used if debug is enabled in ash so there's no effect on the default build.
* | libbb: speed up bb_get_chunk_from_file()Ron Yorston2022-12-301-0/+9
| | | | | | | | | | | | | | | | Use _getc_nolock() in bb_get_chunk_from_file() and perform code page translation on the resulting string. This speeds up grep by another factor of two. (GitHub issue #278)
* | win32: speed up getc(3) wrapperRon Yorston2022-12-301-2/+2
| | | | | | | | | | | | | | | | The grep applet was found to be rather slow. A major reason for this is the implementation of getc(3). Using _getc_nolock() and inlining is_console_in() speeds things up by a factor of three. (GitHub issue #278)
* | win32: always allow d_type member of struct direntRon Yorston2022-12-222-4/+0
| | | | | | | | | | | | | | | | The d_type member of struct dirent is required by the implementation of glob(3). As a result it isn't possible to build the make applet unless FEATURE_EXTRA_FILE_DATA is configured. Allow d_type unconditionally.
* | win32: prevent stat(2) from updating access timesRon Yorston2022-12-221-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WIN32 implementation of stat(2) reads the contents of some files to see if they're executable. This may update the file access time. Avoid this by a special call to SetFileTime() after opening the file. For details see: https://devblogs.microsoft.com/oldnewthing/20111010-00/?p=9433 https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfiletime File access times aren't updated by default in recent versions of Windows. This commit is only necessary if updating of file access times is explicitly enabled: fsutil behavior set DisableLastAccess 0
* | make: fixes to test scriptRon Yorston2022-12-121-0/+3
| | | | | | | | | | | | | | | | Unset MAKEFLAGS in the test script so it works if it's run using a version of make that has options which pdpmake doesn't understand. Return $FAILCOUNT as the exit status so the number of failures can be reported.
* | getopt: use name supplied with '-n' to report errorRon Yorston2022-11-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows: $ getopt -o a -n my_script -- -z getopt: unknown option -- z On Linux: $ getopt -o a -n my_script -- -z my_script: unknown option -- z The difference arises because the Mingw-w64 implementation of getopt(3) uses __argv[0] to report errors, not the first element of the argument array passed to it. Make __argv[0] point to the name supplied with the '-n' option to match behaviour when glibc getopt(3) is used. (GitHub issue #274)
* | make: add '-x' option to set pragmasRon Yorston2022-11-211-50/+92
| | | | | | | | | | | | Add a command line option to allow pragmas to be set. This is an alternative to the use of the .PRAGMA special target. The same pragmas are supported.
* | make: add .PRAGMA special targetRon Yorston2022-11-181-38/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the special target .PRAGMA. This allows certain features of the POSIX standard to be disabled when POSIX mode is being enforced. This is done by setting prerequisites of .PRAGMA, as follows: - macro names containing '-' are permitted with the 'macro_name' prerequisite; - target names containing '-' or '/' are permitted with the 'target_name' prerequisite; - the '#' character isn't treated as the start of a comment in a command line with the 'command_comment' prerequisite; - an empty suffix is permitted in a macro expansion of the form $(VAR:=.c) with the 'empty_suffix' prerequisite. Additionally the 'posix_202x' prerequisite enforces the future POSIX standard instead of the current one. In this case the 'macro_name' and 'target_name' pragmas aren't required as the future standard will allow the additional characters. .PRAGMA without any prerequisites restores the default behaviour.
* | build system: allow monochrome 'make menuconfig'Ron Yorston2022-11-161-0/+3
| | | | | | | | | | | | | | | | | | 'make menuconfig' uses a hardcoded colour palette which may be difficult to read. Add support for the 'COLORS' environment variable. Setting this to '0' will cause 'make menuconfig' to be displayed in black and white. (GitHub issue #273)
* | make: changes to suffix substitution in macro expansionRon Yorston2022-11-162-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The POSIX standard defines suffix substitution in macro expansion as taking the form: $(string1 [: subst1 =[ subst2 ]]) Since 'subst1' isn't bracketed a value must be supplied. Enforce this in POSIX mode. As a non-POSIX extension an empty 'subst1' is permitted with 'subst2' being added to all words unconditionally. If both 'subst1' and 'subst2' are empty the words are returned unchanged.
* | make: show location of errors during buildRon Yorston2022-11-161-15/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error messages only displayed the location of an error while the makefile was being parsed. Store the location (makefile name and line number) of each command line. This allows location information to be displayed in errors encountered while targets are being built. Take this Makefile, for example: target: @echo $(hello Previously this would display: make: unterminated variable '$(hello' Now it shows: make: (Makefile:2): unterminated variable '$(hello'
* | make: fix typo in help textRon Yorston2022-11-141-2/+2
| |
* | win32: native make menuconfig: support searchAvi Halachmi (:avih)2022-11-131-5/+21
| | | | | | | | | | | | | | Previously, pressing slash to search at the menu aborted the menu program ('mconf'), because regexp is not available with native mingw. Now it works, but the search is of plain string rather than regexp.
* | make: use correct test for valid macro nameRon Yorston2022-11-132-1/+14
| | | | | | | | | | The test for valid macro names in POSIX mode was incorrect: it shouldn't have allowed '-'.
* | make: pdpmake needs long filename support in ar tooRon Yorston2022-11-131-1/+1
| | | | | | | | | | | | Commit f261d2d27 (make: make + sh configuration) added a 'pdpmake' alias for 'make'. It omitted to reference PDPMAKE as a dependency for FEATURE_AR_LONG_FILENAMES.
* | build system: try harder to detect w64devkitRon Yorston2022-11-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to build the supplied PDCurses code when using w64devkit. This was being detected by checking for the W64DEVKIT environment variable, but this is only defined if w64devkit is started via w64devkit.exe. Set W64DEVKIT ourselves if HOSTCC targets the mingw32 platform. This won't be the case when cross-compiling on Linux but will for w64devkit and MSYS2 MINGW32/64. The build won't work properly for MSYS2 MINGW32/64, but it doesn't work when using the supplied curses library either. 'make menuconfig' requires the use of MSYS2 MSYS, and HOSTCC there targets msys.
* | make: make + sh configurationRon Yorston2022-11-105-1/+2456
| | | | | | | | | | | | Add a configuration that just includes make and a shell. Add 'pdpmake' as an alias for 'make'.
* | Update README.mdRon Yorston2022-11-091-7/+3
| | | | | | | | Microsoft Windows build now uses w64devkit.
* | build system: silence compiler warningFRP-4784-g5507c8744Ron Yorston2022-11-081-0/+1
| | | | | | | | | | | | The compiler in MSYS2 warns that strcasecmp(3) isn't declared in scripts/kconfig/lxdialog/checklist.c. Add the appropriate include to silence this warning.
* | win32: fix ESC/CR handling in 'make menuconfig'Ron Yorston2022-11-071-1/+1
| | | | | | | | | | | | | | The WIN32 code in the 'mconf' build program should truncate the exit status from dialogs as if it were passed through WEXITSTATUS. The text dialog, for example, returns a status of -1 when ESC or CR is pressed. 'mconf' expects to see this as 255.
* | Provide PDCurses source for w64devkit buildRon Yorston2022-11-0740-0/+10615
| | | | | | | | | | | | w64devkit doesn't ship a curses library. Provide a cut-down copy of PDCurses which is sufficient to allow 'make menuconfig' to work in w64devkit.
* | win32: allow 'make menuconfig' in native buildsRon Yorston2022-11-071-6/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'make menuconfig' is a build option to allow changes to be made to the BusyBox configuration. It's a bit friendlier than using a text editor on the .config file. Previously 'menuconfig' was only available when cross-compiling on a Linux/Unix platform. The 'mconf' build program has been ported to WIN32 so it's now able to run the 'lxdialog' program which displays the configuration dialogs. Building 'lxdialog' is somewhat awkward in MSYS2. The MINGW32/64 build environments generate WIN32 executables for 'lxdialog'. These doesn't work properly in the MSYS2 console. For 'menuconfig' to work it's necessary to run it in an MSYS build environment. This generates an MSYS binary which works in the MSYS2 console. busybox-w32 should then be built in a MINGW32/64 build environment. Doing so will generate additional copies of the build programs without a '.exe' suffix: the MSYS build environment adds '.exe' to binaries it builds. This breaks 'menuconfig'. To configure an MSYS build environment use: pacman -S gcc ncurses-devel
* | make: fix typo in inference rule handlingRon Yorston2022-11-042-24/+25
| | | | | | | | | | | | | | A typo in the previous commit caused dyndep() to process inference rules incorrectly. This didn't affect the results of the test suite when extensions were allowed but it caused the test 'Inference rule with explicit rule for prerequisite' to fail in POSIX mode.
* | make: fixes to inference rulesRon Yorston2022-11-032-18/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect report 875 clarifies some aspects of inference rules. The crux of the issue is related to chained inference rules so it doesn't affect POSIX mode. The test makefile looks like this: .SUFFIXES: .a .b .c .a.c: @echo .a.c .b.c: @echo .b.c test.c: test.b test.a: test.b: The correct output is deemed to be '.a.c'. Additional complications are: - whether or not the prerequisite files are present; - the use of the suffixes '.a' and '.c' may result in the builtin inference rule '.c.a' being considered. In favourable circumstances pdpmake managed to give the correct result, in unfavourable it reported circular dependencies or segfaulted. Changes to fix these issues are: - When prerequisites are being recursively built the standard says: 'Upon recursion, each prerequisite shall become a target itself.' Follow this requirement. - At the end of make() the target being built should have its time (as represented by n_tim in struct name) updated when any action has been taken. - When dyndep() is looking for prerequisites it should: * skip candidates that are in the process of being built; * consider whether an explicit candidate is a target, not whether it has any commands associated with it. pdpmake now behaves similarly to GNU make when presented with makefiles like the above. bmake gives the incorrect output '.b.c'.