Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 2020 20:56:01 +0200
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        Warner Losh <imp@bsdimp.com>, "Rodney W. Grimes" <rgrimes@freebsd.org>
Cc:        Kyle Evans <kevans@freebsd.org>, Alan Somers <asomers@freebsd.org>, Mateusz Guzik <mjguzik@gmail.com>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r365643 - head/bin/cp
Message-ID:  <2a7aea44-7522-7238-7d73-70c1c9d549c5@FreeBSD.org>
In-Reply-To: <CANCZdfoDpG85jSYs36-oWpxwYymTnVJ2dpAXyk9%2B3Ps7enODmw@mail.gmail.com>
References:  <CACNAnaH-L%2Bw=SJW1Cw1M63LQi19d%2Bf_8Sv%2BdYUTyE%2BjYQU6nbA@mail.gmail.com> <202009231656.08NGujEs042900@gndrsh.dnsmgr.net> <CANCZdfoDpG85jSYs36-oWpxwYymTnVJ2dpAXyk9%2B3Ps7enODmw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/23/20 7:23 PM, Warner Losh wrote:
> On Wed, Sep 23, 2020, 10:56 AM Rodney W. Grimes <freebsd@gndrsh.dnsmgr.net>
> wrote:
>
>>> cp is already fixed, people are still feeling the fallout of being
>>> within those revisions and needing to bootstrap their own cp. We can
>>> reduce the number of components these invocations rely on trivially to
>>> shell built-in mechanics, why not do so?
>> I would even go further, I would like to see the dependency on
>> /dev/null removed from the build, and the boot process.
>>
> A worthy goal, but one I'm afraid is out of our reach. A quick grep shows
> just over 200 instances of /dev/null in the Makefile and mk file (800 if
> you don't filter Makefile.in and Makefile.am). Maybe a third of those are
> due to tests and other false positives. It would be quite the effort to
> eliminate them all. And /dev/tty and /dev/zero likely will be troublesome
> too, as they are used by running programs.
>
> and how would you throw away output you know is bad / bogus without
> /dev/null?


I wonder if we could do it (at least in some cases)
by closing descriptors with 1<&- and/or 2<&-.


>  From the build because it means I would no longer have to
>> mount /dev in my chroots, and from the boot because I
>> hate to say it, but we often scribble in /dev before
>> devfs is mounted and if you look at root file systems
>> mounted on other systems you well often find a /dev/null
>> FILE that got created during the boot process from a >/dev/null
>> before devfs was mounted.
>>
> But for this issue, we're not mounting devfs early enough.  We should fix
> that. Removing /dev/null from the boot process likely is never going to
> happen because we use it all over the place to discard output... There's
> ~200 instances of it in the boot rc scripts, so getting rid of it there
> would also be quite the effort, with the same question.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2a7aea44-7522-7238-7d73-70c1c9d549c5>