LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > Musings on technology, philosophy, and life in the corporate world
User Name
Password

Notices


Hi. I'm jon.404, a Unix/Linux/Database/Openstack/Kubernetes Administrator, AWS/GCP/Azure Engineer, 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: *nix.
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 1437 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 03:46 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration