summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-05-01 20:13:59 +0000
committerphk <phk@FreeBSD.org>2001-05-01 20:13:59 +0000
commit49a44143f2e21cc274827e957c618244d89a6409 (patch)
treedc88d7d543075003ced4058daccabd73fa668930 /etc
parentb303ef38f5816e7d4a1f816373c84c8e923291ec (diff)
downloadFreeBSD-src-49a44143f2e21cc274827e957c618244d89a6409.zip
FreeBSD-src-49a44143f2e21cc274827e957c618244d89a6409.tar.gz
Don't mount a md(4) over /dev on DEVFS enabled diskless systems.
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.d/diskless14
-rw-r--r--etc/rc.d/resolv14
-rw-r--r--etc/rc.d/tmp14
-rw-r--r--etc/rc.d/var14
-rw-r--r--etc/rc.diskless214
5 files changed, 45 insertions, 25 deletions
diff --git a/etc/rc.d/diskless b/etc/rc.d/diskless
index a19c068..37c1cf6 100644
--- a/etc/rc.d/diskless
+++ b/etc/rc.d/diskless
@@ -69,11 +69,15 @@ fi
# mount_null /var/tmp /tmp
#fi
#
-# extract a list of device entries, then copy them to a writable partition
-(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
-echo "+++ mount_mfs of /dev"
-mount_md 4096 /dev 3
-(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
+if [ ! -h /tmp ]; then
+ mount_md ${tmpsize:=64m} /tmp 2
+ chmod 01777 /tmp
+fi
+
+if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
+ mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
+ true
+else
# extract a list of device entries, then copy them to a writable fs
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
mount_md 4096 /dev 3 512
diff --git a/etc/rc.d/resolv b/etc/rc.d/resolv
index a19c068..37c1cf6 100644
--- a/etc/rc.d/resolv
+++ b/etc/rc.d/resolv
@@ -69,11 +69,15 @@ fi
# mount_null /var/tmp /tmp
#fi
#
-# extract a list of device entries, then copy them to a writable partition
-(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
-echo "+++ mount_mfs of /dev"
-mount_md 4096 /dev 3
-(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
+if [ ! -h /tmp ]; then
+ mount_md ${tmpsize:=64m} /tmp 2
+ chmod 01777 /tmp
+fi
+
+if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
+ mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
+ true
+else
# extract a list of device entries, then copy them to a writable fs
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
mount_md 4096 /dev 3 512
diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp
index a19c068..37c1cf6 100644
--- a/etc/rc.d/tmp
+++ b/etc/rc.d/tmp
@@ -69,11 +69,15 @@ fi
# mount_null /var/tmp /tmp
#fi
#
-# extract a list of device entries, then copy them to a writable partition
-(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
-echo "+++ mount_mfs of /dev"
-mount_md 4096 /dev 3
-(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
+if [ ! -h /tmp ]; then
+ mount_md ${tmpsize:=64m} /tmp 2
+ chmod 01777 /tmp
+fi
+
+if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
+ mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
+ true
+else
# extract a list of device entries, then copy them to a writable fs
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
mount_md 4096 /dev 3 512
diff --git a/etc/rc.d/var b/etc/rc.d/var
index a19c068..37c1cf6 100644
--- a/etc/rc.d/var
+++ b/etc/rc.d/var
@@ -69,11 +69,15 @@ fi
# mount_null /var/tmp /tmp
#fi
#
-# extract a list of device entries, then copy them to a writable partition
-(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
-echo "+++ mount_mfs of /dev"
-mount_md 4096 /dev 3
-(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
+if [ ! -h /tmp ]; then
+ mount_md ${tmpsize:=64m} /tmp 2
+ chmod 01777 /tmp
+fi
+
+if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
+ mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
+ true
+else
# extract a list of device entries, then copy them to a writable fs
(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
mount_md 4096 /dev 3 512
diff --git a/etc/rc.diskless2 b/etc/rc.diskless2
index 043b72f..189d5e3 100644
--- a/etc/rc.diskless2
+++ b/etc/rc.diskless2
@@ -69,8 +69,12 @@ mount -a # chown and chgrp are in /usr
# mount_null /var/tmp /tmp
#fi
-# extract a list of device entries, then copy them to a writable partition
-(cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
-echo "+++ mount_mfs of /dev"
-mount_md 4096 /dev 3
-(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
+if sysctl vfs.devfs.generation > /dev/null 2>&1 ; then
+ # we have DEVFS, no worries...
+ true
+else
+ # extract a list of device entries, then copy them to a writable fs
+ (cd /; find -x dev | cpio -o -H newc) > /tmp/dev.tmp
+ mount_mfs -s 4096 -i 512 -T qp120at dummy /dev
+ (cd /; cpio -i -H newc -d < /tmp/dev.tmp)
+fi
OpenPOWER on IntegriCloud