Re: [Toybox] [PATCH] fix dmesg default size/level filtering/performance

2014-11-24 Thread enh
On Mon, Nov 24, 2014 at 7:10 PM, Isaac Dunham ibid...@gmail.com wrote: On Mon, Nov 24, 2014 at 05:26:06PM -0800, enh wrote: * the kernel buffer hasn't defaulted to 16KiB for a very long time. i'm not sure why the original code said 2 rather than = 0 (or 1KiB, say), but i've left

[Toybox] -h for human units?

2014-11-24 Thread enh
is anyone already working on -h (for dd, df, and so on)? ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net

[Toybox] [PATCH] strncat bug in mountpoint.c

2014-11-25 Thread enh
strncat is a pain to use because the last argument is the remaining space in the buffer, not the buffer size. sadly glibc doesn't have strlcat... diff --git a/toys/other/mountpoint.c b/toys/other/mountpoint.c index 29b8ae6..6124129 100644 --- a/toys/other/mountpoint.c +++

[Toybox] [PATCH] fix vmstat 2

2014-11-25 Thread enh
The documentation was already correct: (With no DELAY, prints one line. With no COUNT, repeats until killed.). diff --git a/toys/other/vmstat.c b/toys/other/vmstat.c index 49c7cc7..510b3b6 100644 --- a/toys/other/vmstat.c +++ b/toys/other/vmstat.c @@ -74,7 +74,7 @@ error: void vmstat_main(void)

Re: [Toybox] [PATCH] fix vmstat 2

