Skip site navigation (1)Skip section navigation (2)
Date:      18 Feb 2003 13:18:41 -0500
From:      Chris Shenton <chris@shenton.org>
To:        current@freebsd.org
Subject:   Diskless: 5.0R scripts, boot, NFS mount problems I didn't have in 4.7S
Message-ID:  <87el65pi4e.fsf@Pectopah.shenton.org>

next in thread | raw e-mail | index | archive | help
I was running a VIA Mini-ITX diskless box off a 4.7-STABLE box for a
while using a root fs created by the clone_root discussed in the
handbook, then some tweaks.  I'm having a heck of a time trying to get
this running under 5.0-RELEASE, now sync'd to 5.0-CURRENT as of
yesterday, then mergemastered.

If someone can provide some clues or pointers, I'd be happy to doc how
I get it to work (for the Handbook?) and could take a stab at updating
clone_root for 5.x if it's needed.


Background:

Been using FreeBSD since 2.2.x.  I can code. I can RTFM. :-)

I've read the 5.0 Release Notes and Early Adopters docs.

I've read Handbook section "19.6 Diskless Operation" and it covers the
DHCP, PXE, TFTP, and NFS OK but glosses over how the diskless box
actually boots -- what scripts it runs and such. That's where I'm
stuck. How does a diskless box know to run a diskless boot script
(rather than a standard one)? I'm assuming it invokes init which runs
/etc/rc, which then runs /etc/rc.d/* in the 5.0 model.  Am I close?

I've read Handbook "7.6 Init" but it doesn't actually say much about
how init hands off to the rc* scripts.  The man for rc(8) seems to
document the 5.0 rc.d/* well so I'll revisit my diskless boot process. 


Here's what I have working so far:

* isc-dhcpd: offers hostname, IP, location of boot image, root
  filesystem location 
* tftpboot: offers pxeboot
* pxeboot: gets and runs kernel, mounts root filesystem

Then it begins the init/rc startup process and eventually dies. 


Here's what I've found broken or I can't get past:

The clone_root assumes it's copying all the files it needs but (for
example) mtree now lives in /usr/sbin instead of /sbin, so it's not
copied to the diskless root area so it's not available. "kenv" lives
in /usr/bin, but /usr isn't mounted before kenv is used in
rc.diskless1.  clone_root wants to run "/dev/MAKEDEV" but that file
doesn't exist in my 5.0 /dev/; I see it in /usr/src/etc/ but it wasn't
install by "make installworld" or "mergemaster". (Is this a glitch?)

The rc.diskless[12] scripts have changed significantly from 4.7 to
5.0. Are they even used with the new /etc/rc.d/* mechanism?

I've run clone_root then manually installed a DISKLESS kernel file
into the new location ($DISKLESSROOT)/boot/kernel/kernel. I've
manually populated $DISKLESSROOT/conf/default/etc/ with an
NFS-oriented fstab, rc.conf, rc.diskless*, and rc.d/[init]diskless and
password-related files.

Upon boot, after kernel loaded, console shows a bunch of rc.conf-style
vars being set, then spews some debugging which I put in
$DISKLESSROOT/conf/default/etc/rc.d/diskless, so it's running that
rather than the old /etc/rc.diskless* files. I've moved the "mount -a"
near the top of rc.d/diskless since it runs commands which are and not
available until /usr is mounted (e.g., mtree).  The NFS mount fails
with a message I don't understand:

  [udp] pectopah.shenton.org:/usr: RPCPROG_NFS: RPC: Unknown host

This occurs whether I specify a bare hostname, fqdn or IP addr in
fstab, even if I put host info in $DISKLESSROOT/conf/default/etc/.  Is
it really complaining about hosts? or is it an rcpbind thing?  Note
that it has already mounted the root filesystem a while back.

Since it can't mount /usr, everything else fails. 


Can someone point me in the right direction ?  Thanks!

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87el65pi4e.fsf>