diff options
Diffstat (limited to 'usr/src/cmd/svc')
| -rw-r--r-- | usr/src/cmd/svc/milestone/fs-minimal | 2 | ||||
| -rw-r--r-- | usr/src/cmd/svc/milestone/fs-usr | 35 | ||||
| -rw-r--r-- | usr/src/cmd/svc/shell/fs_include.sh | 13 |
3 files changed, 47 insertions, 3 deletions
diff --git a/usr/src/cmd/svc/milestone/fs-minimal b/usr/src/cmd/svc/milestone/fs-minimal index 6a7141fa1a..ff7cea8a20 100644 --- a/usr/src/cmd/svc/milestone/fs-minimal +++ b/usr/src/cmd/svc/milestone/fs-minimal @@ -58,7 +58,7 @@ for fs in /var /var/adm /tmp; do mountpt=`zfs get -H -o value mountpoint $be$fs 2>/dev/null` if [ $? = 0 ] ; then if [ "x$mountpt" = "x$fs" ] ; then - /sbin/zfs mount $be$fs + /sbin/zfs mount -O $be$fs fi fi fi diff --git a/usr/src/cmd/svc/milestone/fs-usr b/usr/src/cmd/svc/milestone/fs-usr index f4a75e08f9..72f906e82e 100644 --- a/usr/src/cmd/svc/milestone/fs-usr +++ b/usr/src/cmd/svc/milestone/fs-usr @@ -33,18 +33,49 @@ . /lib/svc/share/fs_include.sh # -# Add physical swap. +# Once root is read/write we can enable the dedicated dumpdevice if it exists +# locally. This is an optimization as svc-dumpadm will attempt do this later. # -/sbin/swapadd -1 +dump_setup() +{ + [ -r /etc/dumpadm.conf ] && . /etc/dumpadm.conf + + readswapdev $DUMPADM_DEVICE < $vfstab + + # + # If we have a dedicated dump device, then go ahead and configure it. + # + if [ "x$special" != "x$DUMPADM_DEVICE" ]; then + if [ -x /usr/sbin/zfs ]; then + dataset=`echo $DUMPADM_DEVICE | cut -d'/' -f5-` + [ -n "$dataset" ] && \ + /usr/sbin/zfs list -t volume $dataset > \ + /dev/null 2>&1 + if [ $? -eq 0 ]; then + /usr/sbin/zfs volinit + fi + fi + + if [ -x /usr/sbin/dumpadm -a -b $DUMPADM_DEVICE ]; then + /usr/sbin/dumpadm -u || exit $SMF_EXIT_ERR_CONFIG + fi + fi +} rootiszfs=0 # get the fstype of root readmnttab / </etc/mnttab if [ "$fstype" = zfs ] ; then rootiszfs=1 + dump_setup fi # +# Add physical swap. +# +/sbin/swapadd -1 + +# # Check and remount the / (root) file system. # For NFS mounts, force the llock option on. # diff --git a/usr/src/cmd/svc/shell/fs_include.sh b/usr/src/cmd/svc/shell/fs_include.sh index 7ab7dfdd3e..99810383cc 100644 --- a/usr/src/cmd/svc/shell/fs_include.sh +++ b/usr/src/cmd/svc/shell/fs_include.sh @@ -72,6 +72,19 @@ readvfstab() { done } +readswapdev() { + while read special fsckdev mountp fstype fsckpass automnt mntopts; do + # Ignore comments, empty lines, and no-action lines + case "$special" in + '#'* | '' | '-') continue;; + esac + + [ "$fstype" != swap ] && continue + + [ "x$special" = "x$1" ] && break + done +} + # # readmnttab mount_point # -> (special, mountp, fstype, mntopts, mnttime) |
