net-booting the install disks (Re: 8.x grudges)

Daniel Braniss danny at cs.huji.ac.il
Fri Jul 9 06:27:24 UTC 2010


> On Thu, Jul 08, 2010 at 11:08:04AM -0400, Mikhail T. wrote:
> > 08.07.2010 09:53, Jeremy Chadwick написаÐ=²(ла):
> > >Then don't modify loader.conf.  Instead, once the "Welcome to FreeBSD!="
> > >portion of loader appears, press "6" to shell to the loader prompt
> > >and type:
> > >
> > >set vfs.root.mountfrom="ufs:/dev/md0"
> > >boot
> > Yes, that works... It just should not be necessary.
> 
> Okay, so let me get this straight.  First the complaint was that you had
> to modify loader.conf, which involved extracting the CD image, editing
> the file, yadda yadda.  Now that you've been shown you don't have to
> edit loader.conf, the complaint is "it shouldn't be necessary".  :-)
> 
> There's actually quite a bit about FreeBSD that "shouldn't be> necessary" (from an administrator's point of view), but that's a
> completely separate issue when compared to your "when I do thing X in
> the kernel config, it breaks".  Which of those two approaches do you
> want to focus on?
> > > Red Hat's "kickstart" does not require one to extract CD-images to
> > fiddle with a couple of lines, and FreeBSD comes tantalizingly close
> > to offer the same functionality.  Just not quite :-(
> > I've PXE booted Ubuntu and Debian.  It was easy to accomplish (read:
> easier than FreeBSD) because they offer pxelinux vs. FreeBSD's pxeboot.
> > pxelinux[1] offers the ability to read a configuration file via TFTP,
> which configures pxelinux itself.  The configuration capabilities are
> very impressive[2].  FreeBSD folks interested in PXE should really take
> a look at this thing.  I believe the configuration file is read and
> applied immediately, so things like serial port speed changes happen
> before pxelinux outputs anything (e.g. no need to rebuild pxelinux just
> to get a faster rate).
> 
> That said, given that FreeBSD's pxeboot requires a bunch of extra work
> (rebuilding for faster serial speed, and a bunch of other stuff -- it's
> in my doc), I'm a surprised you're not complaining about that.  :-)
> 
> The bottom line: the PXE booting framework in FreeBSD could be improved.

It has been improved, though not the documentation :-(

you can configure most of the stuff via DHCP, take a look
at src/lib/libstand/bootp.c

example lines from dhcpd.conf:
	option FBSD.ind0 "hint.uart.0.flags=0x10"
	option FBSD.ind1 "kern.ipc.semmni=256"
	option FBSD.ind2 "kern.ipc.semmns=2048"

and with this code in rc.initdiskless:

confpath=`kenv conf-path`
if [ -n "$confpath" ] ; then
    if [ "`expr $confpath : '\(.*\):'`" ] ; then
        echo Mounting $confpath on /conf
        mount_nfs $confpath /conf
        chkerr $? "mount_nfs $confpath /conf"
        to_umount="${to_umount} $confpath"
    fi
fi

eval `kenv | sed -n 's/^rc\.//p'`
rm -f /etc/rc.conf /etc/rc.conf.local
for fc in $conf0 $conf1 $conf2 $conf3 $conf4 $conf5 $conf6 $conf7 $conf8 
$conf9 rc.conf.$hostname
do
    ho=`expr $fc : '\(.*\):'`
    fl=`expr $fc : '.*/\(.*\)'`
    if [ "${ho}" != "" ]; then
        mp=`expr $fc : '\(.*\)/.*'`
        mount_nfs $mp /mnt > /dev/null 2>&1
        if [ -f /mnt/$fl ]; then
            echo "# from $fc /mnt/$fl" >> /etc/rc.conf
            cat /mnt/$fl >> /etc/rc.conf
        fi
        umount /mnt > /dev/null 2>&1
    elif [ -e /conf/$fc ] ; then
        echo "# from /conf/$fc" >> /etc/rc.conf
        cat /conf/$fc >> /etc/rc.conf
    fi
done

and these lines in dhcpd.conf
	option FBSD.conf-path="fr-01:/vol/system/share/conf"
	option FBSD.rc-conf3 "rc.ws8"
	...

will generate a 'personalized' rc.conf

danny
PS: this is not the first time I have posted this.


[...]




More information about the freebsd-stable mailing list