On Monday 19 July 2010 21:58:36 Denys Vlasenko wrote:
> On Tuesday 20 July 2010 02:27, Rob Landley wrote:
> > > However, if you need NC_110_COMPAT off, it means that you are using
> > > bbox extensions in your build system, which makes it less portable.
> >
> > Less portable than busybox is?
>
> I operate on the presumption that nc-1.10 is _the_ authoritative
> netcat as far as compat is concerned. GNU, BSD and nmap all
> screwed it up. I can't fix that, but I can do the right thing:
> not screw it up myself.

Busybox had already added features to netcat before I showed up.  (As had the 
GNU and BSD people.)  You arbitrarily picked a version that reverted several 
features that had been in busybox netcat for years, and decreed it 
"authoritative".

I don't understand why.

> > There's no portable way to launch an ftp daemon on a specific port on the
> > loopback interface, providing anonymous FTP access out of a specific
> > directory. There are four or five different ftp servers and their command
> > line arguments are all different.
> >
> > The busybox ftp server doesn't have a daemon mode, it _must_ be run from
> > inetd.  Running inetd is only really support for root to do it, and
> > requires a config file.  However, you can use netcat's server mode as a
> > poor man's inetd to launch a single program, which lets busybox netcat
> > host busybox ftpd without require root access or a config file.
>
> There is a "standard" tool for running inetd-like tools
> without inetd: tcpsvd.

Never heard of it.

> No need to invent incompatible magic netcat extensions.

A git log of networking/nc.c finds:

commit 1d7026745028982980d17b1023c4ce8ec97ea946
Author: Matt Kraai <kr...@debian.org>
Date:   Wed Feb 7 04:09:23 2001 +0000

    Add listening support.

Meanwhile there is no "tcpsvd.c" but a few minutes of rooting around fines 
network/tcpudp_perhost.c:

/* Based on ipsvd utilities written by Gerrit Pape <p...@smarden.org>
 * which are released into public domain by the author.
 * Homepage: http://smarden.sunsite.dk/ipsvd/
 *
 * Copyright (C) 2007 Denys Vlasenko.

.I note that http://smarden.sunsite.dk/ipsvd/ is 404.  According to 
archive.org, the site first showed up in 2006.

So your "standard" was apparently created in 2006 and added in 2007.  
Meanwhile, I had busybox netcat server mode working just fine in 2006, with 
full -lle support, and the basic support was added to busybox in 2001.

So your "standard" not only postdates busybox's support for this, but even the 
outside version you were copying seems to postdate busybox's traditional way 
of doing it.  (Netcat server mode was there before busybox grew menuconfig 
support.)

I'm not seeing the rationale here.

> ftpd even tells you how to run it under tcpsvd:
>
> # ftpd --help
> BusyBox v1.17.0 (2010-07-06 15:21:06 CEST) multi-call binary.
>
> Usage: ftpd [-wvS] [-t N] [-T N] [DIR]
>
> Anonymous FTP server
>
> ftpd should be used as an inetd service.
> ftpd's line for inetd.conf:
>         21 stream tcp nowait root ftpd ftpd /files/to/serve
> It also can be ran from tcpsvd:
>         tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And netcat's help text showed you how to run it as a minicom replacement:

#define nc_notes_usage "" \
        IF_NC_EXTRA( \
       "To use netcat as a terminal emulator on a serial port:\n\n" \
       "$ stty 115200 -F /dev/ttyS0\n" \
       "$ stty raw -echo -ctlecho && nc -f /dev/ttyS0\n" \
        ) \

Which didn't stop you from adding a new minicom applet.

> > > Anything else which precludes 1.17.1 release?
> > Ah, I see:
> >
> >   #if ENABLE_DESKTOP
> >   /* This one provides -t (busybox's own build script needs it) */
> >   #include "od_bloaty.c"
> >
> > So your definition of "desktop" is a build system capable of rebuilding
> > busybox.
>
> Yes. applets/usage_compressed script uses od -t. There was an alternative
> which meant to work without, but it broke big-endian builds.
>
> !DESKTOP od needs to be taught -t... when ther's time.

It is in susv4, yes.

