From owner-freebsd-current@FreeBSD.ORG Thu Sep 1 23:25:49 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE360106566C for ; Thu, 1 Sep 2011 23:25:49 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA5C8FC0C for ; Thu, 1 Sep 2011 23:25:48 +0000 (UTC) Received: from ur.dons.net.au (ppp118-210-181-105.lns20.adl6.internode.on.net [118.210.181.105]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p81NPIW0008071 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 2 Sep 2011 08:55:25 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset=iso-8859-1 From: "Daniel O'Connor" In-Reply-To: Date: Fri, 2 Sep 2011 08:55:17 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: <853AC658-9F23-4DC1-9004-CFF6AAD108F7@gsoft.com.au> References: To: Craig Rodrigues X-Mailer: Apple Mail (2.1244.3) X-Spam-Score: 2.162 (**) BAYES_00,KHOP_DYNAMIC,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-current Current Subject: Re: Custom installer woes (can't mount / RW) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 01 Sep 2011 23:25:49 -0000 On 01/09/2011, at 18:17, Craig Rodrigues wrote: > Does it make a difference if you change this line in your script: >=20 > echo '/dev/gpt/swap / swap sw 0 0' = >>${TMPDIR}/mnt/etc/fstab >=20 > to: >=20 > echo '/dev/gpt/swap none swap sw 0 0' = >>${TMPDIR}/mnt/etc/fstab >=20 > Mounting of the root file system "/" is a very interesting thing. Ahh $CURSE, that is it! I changed it to none and now it works properly! > During early bootup, when loader(8) runs, it has to read the root file > system to find and load the kernel, > but it also reads /etc/fstab (if it is there) and sets some > environment variables, having to do with mounting the > root file system. This logic is in src/sys/boot/common/boot.c in the > getrootmount() function. The environment > variables which are set are "vfs.root.mountfrom", and > "vfs.root.mountfrom.options". >=20 > After your install script runs, you should break into the loader > before the kernel loads, and look at the value of those two > environment variables. Interestingly mountfrom is correct, I also tried setting it in the = loader to /dev/da0p2 but no change. > If there is something else wrong, you need to look into the logic > in src/sys/kern/vfs_mount.c in the vfs_mountroot() function. I wonder if there is something in this - perhaps the loader using the = first match and mount is using the last. > BTW, once you solve your issue, do you have time to review the > following document which I am in the middle > of submitting to the FreeBSD Documentation Project: >=20 > "PXE Booting with an NFS root file system" > = http://people.freebsd.org/~rodrigc/doc/doc/en_US.ISO8859-1/books/handbook/= network-pxe-nfs.html >=20 > It's not 100% related to your current issue, but I have used PXE > Booting + NFS root, to write custom installers for > FreeBSD. I had a read and it seems OK, although I didn't actually try it. You may wish to elaborate on step 14. For example, some ports will fail = to build (and probably install) unless /dev is setup correctly. I do the following to create the chroot for port builds.. sudo mount -t devfs devfs /tmp/${RELNAME}-ports/dev sudo mkdir /tmp/${RELNAME}-ports/usr/ports sudo mount -t nullfs -o ro /usr/ports /tmp/${RELNAME}-ports/usr/ports sudo mount -t nullfs -o ro /usr/src /tmp/${RELNAME}-ports/usr/src -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C