Re: [Toybox] [landley/toybox] Add "ifconfig eth0 rename NEWNAME". (f22bec1)

2022-04-15 Thread Rob Landley
On 4/15/22 18:10, enh wrote: > yeah, and it seems to have passed on github CI anyway, so i didn't notice > until > i tried to update AOSP. > > maybe those tests are just skipped on github? > >   SKIP: ifconfig (not root) > > yep. (ideally i'd run the tests _twice_ on Android: once as root and

Re: [Toybox] [landley/toybox] Add "ifconfig eth0 rename NEWNAME". (f22bec1)

2022-04-15 Thread Rob Landley
On 4/15/22 12:21, enh-google wrote: > SIOCSIFNAME is always != 0 ... this causes a test failure on Android: > > |PASS: ifconfig dummy0 default ifconfig: '1269' > 4 bytes FAIL: ifconfig > dummy0 > mtu 1269 echo -ne '' | ifconfig dummy0 mtu 1269 && ifconfig dummy0 | grep > 1269 | > wc -l ---

Re: [Toybox] freadahead()

2022-04-12 Thread Rob Landley
On 4/12/22 20:39, enh wrote:> On Mon, Apr 11, 2022 at 11:25 PM Rob Landley <mailto:r...@landley.net>> wrote: > > On 4/11/22 19:03, enh wrote: > > On Mon, Apr 11, 2022 at 3:19 PM Rob Landley <mailto:r...@landley.net> > > <mailto:r...@landle

Re: [Toybox] freadahead()

2022-04-12 Thread Rob Landley
On 4/12/22 15:15, dmccunney wrote: > On Tue, Apr 12, 2022 at 2:25 AM Rob Landley wrote: > > And speaking of PostgreSQL: > https://www.postgresql.org/about/news/trademark-actions-against-the-postgresql-community-2302/ My link was intended to demonstrate a historical pattern

Re: [Toybox] freadahead()

2022-04-12 Thread Rob Landley
On 4/11/22 19:03, enh wrote: > On Mon, Apr 11, 2022 at 3:19 PM Rob Landley <mailto:r...@landley.net>> wrote: > Anyway, if musl and bionic have __freadahead(), I can either #ifdef the > glibc > hack for it in portability.h, or might just move xgetline()

[Toybox] freadahead()

2022-04-11 Thread Rob Landley
Elliott: could you add __freadahead() to bionic the way musl and z/os and so on have? I'm bothering the posix guys about this, thread starts here: https://www.mail-archive.com/austin-group-l@opengroup.org/msg09468.html The problem is calling getline() then calling fileno() and reading from

Re: [Toybox] toybox git: Seeking advise to refactor some functionality into lib.c

2022-04-09 Thread Rob Landley
On 4/9/22 11:36, Moritz Christian Weber wrote: > Hi, > the previous mention git (clone) toy is making progress, even as I struggled a > lot with my bad C knowledge. I look forward to this. Learning is part of the process. :) > I have a 300 LOC multi-command scaffold, which > works in most parts.

Re: [Toybox] [PATCH 2/2] Replaced sizeof by strlen in wget POST

2022-03-30 Thread Rob Landley
On 3/29/22 04:35, Moritz C. Weber wrote: > --- > toys/pending/wget.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Sorry for the delay applying these, git is really stupid sometimes: $ git am one.eml fatal: Dirty index: cannot apply patches (dirty: toys/other/chvt.c) I did a git rm

Re: [Toybox] [PATCH 0/1] Added basic post-data support to wget.c

2022-03-26 Thread Rob Landley
On 3/26/22 11:59 AM, Moritz C. Weber wrote: > Dear all, > I wrote the simple patch to enable wget for POST requests with an --post-data > option. > Sadly, patched wget and git HEAD segfault on my current build machine. I did some cleanups to wget recently (after talking to you about it), and

Re: [Toybox] [PATCH] file: don't be confused by BSS sections.

2022-03-16 Thread Rob Landley
On 3/15/22 9:30 PM, enh via Toybox wrote: > BSS sections are *expected* to claim a larger size than is actually > present in the file. Unlike program headers which have two different > size fields for the memory and file sizes, sections headers only have > one size field, so we're using the right

Re: [Toybox] Toybox tutorial videos.

2022-03-08 Thread Rob Landley
On 3/3/22 1:10 AM, Rob Landley wrote: > One of my https://patreon.com/landley goals is creating toybox instructional > videos, and that goal was met recently thanks to a generous donor, so I've > been > learning how to record and edit video. I've done a few videos at https://landle

Re: [Toybox] Toybox tutorial videos

2022-03-04 Thread Rob Landley
On 3/3/22 4:06 PM, scsijon wrote: > Try flowblade, it might be what you need. The tl;dr of the three concatenated emails is that I've finally found a recording/editing workflow that works for me: simplescreenrecorder, logitech H390 headphones, editing with blender. What I need to do NOW is edit

