Commit Graph

556 Commits

Author SHA1 Message Date
Stephen Heumann 16cd3c0619 Merge with BusyBox 1.24.0.
There's really only one bug fix in here that should be significant for GNO hush. The other changes should be inconsequential, AFAIK.
2015-10-17 01:10:35 -05:00
Denys Vlasenko 7ab00a0de9 Bump version to 1.24.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-12 14:33:03 +02:00
Maninder Singh 97c6491b4e typo fixes
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-05-25 13:46:36 +02:00
Bartosz Golaszewski 6c19d35f68 Makefile: fix cscope target
This target doesn't work with current directory layout. Just make cscope
index all .c and .h files.

While we're at it: add cscope output files to .gitignore.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-12-31 21:29:05 +01:00
Stephen Heumann 88869883b0 Update makefile, adding in functionality that was in extra scripts 2014-12-27 11:33:31 -06:00
Denys Vlasenko b9965077e5 Start 1.24.0 development cycle
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-12-24 02:06:02 +01:00
Denys Vlasenko 6968e08123 Bump version to 1.23.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-12-24 01:48:20 +01:00
Stephen Heumann e96ed4b46a Update the makefile for building on modern *nix systems. Rename to "Makefile" so we can build with just "make."
Also remove an unused variable that clang was warning about.
2014-12-15 16:47:12 -06:00
Stephen Heumann 12d172a1d9 GNO Makefile updates
1) Rename to Makefile.mk
2) Use *.o rather than *.a for object files
3) Reduce stack size to 4096 (may reduce further later)
2014-12-15 16:35:34 -06:00
Stephen Heumann fb9b298ca4 Implement "close-on-exec" functionality for GNO.
We do this by maintaining a mask (for each pid) giving the fds to be closed on exec. We wrap functions that close fds so that their close-on-exec bits can be cleared at that point.

This implementation may close the fds even if the execve operation ultimately fails.
2014-12-03 21:04:46 -06:00
Stephen Heumann 8cdae3cd7a Add our own version of qsort, because the one from ORCA/C is recursive and can use thousands of KB of stack space.
The new version is a heap sort implementation adapted from musl libc.
2014-12-03 10:49:24 -06:00
Stephen Heumann 3e7c0d0ace Add our own version of execve for GNO, which can quote arguments and can remove variables from the environment if needed.
Our versions of the execv* functions have been moved to their own file. They are now used for all the exec* calls in hush.
2014-11-22 16:53:59 -06:00
Stephen Heumann 5c972aa397 Fix our handling of process groups for job control, working around a couple GNO bugs.
*Most significantly, we avoid using setpgid(), because it doesn't work and in fact corrupts the kernel's process group table.
*Also, work around tctpgrp() returning garbage instead of 0 on success.

This adds an implementation of tcsetpgrp that works by reading the process tables to find a process in the appropriate group. This isn't used for the main job control operations, though, since it might be relatively slow.

At this point, basic job control seems to work.
2014-11-21 23:05:38 -06:00
Stephen Heumann 95bcfc3b6e Remove libbb/copyfd.c and an unused function that was its only caller. 2014-11-20 20:00:21 -06:00
Stephen Heumann 60b6415214 Add our own implementation of fnmatch (taken from NetBSD), because the one in GNO 2.0.6's libc is broken.
The version in libc both matches things it shouldn't and doesn't match things it should, in (at least) cases where a pattern includes additional stuff beyond a *.
2014-11-18 20:51:04 -06:00
Stephen Heumann 5f6121c091 Add initial support for getting terminal information from termcap, instead of hard-coding vt100-style codes.
This currently only supports output, and still doesn't quite display correctly in some cases.
2014-11-11 20:58:06 -06:00
Stephen Heumann c8de71ae9d Changes so that hush can successfully re-execute itself:
*initialize the "environ" variable
*Reduce the stack size to 8192 (This should still be further reduced based on analysis of usage.)
2014-11-08 18:03:25 -06:00
Stephen Heumann bff0844d44 Add code to get the path of the current executable, which we need to re-execute the shell.
On the GS, this uses GS/OS calls. Versions for OS X and Linux are also included.
2014-11-07 23:06:34 -06:00
Stephen Heumann cae994bc22 Add an emulation of waitpid that should be better than the one in libc.
In particular, it will buffer information about children other than the one being waited for, so it isn't lost. It can also emulate a non-blocking wait by arranging to interrupt the wait with a signal.
2014-11-07 12:12:18 -06:00
Stephen Heumann 3b1d003ea7 Handle globals more simply, declaring the "G" structure containing them directly in shell/hush.c.
This allows the "G" struct to show up in the debugger, so it can easily be inspected.
2014-11-06 13:08:38 -06:00
Stephen Heumann 9320c1e704 Set things up so hush can be build with debug code turned on.
This involved breaking things up into more segments in debug mode, since the code is larger. I also had to remove some unused extern definitions, which were causing link errors when debug code was enabled.

