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

Annotation of openbsd/update_openbsd/release.sh, Revision 1.7

1.1       andrew      1: #!/bin/sh
1.7     ! andrew      2: # $RedRiver: release.sh,v 1.6 2006/11/07 17:09:19 andrew Exp $
1.1       andrew      3: # Copyright (c) 2002 - 2006, FenderQ
                      4: # All rights reserved.
                      5: #
                      6: # Redistribution and use in source and binary forms, with or without
                      7: # modification, are permitted provided that the following conditions are met:
                      8: #
                      9: #   * Redistributions of source code must retain the above copyright
                     10: #     notice, this list of conditions and the following disclaimer.
                     11: #   * Redistributions in binary form must reproduce the above copyright
                     12: #     notice, this list of conditions and the following disclaimer in the
                     13: #     documentation and/or other materials provided with the distribution.
                     14: #   * Neither the name of FenderQ nor the names of its contributors
                     15: #     may be used to endorse or promote products derived from this software
                     16: #     without specific prior written permission.
                     17: #
                     18: # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
                     19: # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     20: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     21: # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
                     22: # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
                     23: # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
                     24: # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
                     25: # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
                     26: # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
                     27: # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
                     28: # POSSIBILITY OF SUCH DAMAGE.
                     29: #
                     30: # --------------------------------------------
                     31: # OpenBSD - Release Building Shell Script v3.9
                     32: #
                     33: # FenderQ.com - Internet Security Solutions
                     34: # http://www.fenderq.com/
                     35: #
                     36: # SEE ALSO release(8)
                     37: #
                     38:
1.2       andrew     39: DEST="/usr/dest"
                     40: RELEASE="/usr/release"
1.5       andrew     41: CVSTAG=`uname -r | awk '{ sub("\\\.","_"); print "OPENBSD_" $0 }'`
1.2       andrew     42: #SOURCES="src ports XF4"
1.6       andrew     43: #SOURCES="src ports"
                     44: SOURCES="src XF4"
1.1       andrew     45:
                     46: # Anonymous CVS - http://www.openbsd.org/anoncvs.html
