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

Diff for /openbsd/update_openbsd/release.sh between version 1.37 and 1.38

version 1.37, 2015/11/27 22:36:12 version 1.38, 2017/02/16 07:08:49
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $AFresh1: release.sh,v 1.36 2014/11/27 21:17:46 andrew Exp $  # $AFresh1: release.sh,v 1.37 2015/11/27 22:36:12 andrew Exp $
 #  #
 # Copyright (c) 2002, 2008 Steven Roberts <sroberts@fenderq.com>  # Copyright (c) 2002, 2008 Steven Roberts <sroberts@fenderq.com>
 #  #
Line 20 
Line 20 
 TAG=`uname -sr | tr '[:lower:] .' '[:upper:]_'`  TAG=`uname -sr | tr '[:lower:] .' '[:upper:]_'`
 KERNEL="GENERIC"  KERNEL="GENERIC"
 ARCH=`machine`  ARCH=`machine`
 DEST="/home/destdir"  DEST="/usr/dest"
 RELEASE="/home/releasedir"  RELEASE="/home/releasedir"
 XSRCDIR="/usr/xenocara"  XSRCDIR="/usr/xenocara"
 PORTSPATH="/usr/ports"  PORTSPATH="/usr/ports"
   BUILDUSER=build
   
   if [ -e /etc/mk.conf ]; then
       . /etc/mk.conf
   fi
 if [ -e /etc/release.conf ]; then  if [ -e /etc/release.conf ]; then
     . /etc/release.conf      . /etc/release.conf
 fi  fi
Line 34 
Line 38 
     TAG=$_origtag      TAG=$_origtag
 fi  fi
   
   if [ X"$DEST" = X"" ]; then
       echo PLEASE SET \$DEST! >&2
       exit 1
   fi
   if [ X"$RELEASE" = X"" ]; then
       echo PLEASE SET \$RELEASE! >&2
       exit 1
   fi
   
 # See http://www.openbsd.org/anoncvs.html for instructions on fetching the  # See http://www.openbsd.org/anoncvs.html for instructions on fetching the
 # sources for the first time.  # sources for the first time.
   
 empty_dir() {  empty_dir() {
 [ X"" == X"$1" ] && exit  [ X"" = X"$1" ] && exit
 cd $1 || exit  cd $1 || exit
   
 local _old=`${SUDO} mktemp -d .old.XXXXXXX`  local _old=`mktemp -d .old.XXXXXXX`
 ${SUDO} mv -f * .* $_old 2>/dev/null  mv -f * .* $_old 2>/dev/null
 ${SUDO} rm -rf $_old  rm -rf $_old
   
 sync  sync
 }  }
Line 66 
Line 78 
 echo "---------- Build and install a new kernel ----------"  echo "---------- Build and install a new kernel ----------"
 local _status=0  local _status=0
 unset DESTDIR RELEASEDIR  unset DESTDIR RELEASEDIR
 cd /usr/src/sys/arch/$ARCH/conf  
 config $KERNEL  cd /usr/src/sys/arch/$ARCH/compile/$KERNEL
 cd ../compile/$KERNEL  
 make clean depend && make  
 _status=$?  _status=$?
 if [ $_status == 0 ]; then  
     make install  if [ $_status -eq 0 ]; then
       make obj && make config && make && make install
     _status=$?      _status=$?
 fi  fi
 if [ $_status != 0 ]; then  
   if [ $_status -ne 0 ]; then
     echo Kernel Build Failed      echo Kernel Build Failed
     exit $_status      exit $_status
 fi  fi
