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