2014-11-25 Thread enh
; loop = loop_max; loop++) { On Tue, Nov 25, 2014 at 5:24 PM, enh e...@google.com wrote: The documentation was already correct: (With no DELAY, prints one line. With no COUNT, repeats until killed.). diff --git a/toys/other/vmstat.c b/toys/other/vmstat.c index 49c7cc7..510b3b6 100644 --- a/toys

[Toybox] changeset 1572:da1bf31ed322

2014-11-26 Thread enh
did you mean to leave the trailing ; on this line? 1.8 +if (readlinkat(dirfd, driver, driver, sizeof(driver))) {}; ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net

Re: [Toybox] [PATCH] fix dmesg default size/level filtering/performance

2014-11-26 Thread enh
On Tue, Nov 25, 2014 at 7:42 PM, Rob Landley r...@landley.net wrote: On 11/24/14 19:26, enh wrote: * the kernel buffer hasn't defaulted to 16KiB for a very long time. This command was written in 2007. :) i'm not sure why the original code said 2 rather than = 0 (or 1KiB, say), but i've

Re: [Toybox] [PATCH] fix vmstat 2

2014-12-03 Thread enh
On Tue, Dec 2, 2014 at 2:09 PM, Rob Landley r...@landley.net wrote: On 11/25/14 21:14, enh wrote: actually, loop_max =1 gives the right behavior by accident (because of the break in the loop), so setting loop_max = 0 is a better idea. Sorry for the delay in replying. I'm hip-deep in deflate

[Toybox] [PATCH] toybox SELinux chcon

2014-12-10 Thread enh
here's a patch that should let us replace toolbox's chcon. (it also adds a feature, -R, because toybox makes that so easy.) you'll probably want fancier configuration here because although the --as-needed works okay, a typical Ubuntu box will have the .so but not the .h files. i did consider

[Toybox] [PATCH] fix chown owner:group parsing

2014-12-11 Thread enh
i found a few problems while manually smoke testing toybox chown versus toolbox (NetBSD) chown... new test: #!/bin/bash [ -f testing.sh ] . testing.sh #if [ $(id -u) -ne 0 ] #then # echo SKIPPED: chown (not root) # continue 2/dev/null # exit #fi # We chown between user root and the last

[Toybox] [PATCH] getenforce and setenforce

2014-12-12 Thread enh
two more easy SELinux commands: diff --git a/toys/pending/getenforce.c b/toys/pending/getenforce.c new file mode 100644 index 000..ce43f52 --- /dev/null +++ b/toys/pending/getenforce.c @@ -0,0 +1,31 @@ +/* getenforce.c - Get the current SELinux mode + * + * Copyright 2014 The Android Open

[Toybox] mailing list archive not being updated

2014-12-15 Thread enh
the mailing list archives haven't been updated in quite a while... Note:The archive search index was last rebuilt at Friday, 28 Nov 2014 10:51:23 PST. Any postings after that will not be found by a search. Index rebuild is usally done once every 24 hours for this list. You can use a View by date

Re: [Toybox] mailing list archive not being updated

2014-12-15 Thread enh
On Mon, Dec 15, 2014 at 1:05 PM, Rob Landley r...@landley.net wrote: On 12/15/2014 11:15 AM, enh wrote: the mailing list archives haven't been updated in quite a while... Note:The archive search index was last rebuilt at Friday, 28 Nov 2014 10:51:23 PST. Any postings after

Re: [Toybox] archivers, read-write loops

2014-12-16 Thread enh
On Tue, Dec 16, 2014 at 2:34 PM, Rob Landley r...@landley.net wrote: This *roughly* corresponds to xsendfile(), but returning an off_t. ssize_t according to man 2 sendfile. I just hadn't yet because nothing was using it. If I expand it, I'd want to move towards convergence with the

[Toybox] [PATCH] use stable sort in make.sh

2014-12-16 Thread enh
those of us who need to check in generated files find that 'tr' and 'traceroute' keep swapping places. self-inflicted, yes, but not much i can do about it :-( diff --git a/scripts/make.sh b/scripts/make.sh index df74011..1cbe5e0 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -49,7 +49,7 @@

[Toybox] why does blkid imply fstype?

2014-12-16 Thread enh
is it a bug that configuring blkid forces fstype on you? (util-linux contains blkid, but 'fstype' is new to me.) ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net

[Toybox] [PATCH] remove CFG_TOYBOX_PTY

2014-12-17 Thread enh
AOSP master has pty.h and builds netcat/nc. diff --git a/lib/portability.h b/lib/portability.h index 1464c65..df40325 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -197,11 +197,8 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream); #if CFG_TOYBOX_UTMPX #include utmpx.h

Re: [Toybox] why does blkid imply fstype?

2014-12-17 Thread enh
:18 PM, Rob Landley r...@landley.net wrote: On 12/17/2014 04:04 AM, Isaac Dunham wrote: On Tue, Dec 16, 2014 at 09:30:08PM -0800, enh wrote: is it a bug that configuring blkid forces fstype on you? (util-linux contains blkid, but 'fstype' is new to me.) fstype is originally a Puppy-ism

[Toybox] [PATCH] more SELinux, plus id bugfix

2014-12-17 Thread enh
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

[Toybox] [PATCH] add missing declaration of base64_init

2014-12-18 Thread enh
diff --git a/lib/lib.h b/lib/lib.h index a51ae07..4f7cd1d 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -166,6 +166,7 @@ int copy_tempfile(int fdin, char *name, char **tempname); void delete_tempfile(int fdin, int fdout, char **tempname); void replace_tempfile(int fdin, int fdout, char **tempname);

Re: [Toybox] [PATCH] add missing declaration of base64_init

2014-12-18 Thread enh
already fixed by http://landley.net/hg/toybox/rev/eee7dfe95a8f. git confusion. On Thu, Dec 18, 2014 at 4:57 PM, enh e...@google.com wrote: diff --git a/lib/lib.h b/lib/lib.h index a51ae07..4f7cd1d 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -166,6 +166,7 @@ int copy_tempfile(int fdin, char

[Toybox] [PATCH] optional fatter cat(1)

2014-12-18 Thread enh
This basically brings the catv code into cat (but optionally enabled, like the 'big' variant of sort) and adds the missing-from-both -n option. There are a couple of options in coreutils cat still missing, and a few more still in BSD's cat, but they're pretty useless. (I've commented the missing

[Toybox] toybox in Android status

2014-12-18 Thread enh
(note that all lists were generated by hand so might not be exactly right, but should give the rough idea.) these commands weren't in toolbox but are now offered by toybox in AOSP master: acpi basename blockdev bzcat cal chgrp chroot cksum comm cut dirname dos2unix echo egrep

Re: [Toybox] [PATCH] optional fatter cat(1)

2014-12-19 Thread enh
On Fri, Dec 19, 2014 at 11:22 AM, Rob Landley r...@landley.net wrote: On 12/18/2014 09:38 PM, enh wrote: This basically brings the catv code into cat (but optionally enabled, like the 'big' variant of sort) and adds the missing-from-both -n option. There are a couple of options in coreutils

Re: [Toybox] toybox in Android status

2014-12-19 Thread enh
On Fri, Dec 19, 2014 at 12:02 PM, Rob Landley r...@landley.net wrote: On 12/19/2014 12:40 AM, enh wrote: (note that all lists were generated by hand so might not be exactly right, but should give the rough idea.) This is entire message is awesome and I'll probably devote the whole weekend

Re: [Toybox] [PATCH] optional fatter cat(1)

2014-12-19 Thread enh
I want to remove catv though. On Dec 19, 2014 13:05, Rich Felker dal...@libc.org wrote: On Fri, Dec 19, 2014 at 02:05:10PM -0600, Rob Landley wrote: On 12/19/2014 01:54 PM, enh wrote: i know there's catv and nl already in toybox, but part of my goal with moving us to toybox

Re: [Toybox] [PATCH] optional fatter cat(1)

2014-12-19 Thread enh
, enh wrote: I want to remove catv though. Is there a reason you need to, though? This seems like purely an aesthetic consideration to be balanced with the aesthetic consideration of not having catv code in the main cat. Rich -- Elliott Hughes - http://who/enh - http://jessies.org/~enh

Re: [Toybox] [PATCH] optional fatter cat(1)

2014-12-19 Thread enh
want less. (afaict, mostly for the ability to go backwards and search.) On Fri, Dec 19, 2014 at 4:30 PM, David Seikel onef...@gmail.com wrote: On Fri, 19 Dec 2014 11:54:55 -0800 enh e...@google.com wrote: (sadly the most common request seems to be ooh, does this mean we can have less now

Re: [Toybox] [PATCH] optional fatter cat(1)

2014-12-21 Thread enh
On Sun, Dec 21, 2014 at 1:07 PM, James McMechan james_mcmec...@hotmail.com wrote: On 12/20/2014 05:55:45 PM, David Seikel wrote: On Sat, 20 Dec 2014 19:30:01 -0600 Rob Landley r...@landley.net wrote: On 12/19/14 18:52, David Seikel wrote: On Fri, 19 Dec 2014 16:43:51 -0800 enh e

[Toybox] [PATCH] fix touch

2014-12-23 Thread enh
This patch: * adds -h. * switches to utimensat(2) for greater precision (and as specified by POSIX.1). * uses UTIME_OMIT rather than read-modify-write for -a/-m. * uses UTIME_NOW rather than gettimeofday(2). * fixes -d to parse fractional seconds correctly. * fixes -t to not accept fractional

Re: [Toybox] [PATCH] optional fatter cat(1)

2014-12-23 Thread enh
to know about bidi _nesting_ (if you care to support that, but it's probably useless). Rich ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net -- Elliott Hughes - http://who/enh - http

Re: [Toybox] [PATCH] optional fatter cat(1)

2014-12-23 Thread enh
On Tue, Dec 23, 2014 at 11:53 AM, Rich Felker dal...@libc.org wrote: On Tue, Dec 23, 2014 at 11:48:42AM -0800, enh wrote: Lots of us _do_ have to deal with serial terminals. Yes, I know. If you export $ROWS and $COLUMNS it'll do that instead of probe, and I can add a compile-time

[Toybox] [PATCH] fix min/max argument counts for chcon, getenforce, and setenforce

2014-12-24 Thread enh
these were in the patch that added TOYBOX_SELINUX to Config.in, but are probably a lot less contentious... should i break the non-SELinux id fixes out of the id patch too? diff --git a/toys/pending/chcon.c b/toys/pending/chcon.c index 41259de..63bc201 100644 --- a/toys/pending/chcon.c +++

Re: [Toybox] [PATCH] fix newline on stdin for

2014-12-24 Thread enh
On Wed, Dec 24, 2014 at 7:47 PM, Rob Landley r...@landley.net wrote: On 12/12/14 17:19, Robert Thompson wrote: I ran across a variance between toybox factor and coreutils factor. Coreutils factor will accept numbers on stdin separated by any whitespace (including newlines and tabs) between

Re: [Toybox] [PATCH] fix newline on stdin for

2014-12-26 Thread enh
On Thu, Dec 25, 2014 at 4:04 PM, Rob Landley r...@landley.net wrote: On 12/25/2014 01:46 AM, enh wrote: On Wed, Dec 24, 2014 at 7:47 PM, Rob Landley r...@landley.net wrote: On 12/12/14 17:19, Robert Thompson wrote: I ran across a variance between toybox factor and coreutils factor

[Toybox] various strtol bugs

2014-12-26 Thread enh
looking at changeset 1626:89384d54d49a tip Teach factor to accept whitespace separated arguments (reported by Robert Thompson). (The diff looks bigger than it is because of reindenting.) i noticed that the strtol error check is incorrect. you need to set errno to 0 before and check it

Re: [Toybox] [PATCH] fix newline on stdin for

2014-12-30 Thread enh
On Tue, Dec 30, 2014 at 11:22 AM, Rob Landley r...@landley.net wrote: On 12/30/14 00:24, enh wrote: On Sat, Dec 27, 2014 at 5:02 PM, Rob Landley r...@landley.net wrote: The problem with BSD-style licenses is that there are a lot of them (2 clause BSD, 3 clause BSD, 4 clause BSD, ISC, MIT

Re: [Toybox] [PATCH] fix newline on stdin for

2014-12-31 Thread enh
On Tue, Dec 30, 2014 at 11:49 PM, stephen Turner stephen.n.tur...@gmail.com wrote: On Dec 31, 2014 2:44 AM, enh e...@google.com wrote: In L a few things like mediaserver are still 32-bit only. More importantly for most people though, pretty much all the apps in the store are 32-bit. Oh, ok

Re: [Toybox] [PATCH] fix newline on stdin for

2015-01-01 Thread enh
On Wed, Dec 31, 2014 at 12:35 PM, Rob Landley r...@landley.net wrote: On 12/30/2014 02:14 PM, enh wrote: On Tue, Dec 30, 2014 at 11:22 AM, Rob Landley r...@landley.net wrote: On 12/30/14 00:24, enh wrote: i can save you some time there: there isn't one. bionic's getpwnam and friends will do

Re: [Toybox] toybox in Android status

2015-01-01 Thread enh
current status... not previously available, now provided by toybox: acpi basename blockdev bzcat cal chgrp chroot cksum comm cut dirname dos2unix echo egrep env expand factor fallocate fgrep find free groups head hostname killall logname losetup lspci

Re: [Toybox] toybox in Android status

2015-01-02 Thread enh
On Fri, Jan 2, 2015 at 11:20 AM, Rob Landley r...@landley.net wrote: On 01/01/2015 09:57 PM, David Seikel wrote: So if Android is switching to toybox, is my unfinished project to create a toybox installing app now obsolete? There's still stuff to do. In increasing order of difficulty: 1)

[Toybox] [PATCH] Don't check whether . or .. are RTCs.

2015-01-23 Thread enh
This probably only seems worthwhile to those of us who spend a large part of every day staring at strace output, but in case you're interested... Before (on a device with only one RTC): getdents64(3, /* 3 entries */, 4200)= 72 newfstatat(3, ., {st_mode=S_IFDIR|0755, st_size=0, ...},

[Toybox] [PATCH] mktemp fixes

2015-02-07 Thread enh
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 xx versus XX confusion. diff --git a/toys/lsb/mktemp.c b/toys/lsb/mktemp.c index c1175fe..52e53ee 100644

[Toybox] [PATCH] help kill netcfg

2015-02-07 Thread enh
netcfg is being removed, but shows up in the toybox roadmap. diff --git a/www/roadmap.html b/www/roadmap.html index 2457b4d..3f1f80f 100755 --- a/www/roadmap.html +++ b/www/roadmap.html @@ -252,7 +252,7 @@ getenforce setenforce chcon restorecon runcon getsebool setsebool load_policy pOther than

Re: [Toybox] Building AOSP...

2015-01-16 Thread enh
On Wed, Jan 14, 2015 at 12:33 AM, Rob Landley r...@landley.net wrote: On 01/13/2015 12:02 PM, enh wrote: On Mon, Jan 12, 2015 at 11:35 PM, Rob Landley r...@landley.net wrote: On 01/10/2015 05:04 PM, enh wrote: On Thu, Jan 8, 2015 at 10:55 AM, Rob Landley r...@landley.net wrote: Since

[Toybox] [PATCH] fix typo in printf

2015-01-16 Thread enh
diff --git a/toys/posix/printf.c b/toys/posix/printf.c index 5fec4f9..1c2c547 100644 --- a/toys/posix/printf.c +++ b/toys/posix/printf.c @@ -22,7 +22,7 @@ config PRINTF #define FOR_printf #include toys.h -// Detect matching character (return true/valse) and advance pointer if match. +// Detect

[Toybox] avoiding #ifdef

2015-01-16 Thread enh
thanks for changeset 1661:d4bc084916fd id.c #ifdefectomy. (ifdefs belong in headers, not in C code.). at the time i wrote the change that applied to i thought i know the style is to avoid #if, but i'm not sure what that's supposed to look like here, and now i have an example. (in particular, it

Re: [Toybox] toybox in Android status

2015-01-16 Thread enh
] ls --- missing -Z route --- superset? touch --- ours has nonstandard -l (equivalent to standard -h), better resolution. [patch sent upstream] On Thu, Jan 1, 2015 at 1:14 PM, enh e...@google.com wrote: current status... not previously available, now provided by toybox: acpi

