Changeset 3997

Show
Ignore:
Timestamp:
05/28/09 12:20:29 (10 months ago)
Author:
kris
Message:

Fixed up ZFS. Should work for upgrades now. Needs testing with more than 1 ZFS partition still though

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

Legend:

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

    r3996 r3997  
    104104    fi # End of if /mnt/PCBSD 
    105105 
     106    # If we are on ZFS, cleanup after the mount 
    106107    if [ ! -z "${ZROOT}" ] 
    107108    then 
    108109      umount ${FSMNT}/bootdir 
     110      /bin/sh /tmp/TempUMount 
     111      umount ${FSMNT} 
     112      rm /tmp/TempUMount 
     113 
     114      # Remount the bootdir to /mnt 
     115      mount ${PART}a ${FSMNT} 
     116 
     117      # Copy over our ZFS cache data 
     118      cp /boot/zfs/* ${FSMNT}/boot/zfs/ 
     119 
     120      # Unmount the /bootdir partition again 
     121      umount ${FSMNT} 
     122    else 
     123      # Unmount FS 
     124      /bin/sh /tmp/TempUMount 
     125      umount ${FSMNT} 
     126      rm /tmp/TempUMount 
    109127    fi 
    110128 
    111     # Unmount FS 
    112     /bin/sh /tmp/TempUMount 
    113     umount ${FSMNT} 
    114     rm /tmp/TempUMount 
    115129     
    116     if [ ! -z "${ZROOT}" ] 
    117     then 
    118       zpool export -f ${ZROOT} 
    119     fi 
    120          
    121130  fi # End of if ${i}a 
    122131      
  • pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh

    r3996 r3997  
    3232  # Mount the bootdir now 
    3333  mount ${PART}a ${FSMNT}/bootdir 
    34   echo "${ZROOT}" > /tmp/upgradeZFS 
     34  echo "${ZROOT}" >/tmp/upgradeZFS 
     35  echo "${PART}a" >/uzip/ZFS-bootpart 
     36  echo "/dev/${ZROOT}" >/uzip/ZFS-root 
    3537fi 
    3638 
  • pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh

    r3995 r3997  
    170170  ZFSBOOTPART="`cat /uzip/ZFS-bootpart`" 
    171171 
    172   # Setup our loader.conf entries for ZFS 
    173   echo 'zfs_load="YES"' >> ${FSMNT}/boot/loader.conf 
    174   echo "vfs.root.mountfrom=\"zfs:${BASENAME}/root\"" >> ${FSMNT}/boot/loader.conf 
    175   echo 'vm.kmem_size="512M"' >>${FSMNT}/boot/loader.conf 
    176   echo 'vm.kmem_size_max="512M"' >>${FSMNT}/boot/loader.conf 
    177  
    178   # Enable zfs in /etc/rc.conf 
    179   echo 'zfs_enable="YES"' >> ${FSMNT}/etc/rc.conf 
    180  
    181   # Copy over the /etc/hostid from our install CD to the HD 
    182   cp /etc/hostid ${FSMNT}/etc/hostid 
    183  
    184   # Move the kernel to /bootdir so we can bootup properly 
    185   mv -f ${FSMNT}/boot ${FSMNT}/bootdir/ 
    186  
    187   # Create our link to /boot on the ZFS partition 
    188   ln -s /bootdir/boot ${FSMNT}/boot 
    189  
     172  if [ ! -e "/tmp/upgradeZFS" ] 
     173  then 
     174 
     175    # Setup our loader.conf entries for ZFS 
     176    echo 'zfs_load="YES"' >> ${FSMNT}/boot/loader.conf 
     177    echo "vfs.root.mountfrom=\"zfs:${BASENAME}/root\"" >> ${FSMNT}/boot/loader.conf 
     178    echo 'vm.kmem_size="512M"' >>${FSMNT}/boot/loader.conf 
     179    echo 'vm.kmem_size_max="512M"' >>${FSMNT}/boot/loader.conf 
     180 
     181    # Enable zfs in /etc/rc.conf 
     182    echo 'zfs_enable="YES"' >> ${FSMNT}/etc/rc.conf 
     183 
     184    # Copy over the /etc/hostid from our install CD to the HD 
     185    cp /etc/hostid ${FSMNT}/etc/hostid 
     186 
     187    # Move the kernel to /bootdir so we can bootup properly 
     188    mv -f ${FSMNT}/boot ${FSMNT}/bootdir/ 
     189 
     190    # Create our link to /boot on the ZFS partition 
     191    ln -s /bootdir/boot ${FSMNT}/boot 
     192  fi 
    190193 
    191194  # Reset our mount points for any extra ZFS partitions 
     
    240243  done 
    241244 
    242   if [ -e "/tmp/upgradeZFS" ] 
    243   then 
    244     ZROOT=`cat /tmp/upgradeZFS` 
    245     umount ${FSMNT}/bootdir 
    246   fi 
    247  
    248245  umount -f ${FSMNT} >/dev/null 
    249  
    250   if [ ! -z "${ZROOT}" ] 
    251   then 
    252     zpool export -f ${ZROOT} 
    253   fi 
    254246 
    255247fi