Changeset 3995

Show
Ignore:
Timestamp:
05/28/09 11:45:17 (10 months ago)
Author:
kris
Message:

Update install scripts to fix ZFS detection when doing upgrades

Still needs some work though ;)

Location:
pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh

    r3723 r3995  
    1616  fsck -y ${PART}a >/dev/null 2>/dev/null 
    1717  mount ${PART}a ${FSMNT}${MNT} >/dev/null 2>/dev/null 
     18fi 
     19 
     20# Check if this is a ZFS boot partition 
     21cat ${FSMNT}/boot/loader.conf | grep '^vfs.root.mountfrom="zfs:' >/dev/null 2>/dev/null 
     22if [ "$?" = "0" ] 
     23then 
     24  ZROOT="`cat ${FSMNT}/boot/loader.conf | grep vfs.root.mountfrom | cut -d '=' -f 2 | cut -d ':' -f 2 | cut -d '/' -f 1`" 
     25  umount ${FSMNT} 
     26  # Import the zfs pool now 
     27  zpool import -f -R /mnt ${ZROOT} 
     28 
     29  # Now mount the root partition for ZFS 
     30  mount -t zfs ${ZROOT}/root ${FSMNT} 
     31 
     32  # Mount the bootdir now 
     33  mount ${PART}a ${FSMNT}/bootdir 
     34  echo "${ZROOT}" > /tmp/upgradeZFS 
    1835fi 
    1936 
  • pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh

    r3830 r3995  
    240240  done 
    241241 
     242  if [ -e "/tmp/upgradeZFS" ] 
     243  then 
     244    ZROOT=`cat /tmp/upgradeZFS` 
     245    umount ${FSMNT}/bootdir 
     246  fi 
     247 
    242248  umount -f ${FSMNT} >/dev/null 
     249 
     250  if [ ! -z "${ZROOT}" ] 
     251  then 
     252    zpool export -f ${ZROOT} 
     253  fi 
    243254 
    244255fi