Re: [Toybox] [PATCH] fix human_readable output for du

2015-01-17 Thread enh
worry about them one at a time. i guess i should have just gone ahead and looked at df and ls in the meantime :-) On Wed, Nov 26, 2014 at 12:48 PM, enh e...@google.com wrote: Different tools have different ideas about what human-readable output looks like. dd uses 7 MB where du uses 7M, for example

Re: [Toybox] toybox in Android status

2015-01-18 Thread enh
On Sat, Jan 17, 2015 at 11:53 AM, Rob Landley r...@landley.net wrote: On 01/17/2015 12:09 AM, enh wrote: more progress... I need to update roadmap.html. next to look at: df --- missing -h; column alignment broken. no need to support old Android output format. I have a half-finished

Re: [Toybox] toybox in Android status

2015-01-18 Thread enh
On Sat, Jan 17, 2015 at 4:59 PM, Rob Landley r...@landley.net wrote: On 01/17/2015 01:53 PM, Rob Landley wrote: On 01/17/2015 12:09 AM, enh wrote: So anyway I checked that in, and now I'm porting your patch on top of that change and I hit the _weirdest_ thing where ./touch nonexistent doesn't

Re: [Toybox] [PATCH] Seperate 'userdel' from testing syntax

2015-01-30 Thread enh
On Fri, Jan 30, 2015 at 5:41 PM, Rich Felker dal...@libc.org wrote: On Fri, Jan 30, 2015 at 03:55:02PM -0800, enh wrote: as i've said, Android doesn't have /etc/passwd (or /etc/group), and it doesn't have setpwent/getpwent/endpwent (or equivalents). you *can* do uid/gid or name lookups though

