Ignore:
Timestamp:
02/20/14 09:15:29 (7 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
18b88da
Parents:
b95e8a8
Message:
  • When we are doing a major update, fetch a "pristine" /etc for doing the three way merge. We could use a cached copy in /var/db/etc, but I don't trust that it hasn't been modified, and it would really hose the upgrade if that was an invalid cached copy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pc-updatemanager/pc-updatemanager

    rb95e8a8 r9a8b3d1  
    999999} 
    10001000 
     1001## Do a fetch of a pristine /etc directory for the three way etcmerge 
     1002fetch_clean_etc() 
     1003{ 
     1004  echo "Fetching pristine /etc for merging..." 
     1005  baseTmp="/usr/local/tmp/base.txz.$$" 
     1006  get_file_from_mirrors "/$SYSVER/$ARCH/dist/base.txz" "$baseTmp" "iso" 
     1007  if [ $? -ne 0 ] ; then return 1 ; fi 
     1008 
     1009  rm -rf "/var/db/etc/" 
     1010  echo "Extracting pristine /etc for merging..." 
     1011  tar xvpf ${baseTmp} -C /var/db ./etc >/dev/null 2>/dev/null 
     1012  local err=$? 
     1013  rm ${baseTmp} 
     1014  return $err 
     1015} 
     1016 
     1017## Verify that ISO is suitable for upgrading with 
    10011018verify_iso_data() 
    10021019{ 
     
    10441061  done 
    10451062 
    1046   # Lastly we need to check for the pristine /etc for use by etcmerge 
    1047   if [ ! -e "/var/db/etc/rc" ] ; then 
    1048        umount /mnt/iso-update 
    1049        mdconfig -d -u $MD 
    1050        rollback_update 
    1051        exit_err "Missing etcmerge directory: /var/db/etc" 
     1063  # Lets fetch a pristine /etc for merging, don't trust an old one in /var/db 
     1064  fetch_clean_etc 
     1065  if [ $? -ne 0 ] ; then 
     1066     umount /mnt/iso-update 
     1067     mdconfig -d -u $MD 
     1068     rollback_update 
     1069     exit_err "Missing etcmerge directory: /var/db/etc" 
    10521070  fi 
    10531071 
Note: See TracChangeset for help on using the changeset viewer.