From owner-cvs-all Fri Oct 13 2:27: 2 2000 Delivered-To: cvs-all@freebsd.org Received: from netplex.com.au (adsl-64-163-195-99.dsl.snfc21.pacbell.net [64.163.195.99]) by hub.freebsd.org (Postfix) with ESMTP id 5DF9A37B502; Fri, 13 Oct 2000 02:26:59 -0700 (PDT) Received: from netplex.com.au (peter@localhost [127.0.0.1]) by netplex.com.au (8.11.0/8.9.3) with ESMTP id e9D9QrG38035; Fri, 13 Oct 2000 02:26:53 -0700 (PDT) (envelope-from peter@netplex.com.au) Message-Id: <200010130926.e9D9QrG38035@netplex.com.au> X-Mailer: exmh version 2.1.1 10/15/1999 To: Dag-Erling Smorgrav Cc: dima@rdy.com, ache@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/etc rc In-Reply-To: Date: Fri, 13 Oct 2000 02:26:52 -0700 From: Peter Wemm Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dag-Erling Smorgrav wrote: > Peter Wemm 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