Re: [Toybox] [PATCH] Seperate 'userdel' from testing syntax

2015-01-30 Thread enh
a different userlist mechanism than /etc/passwd files and I need to do some research on the correct way to handle that. Oddly, enh (the Android guy) sent us this patch: https://www.mail-archive.com/toybox@lists.landley.net/msg01664.html Which reaches out and touches /etc/passwd for testing

Re: [Toybox] [PATCH] Don't check whether . or .. are RTCs.

2015-01-23 Thread enh
On Fri, Jan 23, 2015 at 6:18 PM, Rob Landley r...@landley.net wrote: On 01/22/15 23:11, enh wrote: This probably only seems worthwhile to those of us who spend a large part of every day staring at strace output, but in case you're interested... Before (on a device with only one RTC

Re: [Toybox] su patch

2015-02-01 Thread enh
On Sun, Feb 1, 2015 at 9:59 PM, Rob Landley r...@landley.net wrote: On 02/01/2015 10:19 PM, Rich Felker wrote: On Mon, Feb 02, 2015 at 10:33:24AM +0900, 김혜진 wrote: Hello. I share a patch of su command. ... md5 is not better and probably worse than des. You should be using bcrypt if the

Re: [Toybox] toybox in Android status

2015-01-26 Thread enh
On Sun, Jan 25, 2015 at 12:14 PM, Rob Landley r...@landley.net wrote: On 01/17/15 00:09, enh wrote: more progress... Right now toybox provides the following new commands that we didn’t have with toolbox: acpi basename blockdev bzcat cal chgrp chroot cksum comm cut dirname

