| version 1.15, 2008/02/13 16:31:47 |
version 1.28, 2008/11/05 17:14:40 |
|
|
| #!/bin/sh |
#!/bin/sh |
| # $RedRiver: release.sh,v 1.14 2007/11/20 20:08:31 andrew Exp $ |
# $RedRiver: release.sh,v 1.27 2008/11/05 16:43:57 andrew Exp $ |
| # |
# |
| # Copyright (c) 2002 - 2007 Steven Roberts <fenderq@fenderq.com> |
# Copyright (c) 2002, 2008 Steven Roberts <sroberts@fenderq.com> |
| # |
# |
| # Permission to use, copy, modify, and distribute this software for any |
# Permission to use, copy, modify, and distribute this software for any |
| # purpose with or without fee is hereby granted, provided that the above |
# purpose with or without fee is hereby granted, provided that the above |
|
|
| # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| # |
# |
| |
|
| #TAG="OPENBSD_4_2" |
local _origtag=${TAG} |
| |
TAG=`uname -sr | tr '[:lower:] .' '[:upper:]_'` |
| KERNEL="GENERIC" |
KERNEL="GENERIC" |
| ARCH="i386" |
ARCH=`machine` |
| DEST="/home/destdir" |
DEST="/home/destdir" |
| RELEASE="/home/releasedir" |
RELEASE="/home/releasedir" |
| XSRCDIR="/usr/src/xenocara" |
XSRCDIR="/usr/xenocara" |
| PORTSPATH="/usr/ports" |
PORTSPATH="/usr/ports" |
| |
|
| DEST="/usr/dest" |
if [ -e /etc/release.conf ]; then |
| RELEASE="/usr/release" |
. /etc/release.conf |
| TAG=${TAG:=`uname -sr | tr '[:lower:] .' '[:upper:]_'`} |
fi |
| ARCH=`machine` |
|
| #SOURCES="src ports XF4" |
|
| #SOURCES="src ports" |
|
| SOURCES="/usr/src $XSRCDIR $PORTSPATH" |
|
| |
|
| # Anonymous CVS - http://www.openbsd.org/anoncvs.html |
|
| #CVSROOT="anoncvs@anoncvs3.usa.openbsd.org:/cvs" |
|
| #CVSROOT="anoncvs@anoncvs1.usa.openbsd.org:/cvs" |
|
| CVSROOT="anoncvs@rt.fm:/cvs" |
|
| export CVSROOT |
export CVSROOT |
| |
|
| |
if [ X"" != X"${_origtag}" ]; then |
| |
TAG=$_origtag |
| |
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. |
| |
|
| update_sources() { |
update_sources() { |
| echo "---------- Update sources ----------" |
echo "---------- Update sources ----------" |
| for d in $SOURCES; do |
local _d |
| _cvstag=-r$CVSTAG |
for _d in /usr/src "${XSRCDIR}" "${PORTSPATH}"; do |
| if [ X"$CVSTAG" == X"HEAD" ]; then |
if [ -d $_d ]; then |
| _cvstag="" |
echo [$_d] cvs update -r $TAG -Pd |
| fi |
cd $_d && cvs update -r $TAG -Pd |
| cd $d && cvs -q -z6 update $_cvstag -Pd |
fi |
| done |
done |
| } |
} |
| |
|
|
|
| config $KERNEL |
config $KERNEL |
| cd ../compile/$KERNEL |
cd ../compile/$KERNEL |
| make clean depend && make |
make clean depend && make |
| cp /bsd /bsd.old && cp bsd / |
make install |
| } |
} |
| |
|
| build_system() { |
build_system() { |
| echo "---------- Build a new system ----------" |
echo "---------- Build a new system ----------" |
| rm -rf /usr/obj/* |
rm -rf /usr/obj/* |
| cd /usr/src && nice make obj |
cd /usr/src && nice make obj |
| cd /usr/src/etc && export DESTDIR=/ && make distrib-dirs |
cd /usr/src/etc && env DESTDIR=/ make distrib-dirs |
| cd /usr/src && nice make build |
cd /usr/src && nice make build |
| # Update /etc, /var, and /dev/MAKEDEV by hand. |
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 ----------" |
| cd /usr/src/distrib/crunch && make obj depend && make all install |
cd /usr/src/distrib/crunch && make obj depend && make all install |
| export DESTDIR=$DEST; export RELEASEDIR=$RELEASE |
export DESTDIR=$DEST; export RELEASEDIR=$RELEASE |
| if (-e $DESTDIR); then |
if [ X"$DESTDIR" == X"" ]; then |
| mkdir $DESTDIR/old- |
echo PLEASE SET \$DEST! >2& |
| mv $DESTDIR/* $DESTDIR/old- 2>/dev/null |
exit |
| rm -rf $DESTDIR/old- & |
|
| fi |
fi |
| |
rm -rf $DESTDIR/* $DESTDIR/.* |
| mkdir -p $DESTDIR $RELEASEDIR |
mkdir -p $DESTDIR $RELEASEDIR |
| cd /usr/src/etc && nice make release |
cd /usr/src/etc && nice make release |
| cd /usr/src/distrib/sets && sh checkflist |
cd /usr/src/distrib/sets && sh checkflist |
|
|
| |
|
| build_xenocara() { |
build_xenocara() { |
| echo "---------- Build and install xenocara ----------" |
echo "---------- Build and install xenocara ----------" |
| rm -rf /usr/xobj/* |
|
| cd $XSRCDIR |
cd $XSRCDIR |
| make bootstrap |
make bootstrap |
| make obj |
make obj |
|
|
| make_xenocara_release() { |
make_xenocara_release() { |
| echo "---------- Make and validate the xenocara release ----------" |
echo "---------- Make and validate the xenocara release ----------" |
| export DESTDIR=$DEST RELEASEDIR=$RELEASE |
export DESTDIR=$DEST RELEASEDIR=$RELEASE |
| if (-e $DESTDIR); then |
if [ X"$DESTDIR" == X"" ]; then |
| mkdir $DESTDIR/old- |
echo PLEASE SET \$DEST! >2& |
| mv $DESTDIR/* $DESTDIR/old- 2>/dev/null |
exit |
| rm -rf $DESTDIR/old- & |
|
| fi |
fi |
| |
rm -rf $DESTDIR/* $DESTDIR/.* |
| mkdir -p $DESTDIR $RELEASEDIR |
mkdir -p $DESTDIR $RELEASEDIR |
| cd $XSRCDIR |
cd $XSRCDIR |
| nice make release |
nice make release |
|
|
| echo " system-release - Make and validate the system release" |
echo " system-release - Make and validate the system release" |
| echo " xenocara - Build and install xenocara" |
echo " xenocara - Build and install xenocara" |
| echo " xenocara-release - Make and validate the xenocara release" |
echo " xenocara-release - Make and validate the xenocara release" |
| |
echo " full-release - xenocara, xenocara-release, system, system-release" |
| echo |
echo |
| } |
} |
| |
|
| if [ $# = 0 ]; then usage; exit 1; fi |
|
| |
|
| if [ `whoami` != "root" ]; then |
if [ `whoami` != "root" ]; then |
| echo "You must be root to create a release." |
echo "You must be root to build a release." |
| exit 1 |
exit 1 |
| fi |
fi |
| |
|
|
|
| echo " Kernel: $KERNEL-$ARCH" |
echo " Kernel: $KERNEL-$ARCH" |
| echo " Dest: $DEST" |
echo " Dest: $DEST" |
| echo "Release: $RELEASE" |
echo "Release: $RELEASE" |
| |
if [ X"$CVSROOT" != X"" ]; then |
| |
echo " Root: $CVSROOT" |
| |
fi |
| echo |
echo |
| |
|
| |
if [ $# = 0 ]; then usage; exit 1; fi |
| |
|
| for i in $* |
for i in $* |
| do |
do |
| case $i in |
case $i in |
| full-release) |
|
| build_xenocara |
|
| build_system |
|
| make_xenocara_release |
|
| make_system_release |
|
| ;; |
|
| update) |
update) |
| update_sources |
update_sources |
| ;; |
;; |
|
|
| ;; |
;; |
| xenocara-release) |
xenocara-release) |
| make_xenocara_release |
make_xenocara_release |
| |
;; |
| |
full-release) |
| |
build_xenocara |
| |
make_xenocara_release |
| |
build_system |
| |
make_system_release |
| ;; |
;; |
| *) |
*) |
| echo "---------- Abort! Abort! ----------" |
echo "---------- Abort! Abort! ----------" |