> > And you've picked up a habit of bolting an entire second alternate
> > implementation of a given command on to busybox with a config switch to
> > choose which one you want.
>
> Out of about 340 applets, there are perhaps four such
> duplicate applets: od, ps, nc, ping. I am guilty of three of them.
> But ping isn't mine, and I even collapsed ping6 into ping.

*shrug* The shell situation counts too, and you've done a lot to clean that 
up.  I understand the temptation.  I just don't agree with it. :)

> > I'm not sure having two code paths to maintain is the path of simplicity
> > and maintainability.
>
> You are correct. When I will have time, I'll fix them one by one.
>
> > I _do_ know it means that no matter what .config I choose, I
> > can never test the full set of busybox functionality, so running nightly
> > test suites is pointless.
>
> Now "make randomconfig"-built busybox is expected to pass testsuite,
> not only "make defconfig" one. Thus, it _is_ possible to test
> both DESKTOP and !DESKTOP configs.

I'm not personally interested in performing non-deterministic testing.  I have 
enough trouble with the supposedly deterministic stuff.

> > Similarly, the linux build does this:
> >
> > find "$STAGE_DIR/include" -name ".install" -print0 -or -name
> > "..install.cmd" - print0 | xargs -0 rm
> >
> > Which results in this:
> >
> > find: unrecognized: -or
> > BusyBox v1.17.0 (2010-07-19 18:45:16 CDT) multi-call binary.
> >
> > Usage: find [PATH]... [EXPRESSION]
> >
> > I'm pretty sure that used to work.  Not sure why it isn't doing so now...
> >
> >   #if ENABLE_DESKTOP
> >                                  "-and\0"
> >                                  "-or\0"
> >         IF_FEATURE_FIND_NOT(     "-not\0"    )
> >   #endif
> >
> > Because of that.  Right, I need to ENABLE_DESKTOP in order to allow my
> > build system to work, because find -or is considered a desktop feature,
> > and defconfig doesn't enable that.  And even though find literally has 21
> > seperate config options, which is a bit much if you ask me,
>
> It evolved into that.

Probably more granularity than most people find useful.  Still, that's a semi-
aesthetic judgement call, so I can't really complain too loudly...

> > you have to enable _another_ config
> > option out of another menu entirely in order to get the obscure "-and"
> > and "- or" options...
> >
> > Right.
>
> Do you propose to make it 22th FEATURE_FIND_FANCY_AND_OR option,
> or do you want it supported unconditionally?

Personally I'd take out the #ifdefs in chunks of code that otherwise use 
IF_FEATURE().  Right now -a and -o don't have a config option, and this doesn't 
add any plumbing but just a config knob.

But it's not actually the kernel, it's my script that's dying (because my 
busybox .config used to support this), and I can change my script.  I just find 
it very non-obvious figuring out what ENABLE_DESKTOP actually does...

> > Path of least resistance is to add ENABLE_DESKTOP to defconfig, I expect.
>
> I think yes. Building kernels and toolchains is not a thing people
> are expected to do on embedded platform.
>
> If you select !DESKTOP config, it means *you* are responsible
> to ensure your system doesn't use "unnecessary" things.

I don't know what the definition of "unnecessary" is.  (I sort of understand 
what you're trying to do, but "desktop" probably isn't the right word for it.)

> Like find -or, because you can use find -o, and you can make
> your system smaller by abstaining from find -or and removing
> that code from busybox binary.
>
> But if you are building kernels, you *cant* guarantee* that.
> Who knows what fancy things are added in kernel build machinery
> tomorrow?

I submit patches to rip unnecessary crap back out of the kernel when it shows 
up.  (I still need to rewrite the perl removal stuff in C and resubmit.  I've 
missed a couple merge windows due to sheer swamped-ness...)

> Therefore, !DESKTOP is not a good idea for this use case.
> Trying to make !DESKTOP busybox to build kernels and gcc
> will basically erase all difference between DESKTOP and !DESKTOP.
>
> I switched DESKTOP to Y by default in updated
> busybox-1.17.0-build_system.patch

Cool.

> Please let me know whether now it builds for you.

I'm losing track of which patches to apply.  I grabbed the whole mess last 
night and it applied, and it didn't make anything _worse_.

Don't let me hold up the release.  I'll cope.  Releases are good. :)

Rob
-- 
GPLv3: as worthy a successor as The Phantom Meanace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to