Bug #1732 » 0002-Remove-the-check-for-devfs-in-initdiskless.patch
| etc/rc.d/diskless | ||
|---|---|---|
|
# Provide a function for normalizing the mounting of memory filesystems.
|
||
|
# $1 = size
|
||
|
# $2 = mount point
|
||
|
# $3 = (optional) bytes-per-inode
|
||
|
mount_md() {
|
||
|
if [ -n "$3" ]; then
|
||
|
bpi="-i $3"
|
||
|
fi
|
||
|
/sbin/mount_mfs $bpi -s $1 swap $2
|
||
|
/sbin/mount_mfs -s $1 swap $2
|
||
|
}
|
||
|
# If there is a global system configuration file, suck it in.
|
||
| ... | ... | |
|
fi
|
||
|
fi
|
||
|
if sysctl vfs.devfs > /dev/null 2>&1 ; then
|
||
|
# we have DEVFS, no worries...
|
||
|
true
|
||
|
elif (/bin/mkdir /dev/.diskless 2> /dev/null); then
|
||
|
# if /dev is writable assume it has already been populated
|
||
|
# via rc.d/diskless
|
||
|
#
|
||
|
rmdir /dev/.diskless
|
||
|
else
|
||
|
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
|
||
|
mount_md 4096 /dev 512
|
||
|
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
|
||
|
rm -f /tmp/dev.tmp
|
||
|
fi
|
||
|
# generate our hostname
|
||
|
#
|
||
|
if [ -z "`hostname -s`" ]; then
|
||