diff options
| author | gw25295 <none@none> | 2008-04-11 18:36:28 -0700 |
|---|---|---|
| committer | gw25295 <none@none> | 2008-04-11 18:36:28 -0700 |
| commit | e7cbe64f7a72dae5cb44f100db60ca88f3313c65 (patch) | |
| tree | 778467a6522111f338e4644cc2cb895dcecacee4 /usr/src/cmd/svc | |
| parent | f635d46a9872dc5a02bbbd736f2bf18685c2c221 (diff) | |
| download | illumos-joyent-e7cbe64f7a72dae5cb44f100db60ca88f3313c65.tar.gz | |
PSARC 2006/370 ZFS Boot Support
5008936 ZFS and/or zvol should support dumps
5070124 dumpadm -d /dev/... does not enforce block device requirement for savecore
6521468 ZFS Boot support Phase 2
6553503 bfu can't find 'rootdev' from /etc/vfstab on a zfs root filesystem
6574993 zfs_mountroot() may need to call clkset() to set the boot_time kstat
6633197 zvol should not permit newfs or createpool while it's in use by swap or dump
6661127 zfs_name_valid() does not support ZFS_TYPE_POOL
6684121 The changes to smf scripts for supporting canmount=noauto will cause a boot failure.
--HG--
rename : usr/src/psm/stand/bootblks/zfs/common/debug-zfs.fth => deleted_files/usr/src/psm/stand/bootblks/zfs/common/debug-zfs.fth
rename : usr/src/psm/stand/bootblks/zfs/common/big-zfs.fth => usr/src/psm/stand/bootblks/zfs/common/fs-zfs.fth
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) |
