Changeset 8378d50


Ignore:
Timestamp:
08/20/13 11:28:19 (11 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
3d554ff
Parents:
70427a2
Message:

Update pc-sysinstall to now allow doing restores from a replicated
ZFS dataset via life-preserver

Location:
src-sh/pc-sysinstall/backend
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pc-sysinstall/backend/functions-newfs.sh

    r3018894 r8378d50  
    4040  ROOTSLICE="`echo ${PART} | rev | cut -b 2- | rev`" 
    4141  ZPOOLNAME=$(get_zpool_name "${PART}") 
     42  export ZPOOLNAME 
    4243 
    4344  # Sleep a few moments, let the disk catch its breath 
  • src-sh/pc-sysinstall/backend/functions.sh

    reec2eb4 r8378d50  
    556556  echo_log "Upgrade finished!" 
    557557}; 
     558 
     559# We are restoring a ZFS replication 
     560restore_zfs() 
     561{ 
     562  # Lets start setting up the disk slices now 
     563  setup_disk_slice 
     564   
     565  # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels 
     566  setup_disk_label 
     567   
     568  # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs  
     569  # to setup the filesystems 
     570  setup_filesystems 
     571 
     572  # We are ready to begin the restore process 
     573  do_zfs_restore 
     574 
     575  echo_log "Installation finished!" 
     576}; 
  • src-sh/pc-sysinstall/backend/parseconfig.sh

    rfe5d5c8 r8378d50  
    3434. ${BACKEND}/functions-cleanup.sh 
    3535. ${BACKEND}/functions-disk.sh 
     36. ${BACKEND}/functions-ftp.sh 
    3637. ${BACKEND}/functions-extractimage.sh 
    3738. ${BACKEND}/functions-installcomponents.sh 
     
    4445. ${BACKEND}/functions-parse.sh 
    4546. ${BACKEND}/functions-runcommands.sh 
    46 . ${BACKEND}/functions-ftp.sh 
    4747. ${BACKEND}/functions-unmount.sh 
    4848. ${BACKEND}/functions-upgrade.sh 
    4949. ${BACKEND}/functions-users.sh 
     50. ${BACKEND}/functions-zfsrestore.sh 
    5051 
    5152# Check that the config file exists 
     
    6465 
    6566# Start by doing a sanity check, which will catch any obvious mistakes in the config 
    66 file_sanity_check "installMode installType installMedium packageType" 
    6767 
    6868# We passed the Sanity check, lets grab some of the universal config settings and store them 
    69 check_value installMode "fresh upgrade extract" 
    70 check_value installType "PCBSD FreeBSD" 
    71 check_value installMedium "dvd usb ftp rsync image local" 
    72 check_value packageType "uzip tar rsync split dist" 
    73 if_check_value_exists mirrorbal "load prefer round-robin split" 
    74  
    75 # We passed all sanity checks! Yay, lets start the install 
    76 echo "File Sanity Check -> OK" 
     69check_value installMode "fresh upgrade extract zfsrestore" 
    7770 
    7871# Lets load the various universal settings now 
    7972get_value_from_cfg installMode 
    8073export INSTALLMODE="${VAL}" 
     74 
     75if [ "$INSTALLMODE" = "zfsrestore" ] ; then 
     76  file_sanity_check "sshHost sshPort sshUser sshKey zfsRemoteDataset" 
     77else 
     78  file_sanity_check "installMode installType installMedium packageType" 
     79  check_value installType "PCBSD FreeBSD" 
     80  check_value installMedium "dvd usb ftp rsync image local" 
     81  check_value packageType "uzip tar rsync split dist zfs" 
     82  if_check_value_exists mirrorbal "load prefer round-robin split" 
     83fi 
     84 
     85# We passed all sanity checks! Yay, lets start the install 
     86echo "File Sanity Check -> OK" 
    8187 
    8288get_value_from_cfg installType 
     
    106112# If we are not doing an upgrade, lets go ahead and setup the disk 
    107113case "${INSTALLMODE}" in 
     114  zfsrestore) restore_zfs ;; 
    108115  fresh) 
    109116    if [ "${INSTALLMEDIUM}" = "image" ] 
Note: See TracChangeset for help on using the changeset viewer.