Annotation of openbsd/update_openbsd/release.sh, Revision 1.6
1.1 andrew 1: #!/bin/sh
1.6 ! andrew 2: # $RedRiver: release.sh,v 1.5 2006/10/13 18:18:51 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
91: unset DESTDIR RELEASEDIR
92: }
93:
94: build_XF4() {
95: echo "********** Build and install XF4 **********"
96: rm -rf /usr/Xbuild
97: mkdir -p /usr/Xbuild
98: cd /usr/ports/lang/tcl/8.4 && make install
99: cd /usr/ports/x11/tk/8.4 && make install
100: cd /usr/Xbuild && lndir /usr/XF4 && nice make build
101: }
102:
103: make_release_XF4() {
104: echo "********** Make and validate the XF4 release **********"
105: export DESTDIR=$DEST RELEASEDIR=$RELEASE
1.6 ! andrew 106: rm -rf $DESTDIR/*
1.1 andrew 107: mkdir -p $DESTDIR $RELEASEDIR
1.6 ! andrew 108: cd /usr/Xbuild && nice make release
! 109: cd /usr/Xbuild/distrib/sets && sh checkflist
1.1 andrew 110: unset DESTDIR RELEASEDIR
111: }
112:
113: clean_everything() {
114: echo "********** Clean everything **********"
1.6 ! andrew 115: rm -rf /usr/obj/* $DEST/* /usr/Xbuild
1.1 andrew 116: }
117:
118: usage() {
119: echo "Usage: $0 options"
120: echo
121: echo "Options:"
122: echo
123: echo " install - Install sources"
124: echo " update - Update sources"
125: echo " kernel - Build and install a new kernel"
126: echo " system - Build a new system"
127: echo " release - Make and validate the system release"
128: echo " xwindow - Build and install XF4"
129: echo " xwindow-release - Make and validate the XF4 release"
130: echo " clean - Clean everything"
131: echo
132: }
133:
134: if [ `whoami` != "root" ]; then
135: echo "You probably should be root instead of `whoami` to run this safely."
136: exit 1
137: fi
138:
139: START=`date`
140: echo
141: echo "***** OpenBSD - Release Building *****"
142: echo
143: echo "Dest: $DEST"
144: echo "Release: $RELEASE"
145: echo "CVS Server: $CVSROOT"
146: echo "CVS Revision Tag: $CVSTAG"
147: echo
148:
149: if [ $# = 0 ]; then usage; exit 1; fi
150:
151: for i in $*
152: do
153: case $i in
154: install)
155: install_sources
156: ;;
157: update)
158: update_sources
159: ;;
160: kernel)
161: build_kernel
162: ;;
163: system)
164: build_system
165: ;;
166: release)
167: make_release
168: ;;
169: xwindow)
170: build_XF4
171: ;;
172: xwindow-release)
173: make_release_XF4
174: ;;
175: clean)
176: clean_everything
177: ;;
178: *)
179: echo "********** Abort! Abort! **********"
180: echo "Invalid option encountered: $i"
181: echo "Exiting......."
182: echo
183: exit 1
184: ;;
185: esac
186: done
187: echo
188: echo "Start Time : $START"
189: echo "Finish Time : `date`"
190: echo
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>