Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Mar 2004 09:26:41 +0200
From:      Danny Braniss <danny@cs.huji.ac.il>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        current@freebsd.org
Subject:   Re: initdiskless/rc.diskless1 
Message-ID:  <E1AzWCn-000Jz2-LQ@cs.huji.ac.il>
In-Reply-To: Your message of Fri, 5 Mar 2004 16:57:26 -0800 .

next in thread | raw e-mail | index | archive | help
hi,
 I've been using this for some time,
in rc.d/initdiskless:

eval `kenv -s -c rc.`
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

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

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1AzWCn-000Jz2-LQ>