Changeset 65f3853c


Ignore:
Timestamp:
11/11/13 10:42:57 (18 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
e1feeb4
Parents:
3f8190c7
Message:

Fix how we do major updates / branch changes.

Do the package downloading after rebooting with new kernel, in order
to make sure we can run the new pkg ABI

File:
1 edited

Legend:

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

    rf68f02e r65f3853c  
    2626 
    2727# Get the system type 
    28 SYSTYPE="`pbreg get /PC-BSD/SysType`" ; export SYSTYPE 
     28SYSTYPE="`/usr/local/bin/pbreg get /PC-BSD/SysType`" ; export SYSTYPE 
    2929 
    3030# Set the config location 
     
    414414} 
    415415 
     416# After installing the kernel and rebooting, this gets run 
     417finish_major_fbsd_update() { 
     418 
     419  PATH="${PATH}:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" 
     420  export PATH 
     421 
     422  echo "Installing FreeBSD updates... Please wait..." 
     423  freebsd-update --non-interactive install 
     424  if [ $? -ne 0 ] ; then 
     425     echo "Warning: Failed running freebsd-update install!" 
     426     echo "Press ENTER to continue" 
     427     read tmp 
     428  fi 
     429 
     430  # Lets pre-download all packages 
     431  echo "Downloading updated packages..." 
     432  download_cache_packages "pkg-static upgrade -fn" 
     433  if [ $? -ne 0 ] ; then 
     434     echo "Warning: Failed running 'pkg-static upgrade -fn'" 
     435     echo "Press ENTER to continue" 
     436     read tmp 
     437  fi 
     438 
     439  # Now its time to force a pkg-update of all packages to their new FreeBSD compiled versions 
     440  SKIP_CACHE_PKGS="YES" ; export SKIP_CACHE_PKGS 
     441  pc-updatemanager pkgupdate -f 
     442  if [ $? -ne 0 ] ; then 
     443     echo "Warning: Failed running 'pc-updatemanager pkgupdate -f'" 
     444     echo "Press ENTER to continue" 
     445     read tmp 
     446  fi 
     447 
     448  # Last but not least, lets make sure to re-stamp GRUB in case any loader.conf.pcbsd modules changed 
     449  grub-mkconfig -o /boot/grub/grub.cfg 
     450  if [ $? -ne 0 ] ; then 
     451     echo "Warning: Failed running 'pc-updatemanager pkgupdate -f'" 
     452     echo "Press ENTER to continue" 
     453     read tmp 
     454  fi 
     455 
     456  echo "Updating overlay files..." 
     457  if [ -e "/usr/local/bin/pc-softwaremanager" ] ; then 
     458    pc-extractoverlay desktop 
     459  else 
     460    pc-extractoverlay server 
     461  fi 
     462 
     463  exit 0 
     464} 
     465 
    416466start_major_fbsd_update() { 
    417467  local rel=`echo $1 | sed 's|fbsd-||g'` 
     
    443493  # Lets install pkgng update 
    444494  PKGROLLBACK="YES" 
    445   echo "Installing pkgng update..." 
    446   pkg-static add /usr/local/tmp/pkg.txz 
    447  
    448   # Lets pre-download all packages 
    449   download_cache_packages "pkg-static upgrade -fn" 
    450   if [ $? -ne 0 ] ; then 
    451      rollback_update 
    452      exit_err "Failed downloading packages for update..." 
    453   fi 
    454495 
    455496  # Download update files from freebsd-update 
     
    469510     exit_err "Failed running \"freebsd-update install\"..." 
    470511  fi 
    471  
    472   # Now its time to force a pkg-update of all packages to their new FreeBSD compiled versions 
    473   SKIP_CACHE_PKGS="YES" ; export SKIP_CACHE_PKGS 
    474   pc-updatemanager pkgupdate -f 
    475  
    476   # Last but not least, lets make sure to re-stamp GRUB in case any loader.conf.pcbsd modules changed 
    477   grub-mkconfig -o /boot/grub/grub.cfg  
    478512 
    479513  echo "Major update finished!"  
     
    595629        pkgcheck) checkup_pkgs ;; 
    596630       pkgupdate) update_pkgs "$2" ;; 
     631finish-major-update) finish_major_fbsd_update ;; 
    597632         install) get_update_file 
    598633                  do_install "${2}" ;; 
Note: See TracChangeset for help on using the changeset viewer.