From owner-freebsd-current@FreeBSD.ORG Fri Mar 28 15:51:08 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7760E37B401; Fri, 28 Mar 2003 15:51:08 -0800 (PST) Received: from perrin.int.nxad.com (internal.ext.nxad.com [69.1.70.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE81143F85; Fri, 28 Mar 2003 15:51:07 -0800 (PST) (envelope-from sean@perrin.int.nxad.com) Received: by perrin.int.nxad.com (Postfix, from userid 1001) id DB1EE2105D; Fri, 28 Mar 2003 15:51:06 -0800 (PST) Date: Fri, 28 Mar 2003 15:51:06 -0800 From: Sean Chittenden To: Robert Watson Message-ID: <20030328235106.GA10799@perrin.int.nxad.com> References: <20030328215316.GA8340@perrin.int.nxad.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ cc: current@FreeBSD.org Subject: Re: init not loading? why? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2003 23:51:09 -0000 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > Ah! Figured it out after reading through init's src: /dev didn't > > exist therefore the machine wouldn't start. No good. I may find > > a place to stick this got'cha in the docs or add an mkdir() call > > to init. > > mkdir(2) on / is not going to work if / is readonly. The kernel > actually tries to do a vop_mkdir() already, I think. The eventual > solution is probably a rootfs (blaim mux). Well, I haven't tested this, but I think you're right that it's nmount() that's failing and the lack of a check on it's return value. I haven't tested this beyond compiling it, but I suspect it'll work and fix this corner case. -sc -- Sean Chittenden --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch Index: init.c =================================================================== RCS file: /home/ncvs/src/sbin/init/init.c,v retrieving revision 1.55 diff -u -r1.55 init.c --- init.c 17 Dec 2002 21:23:36 -0000 1.55 +++ init.c 28 Mar 2003 23:48:07 -0000 @@ -304,7 +304,10 @@ iov[3].iov_base = _PATH_DEV; iov[3].iov_len = sizeof(_PATH_DEV); } - nmount(iov, 4, 0); + if (nmount(iov, 4, 0) < 0) { + perror("nmount failed (" _PATH_DEV ")"); + _exit(1); + } if (s != NULL) free(s); } --Qxx1br4bt0+wmkIi--