OSDN Git Service
Elliott Hughes [Thu, 19 Feb 2015 01:14:37 +0000 (17:14 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Yeongdeok Suh [Wed, 18 Feb 2015 19:06:26 +0000 (13:06 -0600)]
Separate 'userdel' from testing syntax.
When I test toybox with toybox/tests/*.test scripts,
I got many false FAILs from it. So, I tried to fix useradd.test file.
Rob Landley [Sun, 15 Feb 2015 21:44:26 +0000 (15:44 -0600)]
Add --remove-destination longopt for -F because the host version doesn't have a shortopt for it.
Rob Landley [Sun, 15 Feb 2015 21:27:43 +0000 (15:27 -0600)]
Only discard optargs in toy_exec() after finding the command to run (otherwise the fallback exevp() segfaults).
Rob Landley [Sat, 14 Feb 2015 20:59:30 +0000 (14:59 -0600)]
Make egrep and fgrep build standalone.
Rob Landley [Sat, 14 Feb 2015 20:54:36 +0000 (14:54 -0600)]
Fix --help for single.sh builds.
Rob Landley [Sat, 14 Feb 2015 20:05:00 +0000 (14:05 -0600)]
Split out unix2dos so scripts/single.sh and "make change" can build it standalone.
Rob Landley [Sat, 14 Feb 2015 07:08:15 +0000 (01:08 -0600)]
Move guts of "make change" to scripts/change.sh, don't try to build sh or help standalone.
sh builtin commands need multiplexer, help describes other enabled commands.
Rob Landley [Thu, 12 Feb 2015 22:41:59 +0000 (16:41 -0600)]
Fix bug introduced by last commit (print template instead of toybuf).
Also, xstrdup() the unmodified template because changing the environment string
could make the changed version show up in "ps".
Rob Landley [Wed, 11 Feb 2015 23:10:28 +0000 (17:10 -0600)]
Only apply mktemp directory to targets that aren't already paths.
Rob Landley [Wed, 11 Feb 2015 04:51:23 +0000 (22:51 -0600)]
Fix longopts (pointed out by Hyejin Kim).
Rob Landley [Mon, 9 Feb 2015 23:47:29 +0000 (17:47 -0600)]
One more cleanup pass on hwclock factoring out common code.
Rob Landley [Mon, 9 Feb 2015 23:33:59 +0000 (17:33 -0600)]
Inline rtc_open() and get_rtc_seconds(), perform resulting cleanups.
Rob Landley [Mon, 9 Feb 2015 22:34:24 +0000 (16:34 -0600)]
Cleanup/refactoring pass on hwclock.
Inline open_wall_clock_rtc() into rtc_open(), factor out xtzset(),
inline set_sysclock_from_hwclock(), set_hwclock_from_sysclock(),
and set_sysclock_timezone().
/etc/adjtime is short enough we don't need to bother with a break.
The final "else" case in main() should always trigger because >0 in optstr
says "at most zero arguments", so the || at the end is always true, so
take the test off.
Elliott Hughes [Mon, 9 Feb 2015 22:09:49 +0000 (14:09 -0800)]
Switch to toybox touch.
Change-Id: Ie306a3f280b3fa4086610f1c9e967420b21c173a
Elliott Hughes [Mon, 9 Feb 2015 20:16:39 +0000 (12:16 -0800)]
Add mktemp.
Change-Id: Icb52595829629d75f73aa9798d59b151d33f9b66
Elliott Hughes [Mon, 9 Feb 2015 20:14:46 +0000 (12:14 -0800)]
Regenerate generated toybox files post-sync.
Change-Id: Iab7a9844e8774eb575380c02e3794b5cd838959c
Elliott Hughes [Mon, 9 Feb 2015 20:03:09 +0000 (12:03 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Rob Landley [Sun, 8 Feb 2015 22:38:38 +0000 (16:38 -0600)]
Promote chcon to "other".
Rob Landley [Sun, 8 Feb 2015 22:38:11 +0000 (16:38 -0600)]
Cleanup pass on chcon.
Rob Landley [Sun, 8 Feb 2015 22:33:24 +0000 (16:33 -0600)]
Rewrite of a patch from Elliott Hughes to implement touch -h and switch API to utimensat() which offers nanosecond granularity and UTIME_OMIT/UTIME_NOW.
Rob Landley [Sun, 8 Feb 2015 22:27:30 +0000 (16:27 -0600)]
For some reason, ifconfig was explicitly excluding "ifconfig lo:0 127.0.0.2" style alias address assignments. No idea why.
Elliott Hughes [Sun, 8 Feb 2015 01:51:27 +0000 (19:51 -0600)]
netcfg is being removed, but shows up in the toybox roadmap.
Rob Landley [Sun, 8 Feb 2015 01:45:23 +0000 (19:45 -0600)]
Shameless meddling.
Elliot Hughes [Sun, 8 Feb 2015 01:27:59 +0000 (19:27 -0600)]
Use $TMPDIR if set (necessary on Android, where there is no /tmp).
Include full template in error messages.
Don't report success on failure with -q.
Avoid unnecessary allocation.
Fix "xxxxxx" versus "XXXXXX" confusion.
Rob Landley [Sat, 7 Feb 2015 23:20:23 +0000 (17:20 -0600)]
Build standalone commands where "depends on" config entries need to be switched on.
Rob Landley [Sat, 7 Feb 2015 23:19:38 +0000 (17:19 -0600)]
Clean up the output of "make change".
Rob Landley [Sat, 7 Feb 2015 22:23:59 +0000 (16:23 -0600)]
Remove xexec_optargs().
Rob Landley [Sat, 7 Feb 2015 22:23:03 +0000 (16:23 -0600)]
Cleanup pass on env, removing exec_optargs().
Rob Landley [Sat, 7 Feb 2015 22:17:44 +0000 (16:17 -0600)]
Make toy_exec() check if argc is in optargs and deal with it there so we don't need a separate xexec_optargs().
Rob Landley [Sat, 7 Feb 2015 21:32:22 +0000 (15:32 -0600)]
Merge unshare and nsenter (promoting and cleaning up nsenter).
Needs more testing, don't have a test environment set up for this yet...
Rob Landley [Fri, 6 Feb 2015 23:31:52 +0000 (17:31 -0600)]
In rm, init using to AT_REMOVEDIR in the dir case earlier.
(If you had a chmod 000 directory and did rm -r on it without -f, after the prompt it would complain it was a directory.)
Rob Landley [Fri, 6 Feb 2015 22:42:44 +0000 (16:42 -0600)]
Alright, the Android guys agree with the musl guys: faccessat(AT_SYMLINK_NOFOLLOW) is not supported.
Elliott Hughes [Thu, 5 Feb 2015 18:02:55 +0000 (10:02 -0800)]
Add cpio.
Sony asked for this to be included for some reason. Fine by me.
Bug:
18464157
Change-Id: I497d6d8fe8a912b5c503663cfb12d9de7803343b
Elliott Hughes [Thu, 5 Feb 2015 02:54:13 +0000 (18:54 -0800)]
Keep using the BSD grep/egrep/fgrep for now.
We hadn't switched over egrep and fgrep, and we were building
that functionality into our BSD grep anyway. For consistency
we should do them all together, not have this mix.
Change-Id: I8e858c24a6ca4e4048c17ea389098ee052f99f6c
Rob Landley [Sun, 25 Jan 2015 20:04:51 +0000 (14:04 -0600)]
Commit 1061 said "this gets expand off my to-review list". Remove it from the list.
Rob Landley [Sun, 25 Jan 2015 19:11:58 +0000 (13:11 -0600)]
Cleanup mountpoint and remove it from the pending README.
Elliott Hughes [Fri, 23 Jan 2015 04:39:45 +0000 (20:39 -0800)]
Merge remote-tracking branch 'toybox/master' into stuff
Elliott Hughes [Fri, 23 Jan 2015 04:39:34 +0000 (20:39 -0800)]
Revert "Fix "warning: implicit declaration of function 'basename' is invalid in C99"."
This reverts commit
2fd83687be3a5219a93cf016c37cfe71bb3edc38.
Luis Felipe Strano Moraes [Thu, 22 Jan 2015 22:29:34 +0000 (16:29 -0600)]
bootchartd: Removing wrong free call to non-malloc'ed string.
Rob Landley [Thu, 22 Jan 2015 08:18:30 +0000 (02:18 -0600)]
Fix sed s//\[newline]/ line continuations.
The problem was that readline() was returning a newline at the end of each
string, which wasn't getting stripped in the parser and thus \ wasn't at the
end of a line for -f, it was escaping a literal newline, so the continuation
logic didn't trigger. Remove some redundant null checks while we're at it,
and don't bother terminating a string we don't return (yes we leak memory
in an error path, but it's about to error_exit() anyway).
Elliott Hughes [Tue, 20 Jan 2015 22:03:29 +0000 (16:03 -0600)]
fix hwclock's rtc selection
For systems using /dev/rtcN, /dev/rtc0 isn't necessarily the RTC
that's used to provide the system time at boot time. We need to search
for the RTC whose /sys/class/rtc/rtcN/hctosys contains "1".
Elliott Hughes [Tue, 20 Jan 2015 21:52:41 +0000 (15:52 -0600)]
fix typo in printf
Rob Landley [Sun, 18 Jan 2015 20:06:14 +0000 (14:06 -0600)]
Remove trailing whitespace.
Rob Landley [Sun, 18 Jan 2015 19:44:24 +0000 (13:44 -0600)]
Lift the basename/libgen.h shenanigans back out of portability.c and make it a static inline in portability.h, and prototype dirname() while we're at it.
Elliott Hughes [Sun, 18 Jan 2015 19:36:31 +0000 (13:36 -0600)]
fix non-glibc basename(3) usage
I considered a #else on the big #ifdef __GLIBC__ above, but that
seemed harder to follow.
Elliott Hughes [Sat, 17 Jan 2015 03:27:31 +0000 (19:27 -0800)]
Switch to toybox id.
Change-Id: Ia1752b80fd97134dfac07b0d2bba905b3d900b88
Elliott Hughes [Sat, 17 Jan 2015 03:15:43 +0000 (03:15 +0000)]
Merge "Regenerate the toybox generated files."
Rob Landley [Fri, 16 Jan 2015 19:55:32 +0000 (13:55 -0600)]
Move pty.h back to toys.h (under LSB 4.1 headers).
Elliott Hughes [Fri, 16 Jan 2015 19:49:23 +0000 (13:49 -0600)]
AOSP master has <pty.h> and builds netcat/nc.
Rob Landley [Fri, 16 Jan 2015 19:43:09 +0000 (13:43 -0600)]
id.c #ifdefectomy. (ifdefs belong in headers, not in C code.)
Change-Id: I18a007dc1a78ad3082b45992471a11d27b0f5b46
Elliott Hughes [Fri, 16 Jan 2015 19:36:53 +0000 (13:36 -0600)]
This patch adds a TOYBOX_SELINUX configuration option to control both
the SELinux commands (such as chcon) and the SELinux-specific options
to regular commands (such as ls -Z).
This lets us #include <selinux/selinux.h> in portability.h.
I've also fixed chcon to insist on being given the a context argument.
This patch also adds -Z to id and fixes id's regular output (-G should
be separated by spaces, non-G output should be separated by commas,
and you don't want a double comma where the egid is omitted from the
list of groups).
Elliott Hughes [Sat, 17 Jan 2015 03:04:29 +0000 (03:04 +0000)]
Merge "Added tag 0.5.1 for changeset
62a7d617e1ce"
Elliott Hughes [Sat, 17 Jan 2015 02:50:56 +0000 (18:50 -0800)]
Regenerate the toybox generated files.
Change-Id: I69a07e2043ea62fa963bfce12575e746a2f853c8
Rob Landley [Fri, 16 Jan 2015 19:55:32 +0000 (13:55 -0600)]
Move pty.h back to toys.h (under LSB 4.1 headers).
Elliott Hughes [Fri, 16 Jan 2015 19:49:23 +0000 (13:49 -0600)]
AOSP master has <pty.h> and builds netcat/nc.
Rob Landley [Fri, 16 Jan 2015 19:43:09 +0000 (13:43 -0600)]
id.c #ifdefectomy. (ifdefs belong in headers, not in C code.)
Elliott Hughes [Fri, 16 Jan 2015 19:36:53 +0000 (13:36 -0600)]
This patch adds a TOYBOX_SELINUX configuration option to control both
the SELinux commands (such as chcon) and the SELinux-specific options
to regular commands (such as ls -Z).
This lets us #include <selinux/selinux.h> in portability.h.
I've also fixed chcon to insist on being given the a context argument.
This patch also adds -Z to id and fixes id's regular output (-G should
be separated by spaces, non-G output should be separated by commas,
and you don't want a double comma where the egid is omitted from the
list of groups).
Rob Landley [Fri, 16 Jan 2015 01:09:08 +0000 (19:09 -0600)]
Added tag 0.5.1 for changeset
62a7d617e1ce
Elliott Hughes [Thu, 15 Jan 2015 23:04:19 +0000 (15:04 -0800)]
Switch to toybox cmp.
Change-Id: I551c31251a0079cfae148f2d14e33a78adab8643
Elliott Hughes [Thu, 15 Jan 2015 21:41:34 +0000 (13:41 -0800)]
Switch to toybox chown.
Change-Id: I110d43a19a2725207488a358e1fe73ef770dfbbf
Elliott Hughes [Thu, 15 Jan 2015 01:15:18 +0000 (17:15 -0800)]
Fix "warning: implicit declaration of function 'basename' is invalid in C99".
Change-Id: Id48cfbd9219a9db4a657abe17a59651eea82f2f1
Elliott Hughes [Thu, 15 Jan 2015 01:00:35 +0000 (17:00 -0800)]
Regenerate toybox generated files.
Change-Id: I3225ddc60f8e894d47b51bdc04f74ac97be90328
Elliott Hughes [Thu, 15 Jan 2015 00:52:43 +0000 (00:52 +0000)]
Merge changes If492fccc,Ia2fd3ced,I50d32077
* changes:
Switch netcat to stop parsing command line at first nonoption argument instead of stopping after -l or -L.
Make touch -d miliseconds work. (Still only 6 digits precision instead of 9, but it's a start.)
i found a few problems while manually smoke testing toybox chown versus toolbox (NetBSD) chown...
Elliott Hughes [Thu, 15 Jan 2015 00:52:07 +0000 (00:52 +0000)]
Merge changes I698a1608,I9d66c41d,I3a4917a5,Id3d633ff,Id0dead30, ...
* changes:
Let chown build standalone.
sed bugfix: N or n at end of script would save the terminating NULL as the resume position, so the script would restart from beginning.
sed s/// can have line continuations in the replacement part, with or without a \ escaping the newline.
Promote printf.
One more bugfix for printf.c, with test suite entry. (Make %-3d etc work.)
Cleanup pass on printf.
More half-finished cleanup of printf.c, and more test suite entries.
Since "printf" is a shell builtin, printf.test wasn't actually testing anything.
More printf cleanup, and test suite entries.
Elliott Hughes [Thu, 15 Jan 2015 00:51:02 +0000 (00:51 +0000)]
Merge changes Ia8df7446,I77c8d1a7,Iaad492fd,I87fd25f2,I4f534572, ...
* changes:
Fix sed backslash parsing in square bracket pattern sections.
Another cleanup pass on printf.
Move fflush() checking to xexit() and have exit paths in main() call that.
Cleanup pass on printf.
Need to update install.c for the changed OLDTOY() argument list.
Tweak status.html
Switch a lot of strncpy() calls to xstrncpy().
strncpy(optptr, hname, strlen(hname)) is really just strcpy().
strtol() doesn't return error indicator for overflow, it just sets errno. So add estrtol() (which clears errno first), and xstrtol() (which error_exit()s on overflow).
Debris from flag handling rewrite: don't allow -^A to actually trigger.
typo fixes
Fix for mix from Isaac Dunham (who can actually test it). (I tweaked the curly brackets.)
Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags).
When CP_MORE was disabled, the d flag was still in the [-exclusion] list at the end and option parsing fell off the end looking for it (segfault) if DEBUG wasn't enabled to check for that.
Elliott Hughes [Thu, 15 Jan 2015 00:50:42 +0000 (00:50 +0000)]
Merge changes Ide699acc,I774c599c,I5c419e37,I7f24174d,I989f453e, ...
* changes:
When you include the posix header libgen.h, glibc #defines basename to some random other symbol name (because gnu) and this screws up nontrivial macro expansions of NEWTOY(basename), so work around it in portability.h.
Link to gmane web archive.
Another random link for the design page.
Fluff out help text.
Promote mix
Cleanup mix.c.
Elliott Hughes [Wed, 14 Jan 2015 23:15:26 +0000 (23:15 +0000)]
Merge "Teach factor to accept whitespace separated arguments (reported by Robert Thompson)."
Elliott Hughes [Wed, 14 Jan 2015 20:26:10 +0000 (12:26 -0800)]
Switch to toybox date, and add hwclock.
Change-Id: I5116713315c2f86d4dfb6beccf0e41b3fb8a24f7
Rob Landley [Wed, 14 Jan 2015 19:59:10 +0000 (13:59 -0600)]
Switch netcat to stop parsing command line at first nonoption argument instead of stopping after -l or -L.
Hyejin Kim tried "toyboxd nc nc -p 1234 -l rm mv ps" (which attempted to run
"nc rm mv ps") and "toybox nc -l -p 1234" (which attempted to run "-p 1234")
and found the behavior confusing. So make it work like xargs, where all
netcat options have to come before the start of any child command.
Rob Landley [Wed, 14 Jan 2015 19:54:34 +0000 (13:54 -0600)]
Make touch -d miliseconds work. (Still only 6 digits precision instead of 9, but it's a start.)
Elliott Hughes [Wed, 14 Jan 2015 19:07:28 +0000 (11:07 -0800)]
Switch to toybox ifconfig.
Change-Id: Ifef0cc12d1edc8ad8647919343035f7966dfc621
Elliott Hughes [Wed, 14 Jan 2015 19:00:47 +0000 (11:00 -0800)]
Switch on toybox inotifyd.
Change-Id: I4c95fd2d383654090b3846ee4aaa44bd35a55e68
Elliott Hughes [Wed, 14 Jan 2015 18:40:22 +0000 (10:40 -0800)]
Switch to toybox cat.
Change-Id: Ic50d784b8782c0d3483c2af26fab72063fed3992
Elliott Hughes [Wed, 14 Jan 2015 09:43:49 +0000 (03:43 -0600)]
i found a few problems while manually smoke testing toybox chown versus toolbox (NetBSD) chown...
new test:
and here's the patch to fix "owner:" ":group" and the ":" special case:
Rob Landley [Wed, 14 Jan 2015 06:31:06 +0000 (00:31 -0600)]
Let chown build standalone.
Elliott Hughes [Wed, 14 Jan 2015 02:45:44 +0000 (18:45 -0800)]
Add sed and tr.
Change-Id: I9749fa432f49980da629b1a12073103bab03ea3d
Elliott Hughes [Wed, 14 Jan 2015 02:08:08 +0000 (18:08 -0800)]
Remove factor and readahead.
Neither is very useful, and readahead doesn't exist on the desktop.
Change-Id: I84e26dd3be2169d64f95ef3af2969b070283e5db
Rob Landley [Tue, 13 Jan 2015 10:28:19 +0000 (04:28 -0600)]
sed bugfix: N or n at end of script would save the terminating NULL as the resume position, so the script would restart from beginning.
Rob Landley [Tue, 13 Jan 2015 09:35:37 +0000 (03:35 -0600)]
sed s/// can have line continuations in the replacement part, with or without a \ escaping the newline.
Rob Landley [Sun, 11 Jan 2015 16:17:58 +0000 (10:17 -0600)]
Promote printf.
Rob Landley [Sun, 11 Jan 2015 16:16:38 +0000 (10:16 -0600)]
One more bugfix for printf.c, with test suite entry. (Make %-3d etc work.)
Rob Landley [Sun, 11 Jan 2015 07:22:36 +0000 (01:22 -0600)]
Cleanup pass on printf.
Alas, passing a union as the last argument to printf does not appear to work
reliably, and there's no obvious way to manually assemble varargs in a portable
manner. So I have to repeat the printf once for each data type. Oh well.
Rob Landley [Sun, 11 Jan 2015 02:02:21 +0000 (20:02 -0600)]
More half-finished cleanup of printf.c, and more test suite entries.
Rob Landley [Tue, 6 Jan 2015 21:06:51 +0000 (15:06 -0600)]
Since "printf" is a shell builtin, printf.test wasn't actually testing anything.
Rob Landley [Tue, 6 Jan 2015 18:07:20 +0000 (12:07 -0600)]
More printf cleanup, and test suite entries.
Fixes bug introduced last time where toys.optargs was both snapshotted and used
directly and the two fell out of sync.
Rob Landley [Sun, 4 Jan 2015 09:50:52 +0000 (03:50 -0600)]
Fix sed backslash parsing in square bracket pattern sections.
Rob Landley [Sun, 4 Jan 2015 02:31:41 +0000 (20:31 -0600)]
Another cleanup pass on printf.
Rob Landley [Sat, 3 Jan 2015 22:25:36 +0000 (16:25 -0600)]
Move fflush() checking to xexit() and have exit paths in main() call that.
Rob Landley [Sat, 3 Jan 2015 03:28:39 +0000 (21:28 -0600)]
Cleanup pass on printf.
Rob Landley [Fri, 2 Jan 2015 06:44:27 +0000 (00:44 -0600)]
Need to update install.c for the changed OLDTOY() argument list.
Rob Landley [Thu, 1 Jan 2015 23:37:57 +0000 (17:37 -0600)]
Tweak status.html
Rob Landley [Thu, 1 Jan 2015 22:59:35 +0000 (16:59 -0600)]
Switch a lot of strncpy() calls to xstrncpy().
Rob Landley [Thu, 1 Jan 2015 22:49:55 +0000 (16:49 -0600)]
strncpy(optptr, hname, strlen(hname)) is really just strcpy().
Rob Landley [Thu, 1 Jan 2015 22:28:51 +0000 (16:28 -0600)]
strtol() doesn't return error indicator for overflow, it just sets errno. So add estrtol() (which clears errno first), and xstrtol() (which error_exit()s on overflow).
Rob Landley [Thu, 1 Jan 2015 22:19:40 +0000 (16:19 -0600)]
Debris from flag handling rewrite: don't allow -^A to actually trigger.
Elliott Hughes [Thu, 1 Jan 2015 16:58:59 +0000 (10:58 -0600)]
typo fixes
Rob Landley [Thu, 1 Jan 2015 04:38:48 +0000 (22:38 -0600)]
Fix for mix from Isaac Dunham (who can actually test it). (I tweaked the curly brackets.)
He says:
In the channel selection loop, "if (TT.chan)" had been combined with
a strcmp; the else conditionals were premised on if (TT.chan) alone.
The help text had been only partially updated for a couple option changes.
Rob Landley [Thu, 1 Jan 2015 03:30:59 +0000 (21:30 -0600)]
Redo option parsing infrastructure so #define FORCE_FLAGS can unzero flag macros for a disabled command (needed when multiple commands share infrastructure with a common set of flags).
This means the flag space is no longer packed, but leaves gaps where the zeroes
go. (Actual flag bit positions are the same for all configs.) Since the
option parsing needs to know where the holes are, the OPTSTR values are
now generated as part of flags.h with ascii 1 values for the disabled values.
(So generated/oldflags.h went away.)
This also means that the option string argument for OLDTOY() went away, it now
uses the same arguments as the NEWTOY() it references.
Rob Landley [Thu, 1 Jan 2015 03:23:37 +0000 (21:23 -0600)]
When CP_MORE was disabled, the d flag was still in the [-exclusion] list at the end and option parsing fell off the end looking for it (segfault) if DEBUG wasn't enabled to check for that.