Rob Landley [Sun, 8 Jun 2014 20:03:32 +0000 (15:03 -0500)]
Add host by Rich Felker.
Rob Landley [Sun, 8 Jun 2014 19:01:37 +0000 (14:01 -0500)]
Isaac Dunham also reported that some diff implementations can't handle nonseekable input, so write to a temporary file instead of <(command).
Use trap EXIT to make sure the temporary files get deleted.
Rob Landley [Sun, 8 Jun 2014 18:49:57 +0000 (13:49 -0500)]
Isaac Dunham pointed out that busybox diff only implements unified diffs, and sent a patch to convert bloatcheck to use that. I tweaked it a bit.
Rob Landley [Sun, 8 Jun 2014 18:24:02 +0000 (13:24 -0500)]
Replace large parenthetical in bloatcheck with a function.
Rob Landley [Sat, 7 Jun 2014 17:03:54 +0000 (12:03 -0500)]
Minor tweaks to code style section.
Rob Landley [Sat, 7 Jun 2014 15:42:20 +0000 (10:42 -0500)]
Make md5sum/sha1sum -b flag be "brief" output (just the hash).
(It's not like systems implementing -b binary and -t text still matter.)
Rob Landley [Tue, 3 Jun 2014 11:27:24 +0000 (06:27 -0500)]
mount: start on option parsing, implement loopback and bind mount autodetection.
Rob Landley [Tue, 3 Jun 2014 02:16:20 +0000 (21:16 -0500)]
Help text should have a blank line after usage: lines, and a couple other whitespace tweaks.
Isaac Dunham [Sun, 1 Jun 2014 22:47:19 +0000 (17:47 -0500)]
The tests for link and du are attached.
Isaac Dunham [Sun, 1 Jun 2014 18:50:39 +0000 (13:50 -0500)]
cpio: archive more files
While writing tests for cpio, I found that cpio tries to open empty
files if they're regular files, and fails to archive them if unreadable.
This can be easily avoided, and is not the usual behavior.
Felix Janda [Sat, 31 May 2014 09:18:30 +0000 (11:18 +0200)]
iconv: some fixes
- fix problem with sequences at buffer boundaries
- add (ignored) -c and -s options
- don't try to continue with a file when read() fails
Rob Landley [Sat, 31 May 2014 23:00:04 +0000 (18:00 -0500)]
Promote partprobe.
Rob Landley [Sat, 31 May 2014 22:59:27 +0000 (17:59 -0500)]
Cleanup partprobe.
Rob Landley [Sat, 31 May 2014 17:33:24 +0000 (12:33 -0500)]
Introduce xfork() and make commands use it, and make some WEXITSTATUS() use WIFEXITED() and WTERMSIG()+127.
Ashwini Sharma [Thu, 29 May 2014 13:21:48 +0000 (08:21 -0500)]
killall5 - kill all the processes not in its session.
Ashwini Sharma [Thu, 29 May 2014 13:20:30 +0000 (08:20 -0500)]
makedevs - making devices/nodes in a range. Supports reading the tabled entry from file.
Ashwini Sharma [Thu, 29 May 2014 13:18:50 +0000 (08:18 -0500)]
strings - print the strings in the file.
Rob Landley [Thu, 29 May 2014 11:49:59 +0000 (06:49 -0500)]
First stab at mount, very incomplete.
Rob Landley [Thu, 29 May 2014 11:29:12 +0000 (06:29 -0500)]
Make "losetup /dev/loop0 filename" work.
Sigh. Implement the complex cases and you screw up the simple cases you already tested...
Rob Landley [Thu, 29 May 2014 10:22:02 +0000 (05:22 -0500)]
Switch mtab_list to doubly linked so we can traverse in either order. Convert umount and df. Add dlist_terminate() to break lists for traversal in either direction.
Rob Landley [Tue, 27 May 2014 12:56:51 +0000 (07:56 -0500)]
Add mount options to data getmountlist collects.
Rob Landley [Tue, 27 May 2014 01:39:20 +0000 (20:39 -0500)]
Brush the dust off toysh.
Simplify the config micromanagement tangle to just a single "interactive"
option. Fix an unused variable and wrong variable type.
Rob Landley [Mon, 26 May 2014 17:25:47 +0000 (12:25 -0500)]
Isaac Dunham suggested xprintf() should call fflush() instead of ferror(), and posix-2008 doesn't say if fflush() covers ferror() (or can return success when the stream's error state is set), so call both.
Bertold Van den Bergh [Mon, 26 May 2014 01:49:51 +0000 (20:49 -0500)]
I have attached a patch adding a program that allows re-reading the partition table. This is often used on embedded systems booting from SD/USB devices that need to resize partitions on first boot.
Ashwini Sharma [Sun, 25 May 2014 16:52:27 +0000 (11:52 -0500)]
atolx_range() is already added into lib/lib.c, in vconfig.c atolx_range() can be used in place of locally defined strtorange() function.
Isaac Dunham [Sun, 25 May 2014 16:46:58 +0000 (11:46 -0500)]
logname and whoami are the same as id -un, so merge them.
Since the starting letters are greater than those for 'id' or 'groups',
we cn just check if the first letter is greater than 'i'.
Rob Landley [Sun, 25 May 2014 03:40:41 +0000 (22:40 -0500)]
Bugfix from Isaac Dunham (new pci database has # comments in it) and some minor cleanups I had in my tree already.
Rob Landley [Sat, 24 May 2014 19:41:30 +0000 (14:41 -0500)]
Pending commands should default n
Ashwini Sharma [Sat, 24 May 2014 19:40:02 +0000 (14:40 -0500)]
Single-user login.
Rob Landley [Sat, 24 May 2014 18:50:19 +0000 (13:50 -0500)]
The "not root" test happens before looking for --help, so "./sulogin --help" doesn't show it. Instead make the "not root" failure case always show help text.
Rob Landley [Sat, 24 May 2014 17:51:53 +0000 (12:51 -0500)]
Remove debug detritus I didn't mean to to check in, and treat an "this variable can never actually be used uninitialized but gcc's warning generator can't tell and fails spamwards" warning.
Rob Landley [Sat, 24 May 2014 17:49:21 +0000 (12:49 -0500)]
Pass the same $CFLAGS to the library probe as the final build, to work with broken build environments that provide different libraries for --static and dynamic builds.
Rob Landley [Sat, 24 May 2014 17:48:32 +0000 (12:48 -0500)]
patch from ashwini sharma: treat 0 length read at the start of password read as EOF.
Ashwini Sharma [Fri, 23 May 2014 14:00:09 +0000 (09:00 -0500)]
rfkill - enable/disable the radio devices
e.g. Wireless adapter, Bluetooth devices...
Ashwini Sharma [Fri, 23 May 2014 13:58:08 +0000 (08:58 -0500)]
inotifyd - watch for filesystem events.
Rob Landley [Fri, 23 May 2014 09:14:46 +0000 (04:14 -0500)]
Ashwini Sharma pointed out I screwed up last.c.
Renamed the function, missed a user...
Rob Landley [Fri, 23 May 2014 02:33:10 +0000 (21:33 -0500)]
date: add -ds, document +FORMAT escapes.
Rob Landley [Thu, 22 May 2014 13:16:55 +0000 (08:16 -0500)]
Update docs for example and pending directories.
Rob Landley [Wed, 21 May 2014 12:57:48 +0000 (07:57 -0500)]
Convert bootchartd to generic_signal().
Rob Landley [Wed, 21 May 2014 12:51:11 +0000 (07:51 -0500)]
Make telnet use generic_signal(), minor in-passing cleanups.
Rob Landley [Wed, 21 May 2014 12:41:27 +0000 (07:41 -0500)]
Make telnetd use generic_signal(), inline kill_session(), close race window where a SIGCHLD could get lost.
Rob Landley [Wed, 21 May 2014 12:24:16 +0000 (07:24 -0500)]
Add generic_signal() handler, which sets toys.signal and writes byte to toys.signalfd if set.
Rob Landley [Wed, 21 May 2014 12:09:09 +0000 (07:09 -0500)]
First pass init cleanup: use sigatexit() to set multiple signal handlers, rename set_sane_term() to reset_term() and have it take the fd it works on as an argument, some whitespace and help text tweaks.
Rob Landley [Wed, 21 May 2014 12:02:51 +0000 (07:02 -0500)]
Make fsck.c use common list free function, collate cleanup code and move inline.
Rob Landley [Wed, 21 May 2014 12:01:16 +0000 (07:01 -0500)]
Make last use common llist free function, minor cleanups.
Rob Landley [Wed, 21 May 2014 11:57:43 +0000 (06:57 -0500)]
Add free functions for predefined llist types.
Ashwini Sharma [Wed, 21 May 2014 10:12:38 +0000 (05:12 -0500)]
dhcp client had a segfault, when DHCP message contained 'pad' option.
The parsing logic kept checking for other options beyond __pad__ option, without
checking if it was __end__ option after that or not.
Isaac Dunham [Wed, 21 May 2014 02:19:17 +0000 (21:19 -0500)]
lspci text output: add -i, allow -n when disabled
-i is how standard lspci handles changing the PCI ID database.
lspci -n should be a no-op when text is disabled.
Rob Landley [Tue, 20 May 2014 00:34:55 +0000 (19:34 -0500)]
Cleanup pass on bootchartd.
Might have broken something, don't actually have a test case for bootchartd yet.
Rob Landley [Mon, 19 May 2014 23:24:35 +0000 (18:24 -0500)]
Fluff out the coding style section, but the result was a bit big for the start of code.html, so move it to design.html.
Rob Landley [Sun, 18 May 2014 19:05:13 +0000 (14:05 -0500)]
Quick cleanup pass on ps.
Rob Landley [Sun, 18 May 2014 18:08:36 +0000 (13:08 -0500)]
Cleanup pass on lspci
Rob Landley [Sun, 18 May 2014 16:47:08 +0000 (11:47 -0500)]
Teach singleconfig to switch on sub-options of commands it's building.
If we're building a standalone version, it might as well have all the bells and whistles enabled.
Rob Landley [Fri, 16 May 2014 00:11:21 +0000 (19:11 -0500)]
bootchartd by Bilal Qureshi.
Daniel Verkamp [Fri, 16 May 2014 00:05:16 +0000 (19:05 -0500)]
Here's a quick cleanup of md5sum. Executive summary: smaller and faster.
On my machine, for a 2.2 GB file of random bytes, the timings with
warm cache are:
toybox before: 11.4 seconds
toybox after: 8.3 seconds
GNU md5sum: 3.9 seconds
openssl dgst -md5: 3.5 seconds
This is clearly better than before (3x openssl), but still slow (2x openssl).
I suspect there is more low-hanging fruit to be had by eliminating the
memcpy in hash_update (maybe not too much - hash_update accounts for
about 4% of total runtime versus 92% for md5_transform according to
perf - but this would also help sha1sum).
make bloatcheck on x86_64 gcc 4.8.2 -Os:
name old new delta
-----------------------------------------------------------------------
md5rot 0 64 64
md5_transform 365 223 -142
-----------------------------------------------------------------------
-78 total
Rationale for the changes:
Move definition of 'rol' up so it can be used in md5_transform. This
is purely cosmetic; it expands to exactly the same code.
Put rotation counts in a lookup table instead of calculating them on
the fly. This is mostly a wash size-wise, +5 bytes total, but
worthwhile for readability and speed.
Instead of accessing the state array using a rotating index (the
variable formerly known as 'a'), access the state with constant
offsets and rotate the contents of the array instead. This is the big
win - it eliminates all the crazy memory addressing math inside the
loop.
Rob Landley [Thu, 15 May 2014 10:34:08 +0000 (05:34 -0500)]
Promote sysctl from pending to other, default y.
Rob Landley [Thu, 15 May 2014 10:32:52 +0000 (05:32 -0500)]
More sysctl cleanup: fix error message on nonexistent key, write path, and -p.
Rob Landley [Wed, 14 May 2014 00:45:01 +0000 (19:45 -0500)]
Cleanup pass on sysctl.
Not heavily tested yet but should be finished at the design level.
Rob Landley [Mon, 12 May 2014 12:52:12 +0000 (07:52 -0500)]
First cleanup pass on sysctl.
Remove unnecessary typecasting of things that are already char * to char *,
and multiplying by sizeof(char *) which is 1. Rename do_process() do_flag_a()
since that's the only caller. Move read_key_values() down past trim_spaces()
and read_config_file() so it's next to its only two users. Replace some
euphemisms for 0 with 0.
replace_char() really sounds like something libc should already have one of,
but I'm blanking on it if so. (It doesn't need a temporary variable when the
argument variable is already a copy so changing it won't affect the caller.)
Rob Landley [Mon, 12 May 2014 11:22:10 +0000 (06:22 -0500)]
Add sysctl by Bilal Qureshi.
Rob Landley [Mon, 12 May 2014 11:12:20 +0000 (06:12 -0500)]
Add arp from Sandeep Sharma and Kyungwan Han.
Rob Landley [Sat, 10 May 2014 18:24:58 +0000 (13:24 -0500)]
sizeof("string") treats it as a char array _including_ the null terminator, so strncmp(dest, "string", sizeof("string")) is just strcpy.
Rob Landley [Sat, 10 May 2014 18:20:03 +0000 (13:20 -0500)]
Initial cleanup of last: mostly whitespace, move no record test to start of loop, don't bother to stat an empty file to report when an empty log was created (just report current time).
Rob Landley [Sat, 10 May 2014 18:06:31 +0000 (13:06 -0500)]
Catch duplicate command name (which breaks the build already, but doesn't identify the culprit).
Rob Landley [Tue, 6 May 2014 11:31:28 +0000 (06:31 -0500)]
Switch human_readable() to just outputing decimal kilo/mega/gigabytes, make du use it, move it from lib/pending.c to lib.c.
Rob Landley [Tue, 6 May 2014 11:14:20 +0000 (06:14 -0500)]
Use compiler built-in macros to determine if argument parsing can use double or float for FLOAT arguments. (I.E. whether double fits in a long's memory.) Check in a way that the macros not being defined just gives us the shorter one.
Rob Landley [Tue, 6 May 2014 02:20:11 +0000 (21:20 -0500)]
Fix bug reported by Ashwini Sharma: rebound has to be at the end or toy_init() doesn't zero the rest of the struct.
Ashwini Sharma [Fri, 2 May 2014 11:24:11 +0000 (06:24 -0500)]
In function readfile(), the buffer buf is free'd when readall() fails. This free can cause a crash, if the buffer passed by user of function is not malloc'ed one.
names_to_pid() is one usecase example here.
Ashwini Sharma [Fri, 2 May 2014 11:17:48 +0000 (06:17 -0500)]
Attached is the patch for lsattr and chattr implementation.
This is the modified and better version from the last one I sent.
It is having the both the mains (lsattr_main() and chattr_main() )
in single file.
Also removed the dependency of additional file in lib, as common code is in the
same .c file.
Rob Landley [Tue, 29 Apr 2014 11:03:17 +0000 (06:03 -0500)]
Teach cpio to set uid/gid and timestamp. (Timestamp has year 2100 problem.)
Note that directory timestamps are still sometimes wrong because creating
things in a directory can update the timestamp. Also, cp -r has logic to
ensure we can write to a directory that doesn't have write permission,
cpio does not. This is fixable, but not what existing cpio does.
Rob Landley [Fri, 25 Apr 2014 10:56:16 +0000 (05:56 -0500)]
fold cleanup: whitespace and curly brackets.
Rob Landley [Fri, 25 Apr 2014 10:50:00 +0000 (05:50 -0500)]
Cosmetic tweak: spell out "Linux Standard Base" in menuconfig.
Rob Landley [Fri, 25 Apr 2014 10:48:11 +0000 (05:48 -0500)]
Fix od bug reported by Samuel Holland ("od -v -b" was appending default output type even though an output type was specified).
Rob Landley [Wed, 23 Apr 2014 22:23:09 +0000 (17:23 -0500)]
Add example directory, move hello.c into it, add skeleton.c to demonstrate more complciated stuff (multiple commands per file, etc), and have genconfig.sh sort backwards so posix is first and example last in menuconfig.
Rob Landley [Wed, 23 Apr 2014 13:38:29 +0000 (08:38 -0500)]
As long as uClibc's still around and requires you to jump through hoops to get iconv(), probe and build defconfig without it if it's not there.
Rob Landley [Wed, 23 Apr 2014 13:37:07 +0000 (08:37 -0500)]
usage: is lower case (the help generator looks for that, might as well be consistent).
Rob Landley [Sun, 20 Apr 2014 19:22:19 +0000 (14:22 -0500)]
Release announcement for 0.4.8.
Rob Landley [Sun, 20 Apr 2014 18:38:07 +0000 (13:38 -0500)]
Added tag 0.4.8 for changeset
8556669d3928
Samuel Holland [Thu, 17 Apr 2014 00:49:15 +0000 (19:49 -0500)]
This version of fold fixes major bugs (infinite loop, overflow) and adds an option for un/refolding text.
Rob Landley [Wed, 16 Apr 2014 13:54:19 +0000 (08:54 -0500)]
Revert lots of half-finished local debris I didn't mean to check in with Isaac's roadmap update.
Mercurial's "import" command is still broken, committing local tree changes to files that weren't even touched by the patch because the hg developers inisist, when I point out how stupid it is, that they meant to do that. (hg record can do hunks, but import can't even track _files_.)
Rob Landley [Wed, 16 Apr 2014 12:49:32 +0000 (07:49 -0500)]
Probe for the existence of FIFREEZE and make fsfreeze depend on it.
Rob Landley [Wed, 16 Apr 2014 02:59:42 +0000 (21:59 -0500)]
Probes for O_NOFOLLOW that compile and run something aren't compatible with cross compiling, so just #define it to 0 if it's not in fcntl.h where posix-2008 says.
Ashwini Sharma [Sun, 13 Apr 2014 21:07:22 +0000 (16:07 -0500)]
A tool to reset the terminal.
This implementation depends on the _stty_ 'sane' settings.
Ashwini sharma [Sun, 13 Apr 2014 21:04:16 +0000 (16:04 -0500)]
An issue in ifconfig while verifying the HW Address, which is assumed to be of the format __C2:79:38:95:CD:AB__ but can be of form __C2:79:38:95:D:A__. In this case the HW address is reported as bad.
Ashwini Sharma [Sun, 13 Apr 2014 20:58:20 +0000 (15:58 -0500)]
An implementation of __printf__ is attached.
Rob Landley [Sun, 13 Apr 2014 20:49:15 +0000 (15:49 -0500)]
iconv cleanup.
Felix Janda [Sun, 13 Apr 2014 18:12:45 +0000 (13:12 -0500)]
iconv is actually something I'm missing on my current musl based system.
Attached is a simple version using the libc's iconv.
Isaac Dunham [Sun, 13 Apr 2014 04:26:50 +0000 (23:26 -0500)]
getty: build fix, clean up messages, simplify code
build fix: xmsprintf has been renamed
shorten and lowercase the error messages
use xexec() instead of execlp(); perror_exit();
remove redundant variable setting
Rob Landley [Sun, 13 Apr 2014 01:39:33 +0000 (20:39 -0500)]
On further analysis, none of the glibc commands are interesting.
Isaac Dunham [Sat, 12 Apr 2014 22:26:44 +0000 (17:26 -0500)]
roadmap: describe glibc commands.
Some glibc commands are irrelevant because they're for functionality
that is excluded from musl (mtrace, rpc*, localedef, iconvconfig, nscd).
getconf and catchsegv look like candidates for the development toolchain;
locale and iconv were already triaged.
getent is pretty lame, but it and the timezone stuff (tzselect zic
zdump) are the only new possibly interesting commands.
Rob Landley [Fri, 11 Apr 2014 00:40:14 +0000 (19:40 -0500)]
Fix date setting, and fluff out help text a bit.
Isaac Dunham [Wed, 9 Apr 2014 22:26:09 +0000 (17:26 -0500)]
modprobe: cleanup, incorporate Ashwini's fix for alias loading
Move <fnmatch.h> to toys.h, since it's POSIX.
Avoid duplicating code in an if/else block.
Terser error messages, spelling.
Don't always print the state.
Rob Landley [Wed, 9 Apr 2014 14:23:17 +0000 (09:23 -0500)]
Bugfix: if $TERM and friends aren't set, putenv() got passed a NULL.
Rob Landley [Wed, 9 Apr 2014 13:30:09 +0000 (08:30 -0500)]
Document some of the new temporary files in generated/, add anchor tags.
Rob Landley [Wed, 9 Apr 2014 12:57:08 +0000 (07:57 -0500)]
Note commands bundled with glibc but not musl.
No idea what to do about 'em yet, but there they are.
Rob Landley [Wed, 9 Apr 2014 12:55:08 +0000 (07:55 -0500)]
Modprobe from Madhur Verma and Kyungwan Han.
Rob Landley [Wed, 9 Apr 2014 12:45:59 +0000 (07:45 -0500)]
A getty implementation from Sandeep Sharma and Kyungwan Han.
Ashwini Sharma [Wed, 9 Apr 2014 12:40:02 +0000 (07:40 -0500)]
_mkflags_ had an issue for generating FLAG_xxxx macros for long options.
Only the first __long__ option, without any __short__ option had a proper
flag value, rest all were defined to ZERO. Becaus the _flist_ was not moved
to the next in this case.
Rob Landley [Mon, 7 Apr 2014 17:53:24 +0000 (12:53 -0500)]
generated/help.h is a lot easier to read with an extra newline between each help entry.
Isaac Dunham [Fri, 4 Apr 2014 03:43:28 +0000 (22:43 -0500)]
openvt tries opening several devices to get an fd that points to the current console, without a need for read or write permissions. O_RDWR implies that both O_RDONLY and O_WRONLY would work, so skip it. Reindent.