Re: [Toybox] toybox in Android status

2015-01-26 Thread enh
On Sun, Jan 25, 2015 at 12:15 PM, Rob Landley r...@landley.net wrote: On 01/17/15 00:09, enh wrote: more progress... ... I’ve moved the following commands over to toybox, removing the old toolbox implementations: vmstat Going into a bit more depth on vmstat, on my netbook right now

Re: [Toybox] Building AOSP...

2015-01-10 Thread enh
On Thu, Jan 8, 2015 at 10:55 AM, Rob Landley r...@landley.net wrote: Since Toybox made it into Android, I just reinstalled my big machine with Ubuntu 14.04 so I could actually add packages to it (such as the java version the Android Open Source Project wants), and I have downloaded AOSP

Re: [Toybox] [PATCH] Fix 'cp -R' handling of symlinks

2015-01-10 Thread enh
On Sat, Jan 10, 2015 at 12:01 PM, Rob Landley r...@landley.net wrote: Again, PATH_MAX above. If somebody has a use case with a symlink longer than that, I can switch? ... I didn't do that because then it's a separate allocation requiring a separate free(). I can use it, it's just messy. for

Re: [Toybox] [PATCH] Fix 'cp -R' handling of symlinks

2015-01-09 Thread enh
it's not just cp(1). there are several other incorrect calls to readlink/readlinkat. stat(1), for example: # stat / /system/bin/stat File: `/' Size: 0 Blocks: 0 IO Blocks: 4096 directory Device: 1h Inode: 1 Links: 16 Access: (755/drwxr-xr-x) Uid: (0/root) Gid: (0/root) Access:

Re: [Toybox] Building AOSP...

2015-01-14 Thread enh
On Mon, Jan 12, 2015 at 11:35 PM, Rob Landley r...@landley.net wrote: On 01/10/2015 05:04 PM, enh wrote: On Thu, Jan 8, 2015 at 10:55 AM, Rob Landley r...@landley.net wrote: Since Toybox made it into Android, I just reinstalled my big machine with Ubuntu 14.04 so I could actually add

[Toybox] [PATCH] fix copy/paste-o in useradd.test

2015-02-18 Thread enh
diff --git a/tests/useradd.test b/tests/useradd.test index 61d5e5d..a954e72 100644 --- a/tests/useradd.test +++ b/tests/useradd.test @@ -7,7 +7,7 @@ if [ $(id -u) -ne 0 ] then - echo SKIPPED: chgrp (not root) + echo SKIPPED: useradd (not root) continue 2/dev/null exit fi

Re: [Toybox] Build issue (no reference for setns interface)

2015-03-17 Thread enh
(file nsenter.c) is declared but not defined. With Regards, Ranjan. ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net -- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ Android

Re: [Toybox] Testsuite - awk, cttyhack, mknod, nice, pwdx and unlink

2015-03-16 Thread enh
your opinion. Thanks Regards, Divya ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net -- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ Android native code/tools questions

Re: [Toybox] Did I mention the release?

