Date: Fri, 25 Sep 2020 10:36:05 -0700 (PDT) From: "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Warner Losh <imp@bsdimp.com>, "Rodney W. Grimes" <rgrimes@freebsd.org>, 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: <202009251736.08PHa5nS051530@gndrsh.dnsmgr.net> In-Reply-To: <20200923224933.GL2570@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Wed, Sep 23, 2020 at 11:23:51AM -0600, 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? > > > > >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. > I would like to see some evidence for this actually occuring. > > We mount devfs instance before root (yes), to get the device nodes > available, so we can specify device name for root mount from loader. > After mounting root we do a rearrangement to move devfs to /dev, which > is somewhat tricky due to e.g. namecache. > > I do not see how could anything in userspace even touch the underlying > directory on rootfs of the /dev devfs mount. > > OTOH, it is a usual problem with /tmp getting dirty, and the garbage > hidden with tmpfs/md UFS mount over /tmp. I consistantly find a /dev/null FILE on most systems when I take a volume out of one machine and mount it as a non-boot volume. I believe you can also see these in the underlying file system on UFS with dump, or with zfs send. -- Rod Grimes rgrimes@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009251736.08PHa5nS051530>