[PC-BSD Commits] r3997 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts
svn at pcbsd.org
svn at pcbsd.org
Thu May 28 12:20:30 PDT 2009
Author: kris
Date: 2009-05-28 12:20:29 -0700 (Thu, 28 May 2009)
New Revision: 3997
Modified:
pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh
pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh
pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh
Log:
Fixed up ZFS. Should work for upgrades now. Needs testing with more than 1 ZFS partition still though
Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh 2009-05-28 19:09:27 UTC (rev 3996)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh 2009-05-28 19:20:29 UTC (rev 3997)
@@ -103,21 +103,30 @@
fi # End of if /mnt/PCBSD
+ # If we are on ZFS, cleanup after the mount
if [ ! -z "${ZROOT}" ]
then
umount ${FSMNT}/bootdir
+ /bin/sh /tmp/TempUMount
+ umount ${FSMNT}
+ rm /tmp/TempUMount
+
+ # Remount the bootdir to /mnt
+ mount ${PART}a ${FSMNT}
+
+ # Copy over our ZFS cache data
+ cp /boot/zfs/* ${FSMNT}/boot/zfs/
+
+ # Unmount the /bootdir partition again
+ umount ${FSMNT}
+ else
+ # Unmount FS
+ /bin/sh /tmp/TempUMount
+ umount ${FSMNT}
+ rm /tmp/TempUMount
fi
- # Unmount FS
- /bin/sh /tmp/TempUMount
- umount ${FSMNT}
- rm /tmp/TempUMount
- if [ ! -z "${ZROOT}" ]
- then
- zpool export -f ${ZROOT}
- fi
-
fi # End of if ${i}a
done
Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh 2009-05-28 19:09:27 UTC (rev 3996)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountUpgrade.sh 2009-05-28 19:20:29 UTC (rev 3997)
@@ -31,7 +31,9 @@
# Mount the bootdir now
mount ${PART}a ${FSMNT}/bootdir
- echo "${ZROOT}" > /tmp/upgradeZFS
+ echo "${ZROOT}" >/tmp/upgradeZFS
+ echo "${PART}a" >/uzip/ZFS-bootpart
+ echo "/dev/${ZROOT}" >/uzip/ZFS-root
fi
Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh 2009-05-28 19:09:27 UTC (rev 3996)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.SysConfig.sh 2009-05-28 19:20:29 UTC (rev 3997)
@@ -169,24 +169,27 @@
BASENAME="`echo $ZFSROOT | cut -d '/' -f 3`"
ZFSBOOTPART="`cat /uzip/ZFS-bootpart`"
- # Setup our loader.conf entries for ZFS
- echo 'zfs_load="YES"' >> ${FSMNT}/boot/loader.conf
- echo "vfs.root.mountfrom=\"zfs:${BASENAME}/root\"" >> ${FSMNT}/boot/loader.conf
- echo 'vm.kmem_size="512M"' >>${FSMNT}/boot/loader.conf
- echo 'vm.kmem_size_max="512M"' >>${FSMNT}/boot/loader.conf
+ if [ ! -e "/tmp/upgradeZFS" ]
+ then
- # Enable zfs in /etc/rc.conf
- echo 'zfs_enable="YES"' >> ${FSMNT}/etc/rc.conf
+ # Setup our loader.conf entries for ZFS
+ echo 'zfs_load="YES"' >> ${FSMNT}/boot/loader.conf
+ echo "vfs.root.mountfrom=\"zfs:${BASENAME}/root\"" >> ${FSMNT}/boot/loader.conf
+ echo 'vm.kmem_size="512M"' >>${FSMNT}/boot/loader.conf
+ echo 'vm.kmem_size_max="512M"' >>${FSMNT}/boot/loader.conf
- # Copy over the /etc/hostid from our install CD to the HD
- cp /etc/hostid ${FSMNT}/etc/hostid
+ # Enable zfs in /etc/rc.conf
+ echo 'zfs_enable="YES"' >> ${FSMNT}/etc/rc.conf
- # Move the kernel to /bootdir so we can bootup properly
- mv -f ${FSMNT}/boot ${FSMNT}/bootdir/
+ # Copy over the /etc/hostid from our install CD to the HD
+ cp /etc/hostid ${FSMNT}/etc/hostid
- # Create our link to /boot on the ZFS partition
- ln -s /bootdir/boot ${FSMNT}/boot
+ # Move the kernel to /bootdir so we can bootup properly
+ mv -f ${FSMNT}/boot ${FSMNT}/bootdir/
+ # Create our link to /boot on the ZFS partition
+ ln -s /bootdir/boot ${FSMNT}/boot
+ fi
# Reset our mount points for any extra ZFS partitions
cd /uzip/zfsmnts/
@@ -239,19 +242,8 @@
fi
done
- if [ -e "/tmp/upgradeZFS" ]
- then
- ZROOT=`cat /tmp/upgradeZFS`
- umount ${FSMNT}/bootdir
- fi
-
umount -f ${FSMNT} >/dev/null
- if [ ! -z "${ZROOT}" ]
- then
- zpool export -f ${ZROOT}
- fi
-
fi
# If we are not using a network URL, unmount the CD
More information about the Commits
mailing list