2015-03-15 Thread enh
On Mon, Mar 2, 2015 at 11:17 AM, Rob Landley r...@landley.net wrote: I uploaded toybox 0.5.2, with sed, printf, shred, base64, getenforce, setenforce, chcon, mix, and nsenter added to defconfig. (so that this doesn't seem too extreme a thread-hijack, i should probably say something about the

[Toybox] [PATCH] head -X

2015-03-16 Thread enh
Allow head -X as well as head -n X. diff --git a/toys/posix/head.c b/toys/posix/head.c index e8517d4..608b93a 100644 --- a/toys/posix/head.c +++ b/toys/posix/head.c @@ -4,7 +4,7 @@ * * See http://opengroup.org/onlinepubs/9699919799/utilities/head.html -USE_HEAD(NEWTOY(head, n#0=10,

[Toybox] [PATCH] tail -X

2015-03-16 Thread enh
Allow tail -X as well as tail -n X. diff --git a/toys/posix/tail.c b/toys/posix/tail.c index e92c044..3604582 100644 --- a/toys/posix/tail.c +++ b/toys/posix/tail.c @@ -4,7 +4,7 @@ * * See http://opengroup.org/onlinepubs/9699919799/utilities/tail.html -USE_TAIL(NEWTOY(tail, fc-n-[-cn],

Re: [Toybox] [PATCH] id can work without /etc/{passwd,groups}

2015-03-19 Thread enh
running a very barebones linux install, or in other situations. However, I am not sure if my patch is the best way to do this :-) I am not so familiar with the toybox code, and may not have implemented this in the best/cleanest way. Thank you for your feedback, enh! On 3/19/15, enh e

Re: [Toybox] Did I mention the release?

2015-03-19 Thread enh
On Thu, Mar 19, 2015 at 6:52 PM, Rob Landley r...@landley.net wrote: On 03/15/2015 08:47 PM, enh wrote: this is _slightly_ misleading. you really want to look at the second list in that file. the first list tells you what's built into our toybox binary. the second list tells you what gets

Re: [Toybox] [PATCH] id can work without /etc/{passwd,groups}

2015-03-19 Thread enh
'); } - - xputc('\n'); } void id_main(void) ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net -- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ Android native code/tools

Re: [Toybox] [PATCH] id help username parameter

2015-03-19 Thread enh
://lists.landley.net/listinfo.cgi/toybox-landley.net -- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ Android native code/tools questions? Mail me/drop by/add me as a reviewer. ___ Toybox mailing list Toybox@lists.landley.net http

[Toybox] [PATCH] fix top --help

2015-03-19 Thread enh
Looks like you can't have a blank line between help and the start of the help text. Hopefully this won't cause Rob to disappear while he rewrites the scripts again, but even if it does, this makes top --help work until then :-) index 700baba..49c1f68 100644 --- a/toys/pending/top.c +++

[Toybox] [PATCH] remove wipe from roadmap.html

2015-03-11 Thread enh
I've removed wipe from toolbox. It had been broken for a long time. diff --git a/www/roadmap.html b/www/roadmap.html index 3f1f80f..ce8731b 100755 --- a/www/roadmap.html +++ b/www/roadmap.html @@ -236,7 +236,7 @@ the following commands:/p blockquoteb ls mount cat ps kill ln insmod rmmod lsmod

[Toybox] [PATCH] human_readable off by one

2015-03-13 Thread enh
137 currently returns 137 KB. diff --git a/lib/lib.c b/lib/lib.c index f70d379..2eecdf1 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -869,7 +869,8 @@ int human_readable(char *buf, unsigned long long num) int end, len; len = sprintf(buf, %lld, num); - end = ((len-1)%3)+1; + len--; + end =

[Toybox] [PATCH] Implement load_policy.

2015-03-13 Thread enh
Note that this is a case where Android's tool isn't the same as the usual tool. Ours takes an explicit file containing the policy to be loaded. I don't know what your plan/preference is for stuff like this. restorecon is at least command-line compatible, but the implementation is all in Android's

[Toybox] [PATCH] add missing space in dd output

2015-03-13 Thread enh
Also, coreutils says s instead of seconds. POSIX specifies the format of the previous two lines, but doesn't even mention this line. diff --git a/toys/pending/dd.c b/toys/pending/dd.c index a5c2452..3449104 100644 --- a/toys/pending/dd.c +++ b/toys/pending/dd.c @@ -134,9 +134,9 @@ static void

[Toybox] [PATCH] Add runcon(1).

