summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/rc.d/diskless34
-rw-r--r--etc/rc.d/resolv34
-rw-r--r--etc/rc.d/tmp34
-rw-r--r--etc/rc.d/var34
-rw-r--r--etc/rc.diskless234
5 files changed, 95 insertions, 75 deletions
diff --git a/etc/rc.d/diskless b/etc/rc.d/diskless
index 1443724..858261d 100644
--- a/etc/rc.d/diskless
+++ b/etc/rc.d/diskless
@@ -38,29 +38,33 @@
/sbin/mount /dev/md$3c $2
}
+echo "+++ mfs_mount of /var"
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
-var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
- spool/output/lpd"
-for i in ${var_dirs}
-do
- mkdir /var/${i}
-done
-chmod 755 /var/run
-chmod 755 /var/db
-chmod 755 /var/spool
-chmod 1777 /var/tmp
-chown -R root.daemon /var/spool/output
-chgrp daemon /var/spool/lpd
+if [ -r /etc/rc.subr ]; then
+ . /etc/rc.subr
+ load_rc_config $name
+echo "+++ mount_md of /var"
+mount_md ${varsize:=32m} /var 1
+
+echo "+++ populate /var using /etc/mtree/BSD.var.dist"
+/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
+case ${sendmail_enable} in
+ /usr/bin/touch $LOGFILES
+fi
+
# Since we are starting with a very fresh /etc on an MFS:
if [ -d /conf/default/etc ]; then
newaliases
fi
-if [ ! -h /tmp -a ! -h /var/tmp ]; then
- mount_null /var/tmp /tmp
-fi
+# We assume that /tmp is symlinked to /var/tmp on the shared root
+# partition. mount_null seems to have problems.
+#if [ ! -h /tmp -a ! -h /var/tmp ]; then
+# 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_mfs -s 4096 -i 512 -T qp120at dummy /dev
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
# extract a list of device entries, then copy them to a writable fs
diff --git a/etc/rc.d/resolv b/etc/rc.d/resolv
index 1443724..858261d 100644
--- a/etc/rc.d/resolv
+++ b/etc/rc.d/resolv
@@ -38,29 +38,33 @@
/sbin/mount /dev/md$3c $2
}
+echo "+++ mfs_mount of /var"
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
-var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
- spool/output/lpd"
-for i in ${var_dirs}
-do
- mkdir /var/${i}
-done
-chmod 755 /var/run
-chmod 755 /var/db
-chmod 755 /var/spool
-chmod 1777 /var/tmp
-chown -R root.daemon /var/spool/output
-chgrp daemon /var/spool/lpd
+if [ -r /etc/rc.subr ]; then
+ . /etc/rc.subr
+ load_rc_config $name
+echo "+++ mount_md of /var"
+mount_md ${varsize:=32m} /var 1
+
+echo "+++ populate /var using /etc/mtree/BSD.var.dist"
+/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
+case ${sendmail_enable} in
+ /usr/bin/touch $LOGFILES
+fi
+
# Since we are starting with a very fresh /etc on an MFS:
if [ -d /conf/default/etc ]; then
newaliases
fi
-if [ ! -h /tmp -a ! -h /var/tmp ]; then
- mount_null /var/tmp /tmp
-fi
+# We assume that /tmp is symlinked to /var/tmp on the shared root
+# partition. mount_null seems to have problems.
+#if [ ! -h /tmp -a ! -h /var/tmp ]; then
+# 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_mfs -s 4096 -i 512 -T qp120at dummy /dev
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
# extract a list of device entries, then copy them to a writable fs
diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp
index 1443724..858261d 100644
--- a/etc/rc.d/tmp
+++ b/etc/rc.d/tmp
@@ -38,29 +38,33 @@
/sbin/mount /dev/md$3c $2
}
+echo "+++ mfs_mount of /var"
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
-var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
- spool/output/lpd"
-for i in ${var_dirs}
-do
- mkdir /var/${i}
-done
-chmod 755 /var/run
-chmod 755 /var/db
-chmod 755 /var/spool
-chmod 1777 /var/tmp
-chown -R root.daemon /var/spool/output
-chgrp daemon /var/spool/lpd
+if [ -r /etc/rc.subr ]; then
+ . /etc/rc.subr
+ load_rc_config $name
+echo "+++ mount_md of /var"
+mount_md ${varsize:=32m} /var 1
+
+echo "+++ populate /var using /etc/mtree/BSD.var.dist"
+/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
+case ${sendmail_enable} in
+ /usr/bin/touch $LOGFILES
+fi
+
# Since we are starting with a very fresh /etc on an MFS:
if [ -d /conf/default/etc ]; then
newaliases
fi
-if [ ! -h /tmp -a ! -h /var/tmp ]; then
- mount_null /var/tmp /tmp
-fi
+# We assume that /tmp is symlinked to /var/tmp on the shared root
+# partition. mount_null seems to have problems.
+#if [ ! -h /tmp -a ! -h /var/tmp ]; then
+# 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_mfs -s 4096 -i 512 -T qp120at dummy /dev
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
# extract a list of device entries, then copy them to a writable fs
diff --git a/etc/rc.d/var b/etc/rc.d/var
index 1443724..858261d 100644
--- a/etc/rc.d/var
+++ b/etc/rc.d/var
@@ -38,29 +38,33 @@
/sbin/mount /dev/md$3c $2
}
+echo "+++ mfs_mount of /var"
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
-var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
- spool/output/lpd"
-for i in ${var_dirs}
-do
- mkdir /var/${i}
-done
-chmod 755 /var/run
-chmod 755 /var/db
-chmod 755 /var/spool
-chmod 1777 /var/tmp
-chown -R root.daemon /var/spool/output
-chgrp daemon /var/spool/lpd
+if [ -r /etc/rc.subr ]; then
+ . /etc/rc.subr
+ load_rc_config $name
+echo "+++ mount_md of /var"
+mount_md ${varsize:=32m} /var 1
+
+echo "+++ populate /var using /etc/mtree/BSD.var.dist"
+/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
+case ${sendmail_enable} in
+ /usr/bin/touch $LOGFILES
+fi
+
# Since we are starting with a very fresh /etc on an MFS:
if [ -d /conf/default/etc ]; then
newaliases
fi
-if [ ! -h /tmp -a ! -h /var/tmp ]; then
- mount_null /var/tmp /tmp
-fi
+# We assume that /tmp is symlinked to /var/tmp on the shared root
+# partition. mount_null seems to have problems.
+#if [ ! -h /tmp -a ! -h /var/tmp ]; then
+# 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_mfs -s 4096 -i 512 -T qp120at dummy /dev
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
# extract a list of device entries, then copy them to a writable fs
diff --git a/etc/rc.diskless2 b/etc/rc.diskless2
index 4866a888..e69f6ee5 100644
--- a/etc/rc.diskless2
+++ b/etc/rc.diskless2
@@ -38,28 +38,32 @@ elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
fi
+echo "+++ mfs_mount of /var"
mount_mfs -s ${varsize:=65536} -T qp120at dummy /var
-var_dirs="run dev db msgs tmp spool spool/mqueue spool/lpd spool/output \
- spool/output/lpd"
-for i in ${var_dirs}
-do
- mkdir /var/${i}
-done
-chmod 755 /var/run
-chmod 755 /var/db
-chmod 755 /var/spool
-chmod 1777 /var/tmp
-chown -R root.daemon /var/spool/output
-chgrp daemon /var/spool/lpd
+
+echo "+++ populate /var using /etc/mtree/BSD.var.dist"
+/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
+
+echo "+++ create log files based on the contents of /etc/newsyslog.conf"
+LOGFILES=`/usr/bin/awk '$1 != "#" { printf "%s ", $1 } ' /etc/newsyslog.conf`
+if [ -n "$LOGFILES" ]; then
+ /usr/bin/touch $LOGFILES
+fi
+
+mount -a # chown and chgrp are in /usr
+
#
# XXX make sure to create one dir for each printer as requested by lpd
#
-if [ ! -h /tmp -a ! -h /var/tmp ]; then
- mount_null /var/tmp /tmp
-fi
+# We assume that /tmp is symlinked to /var/tmp on the shared root
+# partition. mount_null seems to have problems.
+#if [ ! -h /tmp -a ! -h /var/tmp ]; then
+# 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_mfs -s 4096 -i 512 -T qp120at dummy /dev
(cd /; cpio -i -H newc -d < /tmp/dev.tmp)
OpenPOWER on IntegriCloud