Line 85 
Line 97 
 echo "---------- Build a new system ----------"  echo "---------- Build a new system ----------"
 local _status=0  local _status=0
 unset DESTDIR RELEASEDIR  unset DESTDIR RELEASEDIR
   local DESTDIR RELEASEDIR
   
   mkdir -p /usr/obj
   chown $BUILDUSER:wheel /usr/obj
   chmod 755              /usr/obj
 empty_dir /usr/obj &  empty_dir /usr/obj &
 cd /usr/src && nice make $BUILD_ARGS obj  
   cd /usr/src
 _status=$?  _status=$?
 if [ $_status == 0 ]; then  
     cd /usr/src/etc && env DESTDIR=/ $SUDO make distrib-dirs  if [ $_status -eq 0 ]; then
       nice make $BUILD_ARGS obj && nice make $BUILD_ARGS build
     _status=$?      _status=$?
 fi  fi
 if [ $_status == 0 ]; then  
     cd /usr/src && nice make SUDO="${SUDO}" $BUILD_ARGS build  if [ $_status -ne 0 ]; then
 fi  
 if [ $_status != 0 ]; then  
     echo System Build Failed      echo System Build Failed
     exit $_status      exit $_status
 else  
     echo Update /etc, /var, and /dev/MAKEDEV, either by hand or using sysmerge\(8\).  
 fi  fi
   
   echo Update /etc, /var, and /dev/MAKEDEV, either by hand or using sysmerge\(8\).
 }  }
   
 make_system_release() {  make_system_release() {
 echo "---------- Make and validate the system release ----------"  echo "---------- Make and validate the system release ----------"
 if [ X"$DEST" == X"" ]; then  
         echo PLEASE SET \$DEST! >2&  
         exit 1  
 fi  
   
 local _status=0  local _status=0
 local DESTDIR RELEASEDIR  local DESTDIR RELEASEDIR
   
 [ -e $DEST ] && empty_dir $DEST  export DESTDIR=$DEST/base; export RELEASEDIR=$RELEASE
 ${SUDO} install -d -g wheel -m 775 $DEST $RELEASE  mkdir -p $DESTDIR $RELEASEDIR
   empty_dir $DESTDIR &
   chown -R $BUILDUSER:wheel $DESTDIR $RELEASEDIR
   chmod -R 700              $DESTDIR $RELEASEDIR
   
 export DESTDIR=$DEST RELEASEDIR=$RELEASE  if [ $_status -eq 0 ]; then
 cd /usr/src/etc && ${SUDO} nice make SUDO="" release      cd /usr/src/etc && nice make release
 _status=$?      _status=$?
 [ $_status == 0 ] && cd /usr/src/distrib/sets && ${SUDO} sh checkflist  fi
 _status=$?  
   
 [ $_status == 0 ] || echo System Release Failed  if [ $_status -eq 0 ]; then
 exit $_status      cd /usr/src/distrib/sets && sh checkflist
       _status=$?
   fi
   
   unset DESTDIR RELEASEDIR
   if [ $_status -ne 0 ]; then
       echo System Release Failed
       exit $_status
   fi
 }  }
   
 build_xenocara() {  build_xenocara() {
 echo "---------- Build and install xenocara ----------"  echo "---------- Build and install xenocara ----------"
 local _status=0  local _status=0
   local DESTDIR RELEASEDIR
 unset DESTDIR RELEASEDIR  unset DESTDIR RELEASEDIR
   
   mkdir -p /usr/xobj
   chown $BUILDUSER:wheel /usr/xobj
   chmod 755              /usr/xobj
 empty_dir /usr/xobj &  empty_dir /usr/xobj &
   
 cd $XSRCDIR  cd $XSRCDIR
 _status=$?  _status=$?
 if [ $_status == 0 ]; then  
   if [ $_status -eq 0 ]; then
     make $BUILD_ARGS bootstrap      make $BUILD_ARGS bootstrap
     _status=$?      _status=$?
 fi  fi
 if [ $_status == 0 ]; then  
   if [ $_status -eq 0 ]; then
     make $BUILD_ARGS obj      make $BUILD_ARGS obj
     _status=$?      _status=$?
 fi  fi
 if [ $_status == 0 ]; then  
   if [ $_status -eq 0 ]; then
     make $BUILD_ARGS build      make $BUILD_ARGS build
     _status=$?      _status=$?
 fi  fi
 if [ $_status != 0 ]; then  
   if [ $_status -ne 0 ]; then
     echo Xenocara Build Failed      echo Xenocara Build Failed
     exit $_status      exit $_status
 fi  fi
Line 154 
Line 187 
 make_xenocara_release() {  make_xenocara_release() {
 echo "---------- Make and validate the xenocara release ----------"  echo "---------- Make and validate the xenocara release ----------"
 local _status=0  local _status=0
 export DESTDIR=$DEST;export RELEASEDIR=$RELEASE  local DESTDIR RELEASEDIR
 if [ X"$DESTDIR" == X"" ]; then  
         echo PLEASE SET \$DEST! >2&  export DESTDIR=$DEST/xbase; export RELEASEDIR=$RELEASE
         exit  
 fi  
 mkdir -p $DESTDIR $RELEASEDIR  mkdir -p $DESTDIR $RELEASEDIR
 empty_dir $DESTDIR &  empty_dir $DESTDIR &
 cd $XSRCDIR  chown -R $BUILDUSER:wheel $DESTDIR $RELEASEDIR
 _status=$?  chmod -R 755              $DESTDIR $RELEASEDIR
 if [ $_status == 0 ]; then  
     nice make release  if [ $_status -eq 0 ]; then
       cd $XSRCDIR && nice make release
     _status=$?      _status=$?
 fi  fi
   
 unset DESTDIR RELEASEDIR  unset DESTDIR RELEASEDIR
 if [ $_status != 0 ]; then  if [ $_status -ne 0 ]; then
     echo Xenocara Release Failed      echo Xenocara Release Failed
     exit $_status      exit $_status
 fi  fi
Line 187 
Line 220 
 echo "  xenocara-release - Make and validate the xenocara release"  echo "  xenocara-release - Make and validate the xenocara release"
 echo "  full             - xenocara, xenocara-release, system, system-release"  echo "  full             - xenocara, xenocara-release, system, system-release"
 echo  echo
   if [ `whoami` != "root" ]; then
   echo "You must be root to build a release."
   fi
 }  }
   
 if [ X"" == X"${SUDO}" -a `whoami` != "root" ]; then  
 echo "You must be root or set SUDO to build a release."  
 exit 1  
 fi  
   
 START=`date`  START=`date`
 echo  echo
 echo ".: release.sh - building an OpenBSD release :."  echo ".: release.sh - building an OpenBSD release :."
Line 209 
Line 240 
 echo  echo
   
 if [ $# = 0 ]; then usage; exit 1; fi  if [ $# = 0 ]; then usage; exit 1; fi
   
   if [ `whoami` != "root" ]; then
   echo "You must be root to build a release."
   exit 1
   fi
   
 for i in $*  for i in $*
 do  do

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

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