1.2       andrew     47: CVSROOT="anoncvs@anoncvs3.usa.openbsd.org:/cvs"
1.1       andrew     48: export CVSROOT
                     49:
                     50: install_sources() {
                     51:        echo "********** Install sources **********"
                     52:        cd /usr
1.2       andrew     53:        for d in $SOURCES; do
                     54:                rm -rf $d/*
                     55:                cvs -q -z6 checkout -r$CVSTAG -P $d
                     56:        done
1.1       andrew     57: }
                     58:
                     59: update_sources() {
                     60:        echo "********** Update sources **********"
1.2       andrew     61:        for d in $SOURCES; do
                     62:                cd /usr && cvs -q -z6 update -r$CVSTAG -Pd $d
                     63:        done
1.1       andrew     64: }
                     65:
                     66: build_kernel() {
                     67:        echo "********** Build and install a new kernel **********"
                     68:        cd /usr/src/sys/arch/i386/conf
                     69:        config GENERIC
                     70:        cd ../compile/GENERIC
                     71:        make clean depend && make
                     72:        cp /bsd /bsd.old && cp bsd /
                     73: }
                     74:
                     75: build_system() {
                     76:        echo "********** Build a new system **********"
                     77:        rm -rf /usr/obj/*
                     78:        cd /usr/src && nice make obj
                     79:        cd /usr/src/etc && export DESTDIR=/ && make distrib-dirs
                     80:        cd /usr/src && nice make build
                     81: }
                     82:
                     83: make_release() {
                     84:        echo "********** Make and validate the system release **********"
                     85:        cd /usr/src/distrib/crunch && make obj depend all install
                     86:        export DESTDIR=$DEST RELEASEDIR=$RELEASE
1.4       andrew     87:        rm -rf $DESTDIR/*
1.1       andrew     88:        mkdir -p $DESTDIR $RELEASEDIR
                     89:        cd /usr/src/etc && nice make release
                     90:        cd /usr/src/distrib/sets && sh checkflist
1.7     ! andrew     91:        ls $RELEASEDIR | grep -v index.txt | sort > $RELEASEDIR/index.txt
1.1       andrew     92:        unset DESTDIR RELEASEDIR
                     93: }
                     94:
                     95: build_XF4() {
                     96:        echo "********** Build and install XF4 **********"
                     97:        rm -rf /usr/Xbuild
                     98:        mkdir -p /usr/Xbuild
                     99:        cd /usr/ports/lang/tcl/8.4 && make install
                    100:        cd /usr/ports/x11/tk/8.4 && make install
                    101:        cd /usr/Xbuild && lndir /usr/XF4 && nice make build
                    102: }
                    103:
                    104: make_release_XF4() {
                    105:        echo "********** Make and validate the XF4 release **********"
                    106:        export DESTDIR=$DEST RELEASEDIR=$RELEASE
1.6       andrew    107:        rm -rf $DESTDIR/*
1.1       andrew    108:        mkdir -p $DESTDIR $RELEASEDIR
1.6       andrew    109:        cd /usr/Xbuild && nice make release
                    110:        cd /usr/Xbuild/distrib/sets && sh checkflist
1.7     ! andrew    111:        ls $RELEASEDIR | grep -v index.txt | sort > $RELEASEDIR/index.txt
1.1       andrew    112:        unset DESTDIR RELEASEDIR
                    113: }
                    114:
                    115: clean_everything() {
                    116:        echo "********** Clean everything **********"
1.6       andrew    117:        rm -rf /usr/obj/* $DEST/* /usr/Xbuild
1.1       andrew    118: }
                    119:
                    120: usage() {
                    121:        echo "Usage: $0 options"
                    122:        echo
                    123:        echo "Options:"
                    124:        echo
                    125:        echo "  install            - Install sources"
                    126:        echo "  update             - Update sources"
                    127:        echo "  kernel             - Build and install a new kernel"
                    128:        echo "  system             - Build a new system"
                    129:        echo "  release            - Make and validate the system release"
                    130:        echo "  xwindow            - Build and install XF4"
                    131:        echo "  xwindow-release    - Make and validate the XF4 release"
                    132:        echo "  clean              - Clean everything"
                    133:        echo
                    134: }
                    135:
                    136: if [ `whoami` != "root" ]; then
                    137:        echo "You probably should be root instead of `whoami` to run this safely."
                    138:        exit 1
                    139: fi
                    140:
                    141: START=`date`
                    142: echo
                    143: echo "***** OpenBSD - Release Building *****"
                    144: echo
                    145: echo "Dest: $DEST"
                    146: echo "Release: $RELEASE"
                    147: echo "CVS Server: $CVSROOT"
                    148: echo "CVS Revision Tag: $CVSTAG"
                    149: echo
                    150:
                    151: if [ $# = 0 ]; then usage; exit 1; fi
                    152:
                    153: for i in $*
                    154: do
                    155:        case $i in
                    156:                install)
                    157:                install_sources
                    158:                ;;
                    159:                update)
                    160:                update_sources
                    161:                ;;
                    162:                kernel)
                    163:                build_kernel
                    164:                ;;
                    165:                system)
                    166:                build_system
                    167:                ;;
                    168:                release)
                    169:                make_release
                    170:                ;;
                    171:                xwindow)
                    172:                build_XF4
                    173:                ;;
                    174:                xwindow-release)
                    175:                make_release_XF4
                    176:                ;;
                    177:                clean)
                    178:                clean_everything
                    179:                ;;
                    180:                *)
                    181:                echo "********** Abort! Abort! **********"
                    182:                echo "Invalid option encountered: $i"
                    183:                echo "Exiting......."
                    184:                echo
                    185:                exit 1
                    186:                ;;
                    187:        esac
                    188: done
                    189: echo
                    190: echo "Start Time  : $START"
                    191: echo "Finish Time : `date`"
                    192: echo

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