NetBSD Build World

enough disk space, eventually give your guest an additional vdisk,

dd if=/dev/zero of=bsdbuild.data.ffs bs=1G count=0 seek=10000
...
disklabel xbd1
newfs -O2 /dev/xbd1a
dumpfs /dev/rxbd1a | head -3
vi /etc/fstab

/dev/xbd1a /data ffs rw 0 2

mount /data

enough processing power,

egrep 'memory|^[v]?cpu' /var/run/dmesg.boot

run the build inside a tmux or screen session,

export PKG_PATH="http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.0/All/"
pkg_add screen
cp /usr/pkg/share/examples/screen/etcscreenrc /usr/pkg/etc/screenrc
ln -s /usr/pkg/etc/screenrc /root/screenrc
cat >> /root/screenrc <<-EOF
caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
bindkey ^[, prev
bindkey ^[. next
defscrollback 100000
EOF
screen -S build

now proceed,

cd /data
ls -alkF
ftp -a ftp://ftp.ee.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/src.tar.gz
ftp -a ftp://ftp.ee.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/src.tar.gz.SHA1
sha1 src.tar.gz
cat src.tar.gz.SHA1
progress -zf src.tar.gz tar xf -

handy symlinks

cd ~/
ln -s /data/src
cd /usr/
ln -s /data/src

clean everything up before building

rm -rf ../tooldir ../destdir ../releasedir ../objdir
mkdir ../tooldir ../destdir ../releasedir ../objdir
time ./build.sh -T ../tooldir -D ../destdir -R ../releasedir -O ../objdir -j24 cleandir \
    >/dev/null && print cleandir done #207.62s
rm -f *.log
rm -rf obj tools/obj
rm -rf dist/bind/bin/tests/system/dnssec/ns1

get up-to-date source tree

cd /data/src/
#cvs -n -q -z9 up -dP
time cvs -q -z9 up -dP #183.44s

in case you are looking for a very recent commit or bug fix e.g.

cd sbin/fsck_ext2fs/
cvs -z9 log -h setup.c

prepare the toolchain

time ./build.sh -T ../tooldir -O ../objdir -j24 tools \
    > ../make.tools.log && print tools done #1103.07s/1158.18s
tail ../make.tools.log

without X11, no -x,

rm -rf ../destdir ../releasedir
mkdir ../destdir ../releasedir

#time ./build.sh -T ../tooldir -D ../destdir -O ../objdir -j24 sets \
#   > ../make.sets.log && print sets done
#tail -100 ../make.sets.log 

time ./build.sh -T ../tooldir -D ../destdir -R ../releasedir -O ../objdir -j24 release \
    > ../make.release.log && print release done #8247.83s
tail ../make.release.log

and eventually look at the cpu usage,

pkg_add htop
mkdir /proc
echo "procfs /proc procfs ro,linux 0 0" >> /etc/fstab
mount /proc

egrep '^[v]?cpu' /var/run/dmesg.boot | tail -2
htop

clean-up

cd /data/
rm -rf dest/ destdir/ objdir/ releasedir/ tooldir/

references


Nethence | Doc | Pub | Lab | Pbraun | SNE Russia | xhtml