LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Blogs > Musings on technology, philosophy, and life in the corporate world
User Name
Password

Notices

Hi. I'm a Unix Administrator, mathematics enthusiast, and amateur philosopher. This is where I rant about that which upsets me, laugh about that which amuses me, and jabber about that which holds my interest most: Unix.
Rate this Entry

Automated OpenBSD-STABLE build

Posted 10-08-2012 at 04:54 PM by rocket357
Updated 10-08-2012 at 05:14 PM by rocket357 (refactoring?)

It's ugly. But it works.

Code:
#!/bin/sh

set -e

export LOGFILE=/var/log/build_stable.log
export ARCH=`machine`

# DEFAULT: BUILD -STABLE (UPGRADE TO LATEST -RELEASE FIRST!!)
export BUILDVER=OPENBSD_`uname -r | tr '.' '_'`

cat > ${LOGFILE} << EOF


STABLE BUILD - `date` - `uname -a`


EOF

echo "Updating Sources for ${BUILDVER}"
cd /usr/src
cvs -q up -r${BUILDVER} -Pd >> ${LOGFILE}

echo "Building Kernel..."
cd /usr/src/sys/arch/${ARCH}/conf
/usr/sbin/config GENERIC >> ${LOGFILE}
cd /usr/src/sys/arch/${ARCH}/compile/GENERIC
make clean >> ${LOGFILE}
make depend >> ${LOGFILE}
make >> ${LOGFILE}
cd /usr/src/sys/arch/${ARCH}/compile/GENERIC
make install >> ${LOGFILE}

cat > /etc/rc.firsttime << EOF
#!/bin/sh

set -e

# BUILD USERLAND
echo "Building Userland..."
rm -rf /usr/obj/*
cd /usr/src
make obj >> ${LOGFILE}
cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
cd /usr/src
make build >> ${LOGFILE}

test -d /pub/destdir && mv /pub/destdir{,.old} && rm -rf /pub/destdir.old &
mkdir -p /pub/destdir /pub/OpenBSD/`uname -r`/`uname -m`/ || true

cd /usr/src/etc && env DESTDIR=/pub/destdir RELEASEDIR=/pub/OpenBSD/`uname -r`/${ARCH}/ make release >> ${LOGFILE}
EOF

reboot
Posted in Uncategorized
Views 393 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 04:41 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration