Date: Fri, 13 Oct 2000 02:26:52 -0700 From: Peter Wemm <peter@netplex.com.au> To: Dag-Erling Smorgrav <des@ofug.org> Cc: dima@rdy.com, ache@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/etc rc Message-ID: <200010130926.e9D9QrG38035@netplex.com.au> In-Reply-To: <xzp66mxnmcf.fsf@flood.ping.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smorgrav wrote:
> Peter Wemm <peter@netplex.com.au> writes:
> > IMHO, the fix was what was needed given the current internals of
> > savecore(8). Do you see it differently?
>
> Yes - savecore(8) or devname(3) needs to be fixed so that /etc/rc
> doesn't need to be broken like this. savecore(8) is often run manually
> in single-user mode and should not depend on dev_mkdb(8); I think it's
> a bug in devname(3) that it does (devname(3) should use dev.db as a
> fallback in case the sysctl doesn't work, rather than the reverse).
Actually, I thought it was the other way around.. In single user,
/var/run had not been mounted and rm -rf'ed yet.
devname.c:
char *
devname(dev, type)
...
/* First check the DB file. */
r = xdevname(dev, type);
if (r != NULL)
return (r);
/* Then ask the kernel. */
if ((type & S_IFMT) == S_IFCHR) {
j = sizeof(buf);
i = sysctlbyname("kern.devname", buf, &j, &dev, sizeof (dev));
...
I suspect that what happened is that you booted, mounted the filesystems
(thereby bringing the previous stale dev.db back in /var/run), ran savecore.
Or, you used DEVFS.
The sysctl *does not work* unless devfs is active. devname() depends on
/var/run/dev.db being present in order to work, and the old savecore/dev_mkdb
ordering was wrong for non-devfs systems. Whether devname() used dev.db
or sysctl first didn't matter in this case since devfs wasn't there. Yes,
it probably should use sysctl first. Anyway:
[2:20am]~src/sbin/savecore-176# ./dumpdev
dumpdev = /dev/rda0s1b
[2:20am]~src/sbin/savecore-177# rm /var/run/dev.db
[2:20am]~src/sbin/savecore-178# ./dumpdev
dumpdev = /dev/#C:13:0x20001
This is a crude cut/paste from the savecore internals. This machine does
not have DEVFS. This had a kernel and world built yesterday.
Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010130926.e9D9QrG38035>
