FreeBSD Bugzilla – Attachment 13552 Details for
Bug 25730
[PATCH] mount_mfs is being phased out -> new diskless boot procedure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
rc.diskless2
rc.diskless2 (text/plain; charset=us-ascii), 3.36 KB, created by
krepel
on 2001-03-30 17:53:31 UTC
(
hide
)
Description:
rc.diskless2
Filename:
MIME Type:
Creator:
krepel
Created:
2001-03-30 17:53:31 UTC
Size:
3.36 KB
patch
obsolete
># Copyright (c) 1999 Matt Dillon ># All rights reserved. ># ># Redistribution and use in source and binary forms, with or without ># modification, are permitted provided that the following conditions ># are met: ># 1. Redistributions of source code must retain the above copyright ># notice, this list of conditions and the following disclaimer. ># 2. Redistributions in binary form must reproduce the above copyright ># notice, this list of conditions and the following disclaimer in the ># documentation and/or other materials provided with the distribution. ># ># THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ># ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ># IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ># ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ># FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ># DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ># OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ># HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ># LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ># OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ># SUCH DAMAGE. ># ># $FreeBSD: src/etc/rc.diskless2,v 1.7 2000/10/08 19:18:24 obrien Exp $ ># > ># ># rc.diskless2 ># > ># If there is a global system configuration file, suck it in. ># >if [ -r /etc/defaults/rc.conf ]; then > . /etc/defaults/rc.conf > source_rc_confs >elif [ -r /etc/rc.conf ]; then > . /etc/rc.conf >fi > ># chkerr: ># ># Routine to check for error ># ># checks error code and drops into shell on failure. ># if shell exits, terminates script as well as /etc/rc. ># >chkerr() { > case $1 in > 0) > ;; > *) > echo "$2 failed: dropping into /bin/sh" > /bin/sh > # RESUME > ;; > esac >} > ># mkmd: ># ># Builds an md(4) disk with malloc or swap depending on ># the diskless client use swap with the size in $1 ># Labels and newfs' it. ># Mounts it on the destination in $2 ># Returns the name of the created md device in md_device ># Returns the name of the device containing the filesystem in md_filesystem ># >mkmd() { > dlv=`/sbin/sysctl -n vm.nswapdev 2> /dev/null` > if [ ${dlv:=0} != 0 ]; then > md_device=`mdconfig -a -t swap -s $1` > else > md_device=`mdconfig -a -t malloc -s $1` > fi > chkerr $? "configuring md device" > disklabel -rw $md_device auto > chkerr $? "labelling md device" > md_filesystem=/dev/$md_device"c" > newfs $md_filesystem 2>&1 >/dev/null > chkerr $? "making md device filesystem" > mount $md_filesystem $2 > chkerr $? "mounting md filesystem on $2" >} > > ># reconstruct /var ># >mkmd ${diskless_var_size} /var >mtree -p /var -eU -f /etc/mtree/BSD.var.dist 2>&1 >/dev/null >touch /var/log/cron >touch /var/log/lpd-errs >touch /var/log/maillog >touch /var/log/messages >touch /var/log/ppp.log >touch /var/log/security >touch /var/log/slip.log > ># Copy the templated /dev into a locally-writable version ># if wo are not using DEVFS ># >if [ ! sysctl vfs.devfs.generation > /dev/null 2>&1 ]; then > mkmd ${diskless_dev_size} /mnt > cp -Rp /dev/* /mnt > umount /mnt > mount $md_filesystem /dev >fi > ># Build a small /tmp ># >case ${diskless_tmp_enable} in >[Yy][Ee][Ss]) > mkmd ${diskless_tmp_size} /tmp > ;; >*) > if [ ! -h /tmp -a ! -h /var/tmp ]; then > mount_null /var/tmp /tmp > fi > ;; >esac
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 25730
:
13548
|
13549
|
13550
|
13551
| 13552