Created
January 7, 2020 18:00
-
-
Save irl/5c598c0dabc3176e0dee52518cc7b463 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ksh | |
set -e | |
[ $# -ge 1 ] || (echo "usage: $1 [update|kernel]"; exit 1) | |
function update { | |
echo "Updating xenocara..." | |
(cd /usr/xenocara && cvs up -Pd) | |
} | |
function kernel { | |
(cd /usr/src/sys/arch/amd64/compile/GENERIC.MP && \ | |
make obj && \ | |
make config && \ | |
make -j 5 && \ | |
make install) | |
} | |
function base { | |
(cd /usr/src && \ | |
make -j 5 obj && \ | |
make -j 5 build) | |
sysmerge | |
(cd /dev && ./MAKEDEV all) | |
} | |
function base-release { | |
[ -d /noperm ] || mkdir /noperm | |
mount /noperm | |
[ -d /noperm/dest ] || mkdir /noperm/dest | |
chown build:wheel /noperm /noperm/dest | |
chmod 700 /noperm /noperm/dest | |
[ -d /home/release ] || mkdir /home/release | |
chown build:wheel /home/release | |
(export DESTDIR=/noperm/dest RELEASEDIR=/home/release ; \ | |
cd /usr/src/etc && make -j 5 release && \ | |
cd /usr/src/distrib/sets && \ | |
sh checkflist > /root/base.checkflist) | |
} | |
function xenocara { | |
( cd /usr/xenocara && \ | |
make bootstrap && \ | |
make -j 5 obj && \ | |
make -j 5 build ) | |
} | |
function xenocara-release { | |
[ -d /noperm/xdest ] || mkdir /noperm/xdest | |
chown build:wheel /noperm /noperm/xdest | |
chmod 700 /noperm /noperm/xdest | |
( export DESTDIR=/noperm/xdest RELEASEDIR=/home/release ; \ | |
cd /usr/xenocara && \ | |
make -j 5 release && \ | |
make checkdist ) | |
} | |
function iso { | |
( export RELDIR=/home/release RELXDIR=/home/release ; \ | |
cd /usr/src/distrib/$(machine)/iso && make && \ | |
make install ) | |
} | |
function upload { | |
( cd /home/release && \ | |
ssh [email protected] rm -f 'public_html/pub/HamBSD/snapshots/$(machine)/*' && \ | |
scp * [email protected]:public_html/pub/HamBSD/snapshots/$(machine)/ ) | |
} | |
command=$1 | |
shift | |
case $command in | |
update) update ;; | |
kernel) kernel ;; | |
base) base ;; | |
base-release) base-release ;; | |
xenocara) xenocara ;; | |
xenocara-release) xenocara-release ;; | |
iso) iso ;; | |
upload) upload ;; | |
*) echo "Unknown option $command"; exit 1 ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment