summaryrefslogtreecommitdiff
path: root/toys
AgeCommit message (Collapse)AuthorFilesLines
2015-09-02syslogd : add the buffering option to keep logs in memory buffersubmit/tizen/20150903.070527accepted/tizen/wearable/20150903.111041accepted/tizen/tv/20150903.110912accepted/tizen/mobile/20150903.110754Hyejin Kim1-4/+26
Change-Id: Ia6f475fa1e6bef4b867694a398f6f15d34480d6e
2015-08-20Merge branch 'upstream' into tizensubmit/tizen/20150901.111553accepted/tizen/wearable/20150902.004616accepted/tizen/tv/20150902.004610accepted/tizen/mobile/20150902.004600Hyejin Kim34-380/+908
And version 0.6.0 applied Change-Id: Iabc3dc2fc4bd984a114445d8b70df57eb43c3b16
2015-08-12Merge remote-tracking branch 'toybox/master' into upstreamupstreamHyejin Kim34-380/+908
2015-08-11Fix more date bugs.Elliott Hughes1-22/+29
Correctly and portably check for non-normal dates, and explicitly show the "before" and "after" dates (in the format of the user's choosing). Clear the struct tm in date_main rather than parse_default because on one path the struct tm is actually initialized. Explicitly clear the tm_sec field in parse_default because -- experiment shows -- that should not be preserved. Only do the "what does this 2-digit year mean?" dance if we actually parsed a 2-digit year. Show the right string in the error message if strptime fails. Also add more tests, and use UTC in the tests to avoid flakiness.
2015-08-11Bugfixes from Elliott Hughes: debug code got checked in (oops) andRob Landley1-3/+2
uninitialized trash in struct tm fields could segfault glibc's strftime().
2015-08-08Different tools have different ideas about what human-readable outputElliott Hughes2-3/+3
looks like. dd uses "7 MB" where du uses "7M", for example. this patch adds flags, similar to the BSD humanize_number. most callers will pass 0.
2015-08-08First pass at proper bunzip2 command line handling.Rob Landley1-11/+82
2015-08-08Fix ls -l user/group field ordering.Elliott Hughes1-6/+7
It's user then group, not the other way round.
2015-08-08login: execl() requires a path, not a file nameIsaac Dunham1-2/+2
2015-08-08Isaac Dunham pointed out that SIGINT's handler was set twice in init.c.Rob Landley1-1/+0
2015-08-08modprobe: use -q to silenceIsaac Dunham1-2/+3
2015-08-08modprobe: use basename_r()Isaac Dunham1-4/+2
2015-08-08modprobe: delete perror_exit() that makes no senseIsaac Dunham1-1/+0
Given modprobe -a, it's important to not exit early for a failure to load a module; additionally, the rest of the code presumes that this can fail without exiting.
2015-08-08Fix switch_root implementation.Alistair Strachan1-1/+24
Add the MS_MOVE of cwd to / and chroot into it. chdir is also called to ensure cwd does not point outside the chroot. The switch_root toy was also blocking any case where NEW_ROOT/init did not exist, even though NEW_INIT was a required parameter and did not have to be '/init'. Change it to handle any NEW_INIT passed as either a relative or absolute path. With this change, the switch_root toy actually works from initramfs.
2015-08-08Teach date @unixtime[.fraction], switch -s to be -D (matching busybox andRob Landley1-45/+70
not stomping on gnu's "an extra argument tells it to set the time so let's add -s to do the same thing" extension). Nanoseconds aren't uniformly supported by these apis, so had to stick it in GLOBALS() and pull it out later. Awkward, open to suggestions for a better way. (Also, the setting API is microseconds, not nanoseconds. Collect nano, convert to micro so we can switch APIs later without changing date's external UI again.) Oh, and shrink really_long_name_mktime() with a for() loop (and rename it) although I may go back and redo that for portability to hypothetical libraries if I can convert this mess to struct timespec with proper nanoseconds support. But that needs an extended strptime() which needs an extended struct tm, and between us and that is convincing posix computers got fast enough to care about fractions of a second. (Yes, I'm aware gnu added %N to date without adding it to strptime, implying they reimplemented strptime longhand inside date. I'm not doing that.)
2015-08-08Reject invalid dates in date(1).Elliott Hughes1-2/+20
Humans get upset when date(1) lets mktime(3) work out what the 99th day of the 99th month would be rather than rejecting the invalid date. For the subtly wrong cases, rather than get into the leap year business, let's rely on localtime_r(3).
2015-08-06Detect swap partitions, inline loop_partitions(), various cleanups.Rob Landley1-29/+24
2015-08-06Initialize uninitialized variable. (Oops.)Rob Landley1-0/+2
2015-08-05I've added support for running blkid without specifying a partition (so it ↵Dima Krasner1-4/+29
scans /proc/partitions).
2015-08-05Minor tweak of reboot.cRob Landley1-6/+5
2015-08-05reboot: signal init, add -f option to call reboot();Isaac Dunham2-8/+15
init: use SIGINT, use xsignal() Now that oneit supports the same signals as our "sysv"-init for shutdown, make reboot et al. signal pid 1 with the appropriate signal. Of these signals, only SIGINT works with sysvinit 2.88, causing a reboot. The others are only supported in Busybox init. Also, make init accept SIGINT and use xsignal().
2015-08-05Switch nbd_client to xconnect() and make xconnect() try all returned addressesRob Landley1-15/+1
before failing.
2015-08-05Tweak xconnect: socket can be a string (ala "ftp") from /etc/services.Rob Landley1-3/+3
Still need a rethink on how to handle socket/bind/connect sequence.
2015-08-03Factor out xconnect(), plus some other small cleanups to telnet.c.Rob Landley1-40/+6
2015-08-02Mark command-local functions static.Rob Landley15-24/+21
2015-08-02Long-overdue cleanup on login.Rob Landley1-152/+94
Only tested that it compiled so far.
2015-08-01Replace xcheckrange() with atolx_range()Rob Landley1-10/+2
2015-08-01Move strlower() from find to lib.Rob Landley1-35/+0
2015-08-01'!' replaces '/' in the sysfs paths of older drivers, so properlyIsaac Dunham1-16/+17
reverse that to get correct paths. While we're here, reduce the duplication of initialization. While this is enough for some drivers, it won't get 'input/' stuff in the right folder.
2015-07-24Promote fsync.Rob Landley1-3/+4
2015-07-24Promote hostid.Rob Landley1-1/+1
2015-07-24Attached are new toys.Sameer Pradhan3-0/+509
tftp - Client for tftp daemon. hostid -Print the numeric identifier for the current host. fsync -Synchronize a file's in-core state with storage device.
2015-07-20Fix llvm build break.Rob Landley1-1/+1
2015-07-20Merge branch 'upstream'Hyejin Kim131-2772/+4668
Change-Id: I17036143b5e644b1857e28b04d95fbd90fa2c112
2015-07-16Merge branch from toybox/masterHyejin Kim128-2170/+4680
Conflicts: both modified: lib/portability.c both modified: lib/portability.h both modified: scripts/genconfig.sh both modified: scripts/runtest.sh both added: tests/sed.test both modified: toys/other/acpi.c both modified: toys/other/ifconfig.c deleted by them: toys/other/unshare.c both added: toys/pending/hwclock.c both modified: toys/pending/ip.c deleted by them: toys/pending/sed.c both modified: toys/posix/chgrp.c both modified: toys/posix/cp.c both modified: toys/posix/id.c both modified: toys/posix/ls.c Change-Id: Ib36c5267ec054a5683ca37da2383d83b3cb1b5b4 Signed-off-by: Hyejin Kim <hyejin0906.kim@samsung.com>
2015-07-13Produce an error message for "cat /mnt", not just return code.Rob Landley1-1/+4
2015-07-10ifconfig MAC addresses should be lowercase.Elliott Hughes1-1/+1
A minor nit, but for some reason this really stands out every time I run ifconfig...
2015-07-10I added dhcpd -6 option.Yeongdeok Suh1-190/+1042
It's for supporting ipv6, and I referred to RFC 3315 Specification http://www.rfc-base.org/txt/rfc-3315.txt There are some different kind of requests in dhcpd6, but I inplemented only a basic protocol. (Solicit - Advertise - Request - Reply) There's a sample packet as below. toybox dhcpd works in the same way. http://packetlife.net/captures/DHCPv6.cap
2015-07-10find: add -inum optionGreg Hackmann1-0/+4
-inum is a commonly implemented extension to search by inode number. Linux's fs-layer tracepoints log many events in terms of inodes, so "find -inum" is useful for mapping those events back to specific files.
2015-07-10Rename a function to be more obvious, and factor out a repeated calculationRob Landley1-6/+8
the compiler was almost certainly retaining in a register anyway.
2015-07-10Promote hwclock.Rob Landley1-1/+1
2015-07-10Fix hwclock -w.Elliott Hughes1-10/+8
The gmtime_r/localtime_r error check was backwards, and the wrong argument was being passed to the RTC_SET_TIME ioctl. Also, the error reporting was misleading (showing errno for functions that don't set errno) and too vague for the user to tell what failed.
2015-07-09There is a typo in mkfifo.c for __Z__ option.Sameer Pradhan1-1/+1
2015-07-08Fix ionice.Elliott Hughes1-2/+4
ioprio_set takes a "prio" argument that combines class and level. Although bionic (via the uapi headers) includes the appropriate constants and even a convenience macro, glibc doesn't, so just hard-code the encoding. Also fix the sense of a conditional so we actually execute the provided command.
2015-07-06Avoid integer overflow with insane input data.Rob Landley1-1/+1
2015-07-05Kylie McClain pointed out that -z affects both input and output.Rob Landley1-3/+5
Can't say I'm happy with the API (-z and -Z to keep them independent would be nice), but compatibility with what exists trumps having a good API...
2015-07-04Actually set time with touch -d and -t when you don't specify nanonseconds.Rob Landley1-0/+2
There's a nanoseconds field value that says use current time, which I set but forgot to clear in the right places. (Oops.)
2015-07-03First pass on cp --preserveRob Landley1-33/+86
2015-07-03Promote xxd to other.Rob Landley1-1/+1
2015-07-03Added i option to use other interface on running dhcpd.Hyejin Kim1-3/+5