Skip to content

Instantly share code, notes, and snippets.

@irl
Created January 7, 2020 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irl/5c598c0dabc3176e0dee52518cc7b463 to your computer and use it in GitHub Desktop.
Save irl/5c598c0dabc3176e0dee52518cc7b463 to your computer and use it in GitHub Desktop.
#!/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 irl@radiofreqs.space rm -f 'public_html/pub/HamBSD/snapshots/$(machine)/*' && \
scp * irl@radiofreqs.space: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