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

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

1.1     ! andrew      1: #!/bin/sh
        !             2: #
        !             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:
        !            39: DEST="/home/destdir"
        !            40: RELEASE="/home/releasedir"
        !            41: CVSTAG="OPENBSD_3_9"
        !            42:
        !            43: # Anonymous CVS - http://www.openbsd.org/anoncvs.html
        !            44: CVSROOT="anoncvs@openbsd.sunsite.ualberta.ca:/cvs"
        !            45: export CVSROOT
        !            46:
        !            47: install_sources() {
        !            48:        echo "********** Install sources **********"
        !            49:        cd /usr
        !            50:        rm -rf src/* XF4 ports
        !            51:        cvs -q -z6 checkout -r$CVSTAG -P src XF4 ports
        !            52: }
        !            53:
        !            54: update_sources() {
        !            55:        echo "********** Update sources **********"
        !            56:        cd /usr && cvs -q -z6 update -r$CVSTAG -Pd src XF4 ports
        !            57: }
        !            58:
        !            59: build_kernel() {
        !            60:        echo "********** Build and install a new kernel **********"
        !            61:        cd /usr/src/sys/arch/i386/conf
        !            62:        config GENERIC
        !            63:        cd ../compile/GENERIC
        !            64:        make clean depend && make
        !            65:        cp /bsd /bsd.old && cp bsd /
        !            66: }
        !            67:
        !            68: build_system() {
        !            69:        echo "********** Build a new system **********"
        !            70:        rm -rf /usr/obj/*
        !            71:        cd /usr/src && nice make obj
        !            72:        cd /usr/src/etc && export DESTDIR=/ && make distrib-dirs
        !            73:        cd /usr/src && nice make build
        !            74: }
        !            75:
        !            76: make_release() {
        !            77:        echo "********** Make and validate the system release **********"
        !            78:        cd /usr/src/distrib/crunch && make obj depend all install
        !            79:        export DESTDIR=$DEST RELEASEDIR=$RELEASE
        !            80:        rm -rf $DESTDIR
        !            81:        mkdir -p $DESTDIR $RELEASEDIR
        !            82:        cd /usr/src/etc && nice make release
        !            83:        cd /usr/src/distrib/sets && sh checkflist
        !            84:        unset DESTDIR RELEASEDIR
        !            85: }
        !            86:
        !            87: build_XF4() {
        !            88:        echo "********** Build and install XF4 **********"
        !            89:        rm -rf /usr/Xbuild
        !            90:        mkdir -p /usr/Xbuild
        !            91:        cd /usr/ports/lang/tcl/8.4 && make install
        !            92:        cd /usr/ports/x11/tk/8.4 && make install
        !            93:        cd /usr/Xbuild && lndir /usr/XF4 && nice make build
        !            94: }
        !            95:
        !            96: make_release_XF4() {
        !            97:        echo "********** Make and validate the XF4 release **********"
        !            98:        export DESTDIR=$DEST RELEASEDIR=$RELEASE
        !            99:        rm -rf $DESTDIR
        !           100:        mkdir -p $DESTDIR $RELEASEDIR
        !           101:        nice make release
        !           102:        unset DESTDIR RELEASEDIR
        !           103: }
        !           104:
        !           105: clean_everything() {
        !           106:        echo "********** Clean everything **********"
        !           107:        rm -rf /usr/obj/* $DEST /usr/Xbuild
        !           108: }
        !           109:
        !           110: usage() {
        !           111:        echo "Usage: $0 options"
        !           112:        echo
        !           113:        echo "Options:"
        !           114:        echo
        !           115:        echo "  install            - Install sources"
        !           116:        echo "  update             - Update sources"
        !           117:        echo "  kernel             - Build and install a new kernel"
        !           118:        echo "  system             - Build a new system"
        !           119:        echo "  release            - Make and validate the system release"
        !           120:        echo "  xwindow            - Build and install XF4"
        !           121:        echo "  xwindow-release    - Make and validate the XF4 release"
        !           122:        echo "  clean              - Clean everything"
        !           123:        echo
        !           124: }
        !           125:
        !           126: if [ `whoami` != "root" ]; then
        !           127:        echo "You probably should be root instead of `whoami` to run this safely."
        !           128:        exit 1
        !           129: fi
        !           130:
        !           131: START=`date`
        !           132: echo
        !           133: echo "***** OpenBSD - Release Building *****"
        !           134: echo
        !           135: echo "Dest: $DEST"
        !           136: echo "Release: $RELEASE"
        !           137: echo "CVS Server: $CVSROOT"
        !           138: echo "CVS Revision Tag: $CVSTAG"
        !           139: echo
        !           140:
        !           141: if [ $# = 0 ]; then usage; exit 1; fi
        !           142:
        !           143: for i in $*
        !           144: do
        !           145:        case $i in
        !           146:                install)
        !           147:                install_sources
        !           148:                ;;
        !           149:                update)
        !           150:                update_sources
        !           151:                ;;
        !           152:                kernel)
        !           153:                build_kernel
        !           154:                ;;
        !           155:                system)
        !           156:                build_system
        !           157:                ;;
        !           158:                release)
        !           159:                make_release
        !           160:                ;;
        !           161:                xwindow)
        !           162:                build_XF4
        !           163:                ;;
        !           164:                xwindow-release)
        !           165:                make_release_XF4
        !           166:                ;;
        !           167:                clean)
        !           168:                clean_everything
        !           169:                ;;
        !           170:                *)
        !           171:                echo "********** Abort! Abort! **********"
        !           172:                echo "Invalid option encountered: $i"
        !           173:                echo "Exiting......."
        !           174:                echo
        !           175:                exit 1
        !           176:                ;;
        !           177:        esac
        !           178: done
        !           179: echo
        !           180: echo "Start Time  : $START"
        !           181: echo "Finish Time : `date`"
        !           182: echo

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