[BACK]Return to update_openbsd CVS log [TXT][DIR] Up to [local] / openbsd / update_openbsd

Diff for /openbsd/update_openbsd/update_openbsd between version 1.98 and 1.101

version 1.98, 2017/12/11 01:35:44 version 1.101, 2017/12/11 02:34:10
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $AFresh1: update_openbsd,v 1.97 2017/12/11 00:52:41 andrew Exp $  # $AFresh1: update_openbsd,v 1.100 2017/12/11 01:48:08 andrew Exp $
 #  #
 # Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com>  # Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com>
 #  #
Line 94 
Line 94 
             BOOT_DEVICE="/dev/$root_disk$msdos_partition"              BOOT_DEVICE="/dev/$root_disk$msdos_partition"
 }  }
   
   boot_device_mounted=""
   mount_boot_device() {
       [ "boot_device_mounted" ] && return
   
       local default_mount=$( df -lnP /bsd | sed -ne 's!/dev/.* !!p' )
       local boot_mount=$( mount |
               sed -ne "s!^$BOOT_DEVICE on \([^ ]*\).*!\1!p" )
   
       if [ ! "$boot_mount" ]; then
           mount $BOOT_DEVICE /mnt
           boot_device_mounted=""
           KERNEL_ROOT=/mnt
       elif [ "$boot_mount" != "$default_mount" ]; then
           KERNEL_ROOT=$boot_mount/
       else
           KERNEL_ROOT=${default_mount%/}/
       fi
   }
   
   umount_boot_device() {
       [ "$boot_device_mounted" ] && umount $BOOT_DEVICE
       boot_device_mounted=""
   }
   
 set_version() {  set_version() {
     CUR_VER=`uname -r`      CUR_VER=`uname -r`
     NEW_VER=`dc -e "$CUR_VER 0.1 + p"`      NEW_VER=`dc -e "$CUR_VER 0.1 + p"`
Line 190 
Line 214 
         FTP=${MIRROR}/${_dir}/`machine`          FTP=${MIRROR}/${_dir}/`machine`
     fi      fi
   
       KERNEL_ROOT=""
       [ -z "$BOOT_DEVICE" ] && set_boot_device
   
     BOOT_KERNEL=`( \      BOOT_KERNEL=`( \
         echo bsd; \          echo bsd; \
         [ -e /boot.conf ] && sed -E '/^ *(set +image|boot) +/!d ; \          [ -e /boot.conf ] && sed -E '/^ *(set +image|boot) +/!d ; \
Line 371 
Line 398 
   
 install_kernels() {  install_kernels() {
     local _d=$1      local _d=$1
     local default_mount=$( df -lnP /bsd | sed -ne 's!/dev/.* !!p' )      local default_mount
     local boot_mount      local boot_mount
     local mount_is_msdos      local mount_is_msdos
   
     if [ ! "$_d" ]; then      if [ ! "$_d" ]; then
         boot_mount=$( mount |          default_mount=$( df -lnP /bsd | sed -ne 's!/dev/.* !!p' )
             sed -ne "s!^$BOOT_DEVICE on \([^ ]*\).*!\1!p" )          mount_boot_device
   
         local _ik="$INSTALL_KERNELS"          if [ "$KERNEL_ROOT" != "$default_mount" ]; then
         INSTALL_KERNELS="${BOOT_KERNEL#/} bsd.rd"                  local _ik="$INSTALL_KERNELS"
                   INSTALL_KERNELS="${BOOT_KERNEL#/} bsd.rd"
   
         if [ ! "$boot_mount" ]; then                  install_kernels $KERNEL_ROOT
                 mount $BOOT_DEVICE /mnt  
                 install_kernels /mnt/                  INSTALL_KERNELS="$_ik"
                 umount $BOOT_DEVICE  
         elif [ "$boot_mount" != "$default_mount" ]; then  
                 install_kernels $boot_mount/  
         fi          fi
   
         INSTALL_KERNELS="$_ik"          umount_boot_device
   
         install_kernels $default_mount          install_kernels $default_mount
         return          return
     fi      fi
Line 402 
Line 428 
         exit 1          exit 1
     fi      fi
   
     mount | grep -q " ${_d%/} .* msdos" && mount_is_msdos=1      [ $_d != / ] && mount | grep -q " on ${_d%/} .* msdos" && mount_is_msdos=1
   
     if [ X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then      if [ X"$BOOT_KERNEL_VERSION" != X"$NEW_KERNEL_VERSION" ]; then
         echo "===> Backing up $BOOT_KERNEL to ${_d}obsd"          echo "===> Backing up $BOOT_KERNEL to ${_d}obsd"
Line 567 
Line 593 
 export PKG_PATH TRUSTED_PKG_PATH  export PKG_PATH TRUSTED_PKG_PATH
   
 set_version  set_version
 [ -z "$BOOT_DEVICE" ] && set_boot_device  
   
 TRUSTED_PKG_PATH=${TRUSTED_PKG_PATH:=/usr/ports/packages/`machine -a`/all}  TRUSTED_PKG_PATH=${TRUSTED_PKG_PATH:=/usr/ports/packages/`machine -a`/all}
 if [ "$FORCE_DIR" = "No" ]; then  if [ "$FORCE_DIR" = "No" ]; then

Legend:
Removed from v.1.98  
changed lines
  Added in v.1.101

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>