Re: [Toybox] [PATCH] Correct a condition to evaluate scan_uevent() result

2022-03-03 Thread Rob Landley
On 3/3/22 6:27 PM, enh via Toybox wrote: > (oops... didn't see that changyeonjo had created a github pull request already > --- this is his same change, just via a different route.) > @@ -203,7 +203,7 @@ >    } >   >    // Load uevent data, look up names in database > -  if (3

Re: [Toybox] [PATCH] Correct a condition to evaluate scan_uevent() result

2022-03-03 Thread Rob Landley
On 3/3/22 6:23 PM, enh via Toybox wrote: > Fix: 222572616 > Test: adb root && adb shell lsusb > --- > > diff --git a/toys/other/lsusb.c b/toys/other/lsusb.c > index 8d2aa13..cbe8091 100644 > --- a/toys/other/lsusb.c > +++ b/toys/other/lsusb.c > @@ -161,7 +161,7 @@ >    char *n1, *n2; >   >    if

[Toybox] Toybox tutorial videos.

2022-03-02 Thread Rob Landley
about that: Forwarded Message Subject: Re: Um, wow. Date: Sun, 20 Feb 2022 19:34:35 -0600 From: Rob Landley > Hi Robert, > thanks for the additional links. > > My offer is still vali: If you have a (server) source with the raw screencast > footage and some hints

[Toybox] It has a name now.

2022-03-02 Thread Rob Landley
Using a phone as a desktop is called "convergence". https://lwn.net/Articles/883073/#:~:text=Convergence Working on it... Rob ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net

Re: [Toybox] [PATCH] gpiod: new commands.

2022-02-22 Thread Rob Landley
On 2/21/22 7:17 PM, enh via Toybox wrote: > Equivalent to the content of the gpiod debian package. Very different > interface to the traditional Raspberry Pi command, but that command > explicitly calls itself deprecated and tells you to use the gpiod > package's commands instead. > > "Works for

Re: [Toybox] [PATCH] in seq.c rename itoa to toybox_itoa, to avoid clashes

2022-02-19 Thread Rob Landley
On 2/17/22 12:05 PM, enh via Toybox wrote: > On Thu, Feb 17, 2022 at 5:23 AM John wrote: > > This is a simple patch for seq.c to rename itoa to toybox_itoa, to avoid > > clashes with functions in the toolchain. > > > As Piraty mentioned on IIRC there are 2 different implementations of itoa in > >

[Toybox] lib/args.c tweak

2022-02-16 Thread Rob Landley
Some commands like blkid take no arguments and only use lib/args.c to ensure there's one arg, but: $ toybox blkid -file blkid: Unknown option 'file' (see "blkid --help") I _think_ that when the option string is just requiring a minimum or maximum number of arguments but has no actual

Re: [Toybox] [PATCH] lspci: use a different default location for pci.ids on Android.

2022-02-12 Thread Rob Landley
On 2/11/22 5:33 PM, enh wrote: > On Fri, Feb 11, 2022 at 3:06 PM Rob Landley Indeed. I'd forgotten that lspci already had database reading code when I > added > it to lsusb. The two file formats actually look identical, except that > pci.ids > has a third indentatio

Re: [Toybox] [PATCH] lspci: use a different default location for pci.ids on Android.

2022-02-11 Thread Rob Landley
On 2/11/22 1:29 PM, enh wrote: > Heads up that there's another one in lsusb.c. > > thanks, but we may as well wait until someone has a specific use case. > (although > it's unfortunate that there's no workaround with lsusb to specify a path like > there is with lspci.) Just noticed the

Re: [Toybox] [PATCH] lspci: use a different default location for pci.ids on Android.

2022-02-11 Thread Rob Landley
On 2/10/22 9:12 PM, enh via Toybox wrote: +if (!TT.i) TT.i = CFG_TOYBOX_ON_ANDROID ? "/vendor/pci.ids" : +"/usr/share/misc/pci.ids"; Applied. Heads up that there's another one in lsusb.c. My head scratch is I added the usb.ids one to /etc (because it seemed the obvious place for me

Re: [Toybox] chroot pondering

2022-02-10 Thread Rob Landley
On 2/10/22 3:35 PM, scsijon wrote: > On 11/2/22 08:08, toybox-requ...@lists.landley.net wrote: >> Anyway, anything like THAT would belongs in the "contain" command I've got in >> the post-1.0 todo heap instead, and possibly this does too, but for the >> record ... > I wonder if in this age, that

[Toybox] chroot pondering.

2022-02-10 Thread Rob Landley
One type of change that tends to accumulate in my tree are things I implement enough of to know how to finish it, but am not sure I SHOULD do? Here's a change I had lying around in my tree that I just cleaned up so it works, adding a new "-f" option to chroot that uses execveat() to run a binary

Re: [Toybox] Implementing ldd.

2022-01-30 Thread Rob Landley
On 1/28/22 8:09 PM, enh wrote: >> Sigh. You did ask nicely. And I'm not trying to make more work for you... >> >> (Personally, I don't write code on the assumption everybody else is dumber >> than >> me and that I know what people I've never met want/need better than they do.) > > whereas i have

Re: [Toybox] Implementing ldd.

2022-01-25 Thread Rob Landley
On 1/24/22 4:52 PM, enh wrote: >> That said, "here are the libraries" and "you have android API version skew" >> still seem like different questions. "What libraries does this binary ask >> for" >> and "does this binary fit into its filesystem" are different questions. > > (exactly. lld is the

Re: [Toybox] Implementing ldd.

2022-01-21 Thread Rob Landley
Not gonna throw stones. Speaking of, Pascal's Apology incoming... > On Fri, Jan 14, 2022 at 9:07 PM Rob Landley wrote: >> >> On 1/13/22 1:20 PM, enh wrote: >> > TL;DR: unless you're writing your own dynamic linker, i'm not sure why >> > you'd write an ldd? >&g

Re: [Toybox] Implementing ldd.

2022-01-14 Thread Rob Landley
On 1/13/22 1:20 PM, enh wrote: > TL;DR: unless you're writing your own dynamic linker, i'm not sure why > you'd write an ldd? Well to start with uClibc had a standalone one back in the day: https://git.busybox.net/uClibc/tree/utils/ldd.c Which is basically a subset of readelf, and we have

Re: [Toybox] Instructional video.

2022-01-14 Thread Rob Landley
On 1/13/22 2:29 PM, dmccunney wrote: > On Thu, Jan 13, 2022 at 2:33 PM Rob Landley wrote: > >> But yes, toysh is to the point where lack of command history is what's >> limiting >> _me_ from using it more. So I'm poking at it. But $DAYJOB (since new year's >> I'm

Re: [Toybox] Instructional video.

2022-01-13 Thread Rob Landley
Replying to the toybox list because I still have to boot a VM to log into patreon to work around their website's css bug. On 1/13/22 7:13 AM, Thomas Blankenhorn commented on your post https://www.patreon.com/posts/instructional-61084697 > PS, on a tangent: I like how nicely the toybox shell is

[Toybox] Implementing ldd.

2022-01-13 Thread Rob Landley
In theory ldd is a subset of readelf, so we've already got most of the code. In practice, the OTHER thing it does is try to dlopen() each library so it can get a path and address out of /proc/self/maps. The problem is if you're statically linked, bionic links in a dlopen() stub return ing NULL.

Re: [Toybox] [PATCH] vi: fix recent changes.

2022-01-12 Thread Rob Landley
On 1/10/22 9:07 PM, enh via Toybox wrote: > vi was segfaulting because some of the printf() arguments were the wrong > way round. The file content also wasn't getting displayed because [%dH > isn't a correct translation of tty_jump(0, y). Personally, although I > agree that tty_esc() wasn't

Re: [Toybox] [PATCH] Fix Darwin build.

2022-01-10 Thread Rob Landley
On 1/10/22 3:09 PM, enh via Toybox wrote: > The recent changes to strip harder on Linux broke Darwin, which > doesn't have those options. Applied, but I'm tempted to move some of this stuff to scripts/portability.sh since that exists now... Rob ___

Re: [Toybox] FTP Fixes

2022-01-03 Thread Rob Landley
On 1/3/22 11:06 AM, Eric Molitor wrote: > Hi Rob, > I was unclear if you were going to go through and cleanup the ftp toy or > whether > you wanted me to rev the patches to simplify/remove strrchr? I got distracted, sorry. Lemme take another look... Rob

[Toybox] mkroot tricks.

2021-12-21 Thread Rob Landley
FYI, if you have to debug something like https://github.com/landley/toybox/issues/306 where "I think this is a kernel bug in btrfs but need to reproduce it", here's how I do it. 1) Set up the musl-cross-make tools according to https://landley.net/toybox/faq.html#cross2 which is a "run overnight"

Re: [Toybox] more general sched_setattr/sched_getattr command?

2021-12-18 Thread Rob Landley
On 12/10/21 2:05 PM, enh wrote: > On Fri, Dec 10, 2021 at 3:46 AM Rob Landley Could you ask them what uclamp_validate() in kernel/sched/core.c is > trying to > do? It seems like if you've set container limits for the largest or > smallest > allowed uclamp values (like

Re: [Toybox] [PATCH] Add uclampset(1).

2021-12-11 Thread Rob Landley
On 12/10/21 1:53 PM, enh wrote: > On Fri, Dec 10, 2021 at 6:52 AM Rob Landley <mailto:r...@landley.net>> wrote: > > On 12/9/21 7:31 PM, enh via Toybox wrote: > > No standard, but part of util-linux. > > Don't default y in pending. > > yeah, s

Re: [Toybox] [PATCH] Add uclampset(1).

2021-12-10 Thread Rob Landley
On 12/9/21 7:31 PM, enh via Toybox wrote: > No standard, but part of util-linux. Don't default y in pending. USE_TASKSET(NEWTOY(uclampset)) doesn't match. Does this require root? >From a UI perspective, do we ever _not_ want -a? Sigh. It's HARD to come up with a good terse description of -R.

Re: [Toybox] more general sched_setattr/sched_getattr command?

2021-12-10 Thread Rob Landley
On 12/9/21 7:35 PM, enh wrote:> someone sent me https://man7.org/linux/man-pages/man1/uclampset.1.html > which seems to be the > util-linux offering. it certainly looks better than the Android home-grown > thing, so i've sent a patch with a

Re: [Toybox] more general sched_setattr/sched_getattr command?

2021-12-09 Thread Rob Landley
On 12/7/21 2:27 PM, enh via Toybox wrote: > is there an existing general sched_setattr/sched_getattr command somewhere > that > we can copy? we have chrt/nice/taskset for various subsets, and i think that > _between_ them they already cover everything that sched_setattr(2) can do -- >

Re: [Toybox] [PATCH] strace: fix m68k build.

2021-12-04 Thread Rob Landley
On 12/3/21 7:38 PM, enh wrote: > On Fri, Dec 3, 2021 at 4:15 AM Rob Landley <mailto:r...@landley.net>> wrote: > > On 12/1/21 5:23 PM, enh via Toybox wrote: > > --- > >  toys/pending/strace.c | 2 +- > >  1 file changed, 1 insertion(+), 1 deleti

Re: [Toybox] [PATCH] strace: fix m68k build.

2021-12-03 Thread Rob Landley
On 12/1/21 5:23 PM, enh via Toybox wrote: > --- > toys/pending/strace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, but the real problem is that different targets have different syscalls in their headers, and the C() macros build break if a given syscall isn't there. I

Re: [Toybox] Is: mkroot status? Was: are you on holls or has mail dumped?

2021-12-01 Thread Rob Landley
On 11/25/21 12:41 AM, scsijon wrote: > OK, so you've concentrated on toybox code and not sent emails out. I was > worried if it had died and you hadn't realised. > > So I am wondering what the status of mkroot in toybox is as i'm > considering a build in a easyos container to replace my

[Toybox] 0.8.6 released

2021-12-01 Thread Rob Landley
Twice as big a gap as a usual release, but 0.8.6 is out. (Yes the release notes on the web page say yesterday, but there were some last minute mkroot bugs to track down after I'd already checked in the web page update.) Rob ___ Toybox mailing list

Re: [Toybox] Is: mkroot status? Was: are you on holls or has mail dumped?

2021-11-25 Thread Rob Landley
On 11/25/21 12:41 AM, scsijon wrote: > OK, so you've concentrated on toybox code and not sent emails out. Haven't had anything to say? I've been working on toysh (which nobody else cares about until it's done), and mkroot and build plumbing. I've been blogging about it, but my blog is sadly

Re: [Toybox] are you on holls or has mail dumped?

2021-11-24 Thread Rob Landley
On 11/24/21 4:53 PM, scsijon wrote: > just wondering, nothing has appeared since the 14th of nov. commit fac49481c6b4639e5a2fad6ea08ab6cd29b9304c Author: Rob Landley Date: Mon Nov 22 23:11:03 2021 -0600 Fix $((math)) recursion order, handle "" as 0, and add more tests.

[Toybox] Poking at strace.c

2021-11-24 Thread Rob Landley
So I added the register calling conventions for the architectures that scripts/mcm-buildall.sh builds toolchains for (I.E. the ones I'm testing under qemu with scripts/mkroot.sh), but when I tried to build strace for the sh4 target it went "boing" a lot because the available syscalls don't

[Toybox] Question about android's header generation policy.

2021-11-12 Thread Rob Landley
Why is Android checking in generated files again? I ask because I'm fiddling with scripts/single.sh so it doesn't depend on .config existing. (It should make a temporary defconfig to harvest symbols from in that case; I'm going down a rathole of adding record-commands support to mkroot.sh which

Re: [Toybox] ftpget - Fixes and minor new features.

2021-11-12 Thread Rob Landley
On 11/7/21 12:46 PM, Eric Molitor wrote: > Aye, the backside of FTP can't come soon enough. Even sftp, basically FTP > protocol over SSH, needs to die. The same Microsoft developer who removed FTP support from chrome just implemented a way for sites to disable "view source":

Re: [Toybox] ftpget - Fixes and minor new features.

2021-11-06 Thread Rob Landley
On 11/5/21 11:54 PM, Rob Landley wrote: > On 11/2/21 2:00 PM, Eric Molitor wrote: >> Attention should be paid to the change to portability.h. I believe this is >> the >> correct way to expose memrchr for glibc. I've tested it and it works with >> glibc >> b

Re: [Toybox] ftpget - Fixes and minor new features.

2021-11-05 Thread Rob Landley
On 11/2/21 2:00 PM, Eric Molitor wrote: > Attention should be paid to the change to portability.h. I believe this is the > correct way to expose memrchr for glibc. I've tested it and it works with > glibc > but I primarily use MUSL. I'm uncomfortable trying to guess which combinations of const

Re: [Toybox] ftpget: Remove

2021-10-29 Thread Rob Landley
On 10/29/21 1:16 PM, enh wrote: > On Fri, Oct 29, 2021 at 10:47 AM Rob Landley <mailto:r...@landley.net>> wrote: > > On 10/29/21 10:51 AM, enh via Toybox wrote: > > i don't have much of an opinion here, but i was wondering about the > usefulness >

Re: [Toybox] ftpget: Remove

2021-10-29 Thread Rob Landley
On 10/29/21 11:22 AM, Eric Molitor wrote: > I genuinely had trouble finding an FTP server to test until I remembered those > two. Regarding libxml2 it's poorly documented but you can pull source from > http://xmlsoft.org/sources/ *but* I believe most > people these

Re: [Toybox] ftpget: Remove

2021-10-29 Thread Rob Landley
On 10/29/21 10:51 AM, enh via Toybox wrote: > i don't have much of an opinion here, but i was wondering about the usefulness > of this in a world where all the major browsers have now removed ftp > support... > is anyone likely to still be using ftp by the time toybox hits 1.0? Other than me?

Re: [Toybox] WGET: OpenSSL and BoringSSL Patch

2021-10-29 Thread Rob Landley
On 10/29/21 7:03 AM, Eric Molitor wrote: > Attached is a reworked patch which adds OpenSSL and BoringSSL support to wget. > It avoids the use of OpenSSL's IO abstractions and uses default settings which > should be sensible on any modern OpenSSL (1.1+) or BoringSSL version. I'm a little

Re: [Toybox] [PATCH] wget: cleanup, add support for file disposition and fix HTTP protocol version

2021-10-28 Thread Rob Landley
On 10/28/21 9:57 AM, Eric Molitor wrote: > Ok this annoyed me so I just added direct OpenSSL support parallel to the > LibTLS > support. Elliot, the OpenSSL version should work with the latest versions of > BoringSSL that Android is using. I applied the previous one (the v2 with one library),

Re: [Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-28 Thread Rob Landley
On 10/27/21 7:27 PM, enh wrote: > >     > yeah, you just need the `ln -s`s. > > > >     The ones under: > > > >         if [ ${TARGET_ARCH} = x86 -o ${TARGET_ARCH} = x86_64 ]; then > > > >     Which apparently don't have a corresponding arm version? > > > >

Re: [Toybox] [PATCH] wget: cleanup, add support for file disposition and fix HTTP protocol version

2021-10-27 Thread Rob Landley
On 10/27/21 11:58 AM, Eric Molitor wrote: > Final patch which adds TLS support. > > - Eric Hmmm, the lib stuff is awkward. (If you have more than one installed, I think it will try to link to both. Which seems unlikely to work? And I dunno what android calls boringssl. It would be nice if there

Re: [Toybox] [PATCH] xfork: fix #if.

2021-10-27 Thread Rob Landley
On 10/27/21 11:14 AM, enh via Toybox wrote: > Fixes 298 where `make allyesconfig` failed with an undefined reference > to xfork(). The CFG_XXX macros are always #defined, to either 0 or 1. So #if is correct. What you just did was disable the test. What's happening here is allyesconfig is

Re: [Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-26 Thread Rob Landley
On 10/26/21 7:35 PM, enh via Toybox wrote: > >     Right, you disabled builtins, > > > > yeah, to try to reduce mksh/toybox confusion. if/when we switch /bin/sh > to > > toybox it should reduce compat issues too. I note that toysh has to call both NOFORK and MAYFORK commands as

Re: [Toybox] [PATCH] wget: cleanup, add support for file disposition and fix HTTP protocol version

2021-10-26 Thread Rob Landley
On 10/26/21 9:05 AM, Eric Molitor wrote: > Attached is an initial cleanup of wget. This addresses a number of defects > with > the existing implementation and generally cleans up the code. I've squashed > the > commits but can provide a more incremental set of patches if desired. I have > two >

Re: [Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-25 Thread Rob Landley
On 10/25/21 4:53 PM, enh wrote: > On Thu, Oct 21, 2021 at 12:18 AM Rob Landley On 10/20/21 4:35 PM, enh wrote: > > if you don't mind creating a /system directory (or symlink) in /, you > can just > > run like that. there's a script in AOSP bionic that sets up al

Re: [Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-21 Thread Rob Landley
On 10/20/21 4:35 PM, enh wrote: > On Tue, Oct 19, 2021 at 11:56 PM Rob Landley <mailto:r...@landley.net>> wrote: > On 10/19/21 10:57 AM, enh wrote: > > my guess is that you're using a statically-linked binary? > > Yup. I can't test dynamic bionic on dev

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-20 Thread Rob Landley
On 10/20/21 3:45 PM, Eric Molitor wrote: > I need to sort out a few more defects but will try both BoringSSL and the FIPS > Version of OpenSSL 3.0. In theory both should "just work" with this > integration. > Albeit with the caveat that FIPS 140-2 verification ended last mouth and I > don't >

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-20 Thread Rob Landley
On 10/20/21 12:50 PM, enh wrote: > general idea. To be honest, making puppy eyes at him to use his work > under 0BSD > and then cleaning it up to be a proper lib/tls.c that toybox and busybox > could > share would be good. Busybox already has ) > > does that seem likely? If I ask

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-20 Thread Rob Landley
On 10/20/21 11:51 AM, enh wrote: > for the ignorant (like me) --- are these libraries like BearSSL an extra > abstraction on top of stuff like openssl/boringssl, or are they roughly > equivalent? Roughly equivalent. Think openssh vs dropbear. > (i'm just thinking ahead to what i'd have to do to

Re: [Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-20 Thread Rob Landley
On 10/19/21 10:57 AM, enh wrote: > are you sure? remember that if a test is currently checked in [and Android > uses > the toy; my test runner reports but ignores failures for tests where readlink > says it's not actually toybox], that means that the tests pass on Android. > > there's even a CTS

[Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-19 Thread Rob Landley
Bionic's wcwidth() returns -1 (error) for combining characters, where glibc and musl return 0 (does not increase the collective width of the displayed characters). This means crunch_str() can't measure the length of the output, so cut -C behaves like cut -c. I admit the man page is written a bit

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-18 Thread Rob Landley
On 10/17/21 2:48 PM, Eric Molitor wrote: > Let me take a look at signify I'll also send the missing part of the patch > with > -ltls shortly. > > Alpine has libtls, either the openssl port in the libretls package or the > original openbsd lbressl-tls. For my embedded stuff I'm statically linking

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-18 Thread Rob Landley
On 10/18/21 4:22 AM, Eric Molitor wrote: > Updated patch including make.sh. > > On Alpine to build install libretls-dev which should pull in the dependencies. > For my embedded builds I manually build BearSSL and > https://github.com/michaelforney/libtls-bearssl >

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-17 Thread Rob Landley
On 10/17/21 8:44 AM, Eric Molitor wrote: > Attached is a relatively quick and certainly dirty patch to wget adding TLS > support via libtls. https://landley.net/toybox/design.html#:~:text=policy%20on%20shared%20libraries > I threw this together on a plane but it's working reasonably > well for

Re: [Toybox] [New Toy] hexdump/hd

2021-10-04 Thread Rob Landley
Wrote this on the plane last night but couldn't send it then: On 9/25/21 6:34 PM, Moritz Röhrich via Toybox wrote: > Dear Mr Landley, Sorry for the delay replying to this one, it got caught in gmail's spam filter. > attached is a patch for a naive hexdump implementation. It can do hexadecimal,

Re: [Toybox] Pending todoness.

2021-10-01 Thread Rob Landley
On 9/30/21 8:48 PM, enh wrote: > > On Tue, Sep 28, 2021, 18:04 Rob Landley > That said, according to the man page literally all linux32 does is tell > > uname to lie. It has no actual effect on the rest of the ABI. (There are > > setarch options that do, but I did

Re: [Toybox] Pending todoness.

2021-09-28 Thread Rob Landley
On 9/28/21 7:44 PM, enh wrote: > ...oh, and that personality() wasn't an inline. i've sent a patch to fix that > (and with that, things build again on my mac). this still feels like a worse > choice than just splitting linux32 out though... If I'd known it was going to cause this much trouble, I

Re: [Toybox] [PATCH] Fix macOS build.

2021-09-28 Thread Rob Landley
On 9/28/21 7:42 PM, enh via Toybox wrote: > > --- > >  lib/portability.h | 2 +- A better solution than the one I already committed before I saw this. :) Why are we not feeding --gc-sections to the mac linker? (I'm guessing it's a mach-o limitation?) Rob

Re: [Toybox] Pending todoness.

2021-09-28 Thread Rob Landley
On 9/28/21 11:55 AM, enh wrote: > Thoughts/explanation of how I misunderstood what you were asking here? (We > build > uname for macOS host builds, so I can't sync toybox if uname doesn't build.) (Explanation: now that uname.c doesn't have any other #ifdefs in it, I wanted to fix this in

Re: [Toybox] Pending todoness.

2021-09-28 Thread Rob Landley
On 9/28/21 11:55 AM, enh wrote: > Thoughts/explanation of how I misunderstood what you were asking here? (We > build > uname for macOS host builds, so I can't sync toybox if uname doesn't build.) I thought I fixed macos in commit 7af571d485b7? #ifdef __linux__ #include #else #define

Re: [Toybox] [PATCH] lsof: explicit size for device major:minor buffer.

2021-09-26 Thread Rob Landley
On 9/25/21 8:55 PM, enh via Toybox wrote: > These are 2 hex digits each with a ':' between them in the kernel. Major has been 12 bits and minor 20 bits since 2003. (Git annotate on the header says https://github.com/mpe/linux-fullhistory/commit/7ae6a13832a2 .) So xxx:x, which is why I used a

Re: [Toybox] [PATCH] pmap: cleanup.

2021-09-26 Thread Rob Landley
On 9/25/21 8:44 PM, enh via Toybox wrote: > Remove unbounded scanfs. *shrug* I tend to trust data that comes from the kernel via a mount point put there by root, but if it's bothering you... (I've never actually used pmaps, I always just look at /proc/$PID/maps or /proc/$PID/smaps directly...)

[Toybox] Does anybody want to create a new "man 2 ioctl_list"?

2021-09-25 Thread Rob Landley
Michael Kerrisk deleted the old ioctl_list man page last year because nobody was maintaining it: https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man2?id=3de87d46840d But it's not actually that _hard_, just time consuming. There are about 3500 interesting ioctl macro

Re: [Toybox] Pending todoness.

2021-09-25 Thread Rob Landley
On 9/25/21 3:02 PM, enh wrote: > macOS prints "Darwin", which i assumed was what you wanted? (the built-in > macOS > uname doesn't have -o.) That's the kernel type. (Default output is -s.) Added help text describing -o as the userspace type. Made it just always say "Toybox". I ripped out the

Re: [Toybox] [PATCH] chvt: remove old workarounds.

2021-09-25 Thread Rob Landley
On 9/25/21 3:21 PM, enh wrote: > > > On Sat, Sep 25, 2021 at 9:30 AM Rob Landley <mailto:r...@landley.net>> wrote: > > On 9/24/21 7:10 PM, enh via Toybox wrote: > > We don't need the fd=fd hack for GCC 3.4 in 2021, > > Yeah, but we still ne

Re: [Toybox] [landley/toybox] timeout: use the monotonic clock. (81859b8)

2021-09-25 Thread Rob Landley
On 9/25/21 3:01 PM, enh-google wrote: > E5ten said: > > As far as I know, passing NULL for the 2nd parameter is equivalent to using > > a sigevent that specifies delivery of SIGALRM, so I think this can be > > removed and the 2nd parameter would be changed to 0. > > i think you're right about the

Re: [Toybox] Pending todoness.

2021-09-25 Thread Rob Landley
On 9/16/21 8:37 PM, enh wrote: > (i think you need a needspace=1 in the Android case to make things like `uname > -os` look right; "AndroidLinux" vs "Android Linux"? and the non-Android case > now > behaves differently than other unames for `uname -os`; just "Linux" rather > than > "Linux

Re: [Toybox] [PATCH] blkid: more scanf fun.

2021-09-25 Thread Rob Landley
On 9/24/21 7:55 PM, enh via Toybox wrote: > The unbounded %[] here made me look at the kernel, where the size of a > block device name is limited to 32 bytes (including the NUL), so > although the 1024 bytes of toybuf was plenty, that meant that the > 32-byte buffer for "/dev/%s" was too small

Re: [Toybox] [PATCH] chvt: remove old workarounds.

2021-09-25 Thread Rob Landley
On 9/24/21 7:10 PM, enh via Toybox wrote: > We don't need the fd=fd hack for GCC 3.4 in 2021, Yeah, but we still needed it in 2018. *cracks knuckles* The power of grep '[ ,]\([a-zA-Z0-9_][a-zA-Z0-9_]*\) *= *\1' *.c lib/*.c toys/*/*.c compels you! Noise, noise, noise... toys/net/sntp.c:

Re: [Toybox] [PATCH] getline() returns -1 on EOF, not 0.

2021-09-25 Thread Rob Landley
On 9/24/21 6:51 PM, enh via Toybox wrote: > ...but you can get 0 if you have a "no newline at end of file" file. > > I've been through all the current callers, and just these ones weren't > using the canonical test. > --- >  toys/lsb/mount.c       | 2 +- >  toys/pending/init.c    | 2 +- >  

Re: [Toybox] [PATCH] Fix non-Mac build.

2021-09-25 Thread Rob Landley
You've been busy. On 9/24/21 6:44 PM, enh via Toybox wrote: > Should have used #ifdef, not #if. (Really wish I could cross-compile for > the Mac!) Got that one already. :) Rob ___ Toybox mailing list Toybox@lists.landley.net

Re: [Toybox] Canonical Extending Ubuntu 14.04/16.04 LTS Support To Ten Years - Phoronix

2021-09-22 Thread Rob Landley
On 9/21/21 8:18 PM, enh via Toybox wrote: > Ironically I couldn't find a canonical source for this, but a couple of other > sites have a similar story (but different enough to make me think there really > is a Canonical press release doing the rounds). 

Re: [Toybox] [PATCH] grep: Make --color highlight all matches on a line.

2021-09-21 Thread Rob Landley
On 9/21/21 1:54 PM, Peter Collingbourne via Toybox wrote: > This matches the behavior of GNU grep. Well, _sort_ of. The test you added won't pass TEST_HOST because: $ echo hello | grep --color=always l | hd 68 65 1b 5b 30 31 3b 33 31 6d 1b 5b 4b 6c 1b 5b |he.[01;31m.[Kl.[| 0010

Re: [Toybox] [PATCH] uptime: trivial modernization.

2021-09-21 Thread Rob Landley
On 9/21/21 2:56 PM, enh via Toybox wrote: > (I was looking at this code because I was looking at the output in a bug > report, and wasn't sure what `up  1:09` meant. It's annoying that -p is > a lot more readable, but doesn't include load averages, otherwise I'd be > tempted to move Android's

Re: [Toybox] [PATCH] strace: initial commit.

2021-09-17 Thread Rob Landley
On 9/17/21 5:54 PM, enh via Toybox wrote: > i know when rob's talked about "toybox strace", he meant one with no decoding, > just raw numbers. that doesn't really let me replace "real" strace though > (which > was already a PITA to update, and switched to GPL a year or two back anyway). > the

Re: [Toybox] Pending todoness.

2021-09-16 Thread Rob Landley
On 9/16/21 8:14 PM, enh wrote: > given that we've never had a `uname -o` on Android before, by definition > no-one > can have any expectations of what it should output, so seems fine to me. (you > could make the same argument for just letting it output "Linux", of course, > but That's what

[Toybox] Pending todoness.

2021-09-16 Thread Rob Landley
I'm trying to flamethrower the tree into something releasable, and a lot of commits I haven't checked in are because I'm not sure about them. This one isn't _entirely_ my call: --- a/toys/posix/uname.c +++ b/toys/posix/uname.c @@ -4,7 +4,7 @@ * * See

Re: [Toybox] [PATCH] rmmod: various fixes.

2021-09-11 Thread Rob Landley
On 9/11/21 12:25 PM, enh wrote: > i'm not usually a pro-bloat kind of guy, but whenever i'm dealing with > modules i > wish the kernel just came with example1.ko and example2.ko for me to mess > around > with without actually causing any problems! I could presumably build some myself, but

Re: [Toybox] [PATCH] reboot/halt/poweroff: add -d.

2021-09-11 Thread Rob Landley
On 9/10/21 6:31 PM, enh via Toybox wrote: > busybox has a -d that delays before proceeding. Annoyingly systemd also > has a -d, but that's to disable writing a wtmp shutdown entry. I've mostly said SECONDS and then had toybox --help explain about the fraction, but I'm aware that users aren't

Re: [Toybox] [PATCH] rmmod: various fixes.

2021-09-11 Thread Rob Landley
On 9/10/21 6:10 PM, enh via Toybox wrote: > My original intent was to just get rid of the meaningless O_EXCL, which > isn't used by the kernel, after noticing that it's passed here but not > in modprobe's module removal code. > > But then I noticed that other rmmod implementations allow you to

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-04 Thread Rob Landley
On 9/2/21 7:12 PM, enh wrote: > On Thu, Sep 2, 2021 at 4:37 PM Rob Landley > to me, if the open() succeeded but the write() failed --- we're in weird > > uncharted "shouldn't happen" territory, and probably want to know? > > Hmmm, I thought the open woul

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-03 Thread Rob Landley
On 9/2/21 2:58 PM, enh wrote: > That's why android-ndk-r21d isn't producing this warning. > > yeah, sorry: this is for the _host_ toybox (so glibc right now). It's not doing it in my host build. Do I have to #define FORTIFY_STUFF somewhere... # if __USE_FORTIFY_LEVEL > 0 # define __wur

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-02 Thread Rob Landley
On 9/2/21 2:47 PM, enh wrote: > On Wed, Sep 1, 2021 at 3:00 PM Rob Landley <mailto:r...@landley.net>> wrote: > > On 8/31/21 11:16 AM, enh via Toybox wrote: > >   toys/posix/tar.c:821:7: error: ignoring return value of > >   function declared with

<    2   3   4   5   6   7   8   9   10   11   >