2015-03-13 Thread enh
diff --git a/toys/pending/runcon.c b/toys/pending/runcon.c new file mode 100644 index 000..06c4aa6 --- /dev/null +++ b/toys/pending/runcon.c @@ -0,0 +1,29 @@ +/* runcon.c - Run command in specified security context + * + * Copyright 2015 The Android Open Source Project +

Re: [Toybox] perf(1)

2015-03-12 Thread enh
with clang and run on all three platforms. On Thu, Mar 12, 2015 at 6:09 AM, stephen Turner stephen.n.tur...@gmail.com wrote: On Mar 12, 2015 2:30 AM, Daniel Cegiełka daniel.cegie...@gmail.com wrote: Hi Elliott, 2015-03-12 7:09 GMT+01:00 enh e...@google.com: oh, i had a suggestion

Re: [Toybox] perf(1)

2015-03-12 Thread enh
On Thu, Mar 12, 2015 at 4:18 PM, Rich Felker dal...@libc.org wrote: On Thu, Mar 12, 2015 at 03:12:18PM -0700, enh wrote: https://android-review.googlesource.com/#/c/128430/ On Thu, Mar 12, 2015 at 3:10 PM, Rich Felker dal...@libc.org wrote: On Thu, Mar 12, 2015 at 03:07:39PM -0700, enh wrote

Re: [Toybox] perf(1)

2015-03-12 Thread enh
: On Thu, Mar 12, 2015 at 5:34 PM, enh e...@google.com wrote: thanks. i did see the recent elftoolchain discussion here but didn't realize that they were API compatible with the existing elfutils. i've raised bugs internally for people to look at switching one of our build tools over, and to consider

Re: [Toybox] perf(1)

2015-03-12 Thread enh
https://android-review.googlesource.com/#/c/128430/ On Thu, Mar 12, 2015 at 3:10 PM, Rich Felker dal...@libc.org wrote: On Thu, Mar 12, 2015 at 03:07:39PM -0700, enh wrote: there's a tool in Android that packs relative relocations. saves several MiB on the chromium webview .so. long term we'd

[Toybox] [PATCH] Update the Android section of the roadmap

2015-03-12 Thread enh
Update the Android section of the roadmap. I've removed the reference to fs_mgr, since that's really part of vold rather than a subset of mount(1), and I've removed the reference to ifconfig because we're already using the toybox ifconfig and the reference in this document to the Android command

Re: [Toybox] roadmap.html

2015-03-12 Thread enh
On Thu, Mar 12, 2015 at 11:01 AM, Rob Landley r...@landley.net wrote: On 03/11/2015 05:50 PM, enh wrote: i notice that the roadmap on the web doesn't correspond to the one in hg/git, even after the 0.5.2 release (which is now in AOSP; i synced to ToT again this afternoon). My bad, I let them

[Toybox] perf(1)

2015-03-12 Thread enh
oh, i had a suggestion for the roadmap... perf(1). there are two or three problems with perf, all of which are the kind of problems that people on this list are likely to be interested in: 1. perf itself is GPL. 2. perf uses elfutils (libelf), which is GPL. 3. you can't compile elfutils with

[Toybox] [PATCH] setenforce takes exactly one argument

2015-03-28 Thread enh
setenforce takes exactly one argument. diff --git a/toys/android/setenforce.c b/toys/android/setenforce.c index 6895746..8194484 100644 --- a/toys/android/setenforce.c +++ b/toys/android/setenforce.c @@ -2,7 +2,7 @@ * * Copyright 2014 The Android Open Source Project

[Toybox] [PATCH] Fix load_policy error reporting.

2015-03-28 Thread enh
Fix load_policy error reporting. Also switch to xopen for O_CLOEXEC paranoia and to avoid a conditional. diff --git a/toys/android/load_policy.c b/toys/android/load_policy.c index aa59f36..8496736 100644 --- a/toys/android/load_policy.c +++ b/toys/android/load_policy.c @@ -20,18 +20,13 @@ config

Re: [Toybox] Toybox : Found Issue : ls Command

2015-03-31 Thread enh
Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net -- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ Android native code/tools questions? Mail me/drop by/add me as a reviewer. ___ Toybox mailing list Toybox

Re: [Toybox] I aten't dead.

2015-02-24 Thread enh
On Tue, Feb 24, 2015 at 11:46 AM, Rob Landley r...@landley.net wrote: Sorry for the radio silence, $DAYJOB's been eating the majority of my programming time and what's left has gone to Aboriginal Linux recently, because I made a largeish design change over there (putting the base root

Re: [Toybox] I aten't dead.

2015-02-24 Thread enh
On Tue, Feb 24, 2015 at 1:48 PM, Rich Felker dal...@libc.org wrote: On Tue, Feb 24, 2015 at 01:30:20PM -0800, enh wrote: On Tue, Feb 24, 2015 at 11:46 AM, Rob Landley r...@landley.net wrote: Sorry for the radio silence, $DAYJOB's been eating the majority of my programming time and what's

Re: [Toybox] [PATCH] Seperate 'userdel' from testing syntax

2015-02-20 Thread enh
On Wed, Feb 18, 2015 at 11:10 AM, Rob Landley r...@landley.net wrote: On 01/30/2015 05:55 PM, enh wrote: On Fri, Jan 30, 2015 at 2:53 PM, Rob Landley r...@landley.net wrote: On 01/30/2015 01:56 AM, Yeongdeok Suh wrote: Hi, all, When I test toybox with toybox/tests/*.test scripts, I got many

[Toybox] [PATCH] remove unused flags from printf calls in ls.c's listfiles

2015-02-25 Thread enh
the ' ' flag doesn't mean anything for unsigned conversions. diff --git a/toys/posix/ls.c b/toys/posix/ls.c index d1a26ee..a924137 100644 --- a/toys/posix/ls.c +++ b/toys/posix/ls.c @@ -375,8 +375,8 @@ static void listfiles(int dirfd, struct dirtree *indir) } width += *len; -if

[Toybox] [PATCH] add missing argument to error_msg in mount_filesystem

2015-02-25 Thread enh
diff --git a/toys/lsb/mount.c b/toys/lsb/mount.c index c334681..f8c25e3 100644 --- a/toys/lsb/mount.c +++ b/toys/lsb/mount.c @@ -144,7 +144,7 @@ static void mount_filesystem(char *dev, char *dir, char *type, if (getuid()) { if (TT.okuser) TT.okuser = 0; else { - error_msg('%s'

[Toybox] [PATCH] fix two format string errors in ifconfig.c

2015-02-25 Thread enh
diff --git a/toys/other/ifconfig.c b/toys/other/ifconfig.c index 8db3ff0..31fc1d3 100644 --- a/toys/other/ifconfig.c +++ b/toys/other/ifconfig.c @@ -254,7 +254,7 @@ static void display_ifconfig(char *name, int always, unsigned long long val[]) xprintf(%10c, ' '); if(ifre.ifr_map.irq)

[Toybox] [PATCH] remove meaningless ' ' flag in df.c

2015-02-25 Thread enh
diff --git a/toys/posix/df.c b/toys/posix/df.c index 141e8e5..dfc0f25 100644 --- a/toys/posix/df.c +++ b/toys/posix/df.c @@ -86,7 +86,7 @@ void df_main(void) // Units are 512 bytes if you select pedantic without kilobytes. TT.units = p ? 512 : 1024; - xprintf(Filesystem% 8s-blocks\tUsed

[Toybox] [PATCH] let the compiler check format strings

2015-02-25 Thread enh
i'll be AFK for a week, so here's the patch i've been using this evening to find other format string mistakes. BSD uses __printflike and takes two arguments instead of hard-coding (1,2), but i figured that as long as you don't need the generality you'd prefer not to have it. and it's easy enough

[Toybox] [PATCH] add missing argument to error_exit in ln_main

2015-02-25 Thread enh
diff --git a/toys/posix/ln.c b/toys/posix/ln.c index 04b4f29..06700dd 100644 --- a/toys/posix/ln.c +++ b/toys/posix/ln.c @@ -40,7 +40,7 @@ void ln_main(void) if (((toys.optflagsFLAG_n) ? lstat : stat)(dest, buf) || !S_ISDIR(buf.st_mode)) { -if (toys.optc1) error_exit('%s' not a

[Toybox] [PATCH] remove accidental space in format string

2015-02-25 Thread enh
the ' ' flag makes no sense for %c. diff --git a/toys/posix/split.c b/toys/posix/split.c index d9a556b..aabf931 100644 --- a/toys/posix/split.c +++ b/toys/posix/split.c @@ -100,7 +100,7 @@ void split_main(void) if (!TT.bytes !TT.lines) TT.lines = 1000; // Allocate template for output

[Toybox] [PATCH] add missing argument to error_exit in xstrncat

2015-02-25 Thread enh
diff --git a/lib/xwrap.c b/lib/xwrap.c index 0a2b38f..14703a7 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -24,7 +24,7 @@ void xstrncat(char *dest, char *src, size_t size) long len = strlen(src); if (len+strlen(dest)+1 size) -error_exit('%s%s' %ld bytes, src, (long)size); +

[Toybox] [PATCH] add missing argument to error_msg call in sysctl's process_key

2015-02-25 Thread enh
diff --git a/toys/other/sysctl.c b/toys/other/sysctl.c index 8e57ca1..3c12058 100644 --- a/toys/other/sysctl.c +++ b/toys/other/sysctl.c @@ -97,8 +97,7 @@ static void process_key(char *key, char *value) if (!value) value = split_key(key); if ((toys.optflags FLAG_w) !value) { -

[Toybox] [PATCH] remove meaningless ' ' from %c in cp

2015-02-25 Thread enh
diff --git a/toys/posix/cp.c b/toys/posix/cp.c index 3dc6f2a..45c93e7 100644 --- a/toys/posix/cp.c +++ b/toys/posix/cp.c @@ -208,7 +208,7 @@ int cp_node(struct dirtree *try) if (*or-name == '/') dotdots = 0; if (dotdots) { - char *s2 = xmprintf(% *c%s, 3*dotdots, ' ',

  1   2   3   4   5   6   7   8   9   10   >