To enable debug code, pass "DEBUG=1" to make or build.gs.
2014-11-06 11:42:17 -06:00
Stephen Heumann 2669183517 Define segments and make other adjustments in makefile.
At this point, hush can successfully build and run, although it doesn't work correctly.

The main Makefile is now dedicated to the GNO build. There's now a separate makefile for building on modern systems with GCC/Clang.
2014-11-05 22:26:33 -06:00
Stephen Heumann 488a238ad7 Add an implementation of poll() written in terms of select(), to work around the lack of poll() on GNO.
This is a BSD-licensed poll() implementation by Brian M. Clapper. Its performance characteristics aren't as good as a "native" poll() would be, but this shouldn't be a problem in practice.
2014-11-03 12:26:43 -06:00
Stephen Heumann 051b79efc1 Move all the source files to 15-character ProDOS-compatible file names.
Dmake gets confused if you use over-15-character file names, so they needed to be shortened to get it to work. While I was at it, I also switched _ to . in the filenames so they're fully ProDOS compatible.

The shell/hush_test directory (not needed to build the code) still uses ProDOS-incompatible file names.
2014-11-02 22:11:07 -06:00
Stephen Heumann a3d8a81bb0 Add makefile (which can be used on GNO or a modern system), and build scripts based on in. 2014-11-01 22:59:10 -05:00
Stephen Heumann 472db3bd56 Delete the stuff that's irrelevant to hush. Also, include (a simplified version of) the autoconf-generated headers and a simple build script, so it can easily be build in the hush-only configuration. 2014-10-26 22:39:01 -05:00
Denys Vlasenko 57434022ce Start 1.23.0 development cycle
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-01 00:44:30 +01:00
Denys Vlasenko a2dd4ee0e8 Bump version to 1.22.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-01 00:42:11 +01:00
Denys Vlasenko f474dfa681 Start 1.22.0 development cycle
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-21 08:56:21 +01:00
Denys Vlasenko 64406a92a0 Bump version to 1.21.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-01-21 08:51:23 +01:00
Mike Frysinger 5694afd72a build system: use pkg-config to look up selinux libs
Newer versions of libselinux has started linking against more libs.
Rather than continuing hardcoding things, switch to using pkg-config
to query for its dependencies.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-10-20 15:01:26 -04:00
Denys Vlasenko b9d494453d Start 1.21.0 development cycle
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-22 03:47:39 +02:00
Denys Vlasenko f5234398ef Bump version to 1.20.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-22 03:38:31 +02:00
Denys Vlasenko 8b141ebd45 Start 1.20.0 development cycle
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-08-13 08:56:58 +02:00
Denys Vlasenko d84b175cb6 Bump version to 1.19.0, update copyright year in help message
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-08-13 08:46:00 +02:00
Daniel Fandrich 126f2b2853 Support configuring Busybox from _defconfig files
The existing test .config files are moved to configs/ and renamed
to *_defconfig. 'make xyz_defconfig' will enable the
configuration in that specific file.

Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-07-08 07:59:16 +02:00
Denys Vlasenko d488f5e8db build system: delete generated files on "make mrproper"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-07 10:01:58 +02:00
Chris Rees 12caabfa2d build system: do not use GNU-isms in find
Signed-off-by: Chris Rees <utisoft@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-30 09:41:39 +01:00
Denys Vlasenko 7386dd1e8a Start 1.19.0 development cycle
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2010-11-23 12:50:40 +01:00
Denys Vlasenko 5ab20641d6 Bump version to 1.18.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-23 09:21:44 +01:00
Denys Vlasenko 833d4e7f84 rename archival/libunarchive -> archival/libarchive; move bz/ into it
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-11-03 02:38:31 +01:00
Denys Vlasenko 17fc33dfbd finish busybox.1 renaming
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-10-24 03:46:16 +02:00
Denys Vlasenko 9ce07e778f bbconfig: add COMPRESS_BBCONFIG option
function                                             old     new   delta
bbconfig_config_bz2                                    -    4905   +4905
bbconfig_main                                         13      70     +57
bbconfig_config                                    21811       -  -21811
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/0 up/down: 4962/-21811)    Total: -16849 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-29 14:36:11 +02:00
Denys Vlasenko adbe3b5b98 build system: make 3.82 fix. Closes bug 2323
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-08-22 09:28:46 +02:00
Denys Vlasenko 89a1cace3b Start 1.18.0 development cycle
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-06 15:47:35 +02:00
Denys Vlasenko b2d95147c9 bump version to 1.17.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-06 04:16:50 +02:00
Denys Vlasenko 5c296de390 fix compile breakage with "make -j"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-07-03 14:28:35 +02:00
Denys Vlasenko 8d444494ef another fix to gen_build_files / autoconf.h dependency
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-25 13:56:28 +02:00
Denys Vlasenko 1d72d43940 gen_build_files.sh is an order prerequisite only for autoconf.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-25 13:30:59 +02:00
Denys Vlasenko e69c5e2429 build system: make gen_build_files.sh run before autoconf.h generation
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-06-25 12:58:17 +02:00