Changeset 11010 in hybrid for branches/releng-9.0/nanobsd/tools


Ignore:
Timestamp:
May 26, 2012, 3:05:45 PM (13 years ago)
Author:
rick
Message:

Reduce update hacking only when needed, saves some potential race conditionals
(and password typing for non-key users).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-9.0/nanobsd/tools/image

    r11009 r11010  
    4343  $do_reboot && p_warn "AND will REBOOT the $host"
    4444  p_warn "Please do mind to use your ssh key else you be required to type the root"
    45   p_warn "password AT LEAST 5 times"
     45  p_warn "password AT MOST 5 times"
    4646
    4747
     
    5050
    5151  # Details and alive checkings
    52   ssh $host mount || exit 1
    53   P=`ssh $HOST df / | grep '1a ' && echo "p2" || echo "p1"` || exit 1
    54   echo "# Updating partition $P"
    55 
    56   cat $img | ssh $host sh -x /tools/update$P || exit 1
    57 
    58   # Hack to make sure we update the fstab the right way when converting from
    59   # 8.X-RELEASE to 9.X-RELEASE. ad0 naming changed to ada0.
    60   if [ "$P" = "p2" ]; then
    61     cat <<'EOF' | ssh $HOST sh -x || exit 1
     52  release=`ssh $host mount | grep 'ada0' && echo "9.0-RELEASE" || echo "PRE-9.0-RELEASE"` || exit 1
     53  if [ $release = "9.0-RELEASE" ]; then
     54    cat $img | ssh $host sh -x /tools/update || exit 1
     55  else
     56    # Hack to make sure we update the fstab the right way when converting from
     57    # 8.X-RELEASE to 9.X-RELEASE. ad0 naming changed to ada0.
     58    P=`ssh $HOST df / | grep '1a ' && echo "p2" || echo "p1"` || exit 1
     59    echo "# Updating partition $P"
     60
     61    cat $img | ssh $host sh -x /tools/update$P || exit 1
     62
     63    if [ "$P" = "p2" ]; then
     64      cat <<EOF | ssh $HOST sh -x || exit 1
    6265mount -uwo noatime /dev/ad0s2a
    6366sed -i "" "s/ada0s1/ada0s2/" /mnt/conf/base/etc/fstab /mnt/etc/fstab
    6467umount
    6568EOF
    66 
     69    fi
    6770  fi
    6871
Note: See TracChangeset for help on using the changeset viewer.