Page
https://www.openbsd.org/faq/current.html
states that since Oct 6th, 2016 there is new infrastructure to build base
and since Oct 14th, 2016 for building kernel.
I am only interested in updating kernel source code and building kernel.
I would like to consult if I do this correctly.
I understand that building kernel with external patches is not supported by Project and I can not report problems not reproducible on GENERIC or GENERIC.MP kernel from official snapshots.
Code:
## One-time: I have removed all old files - not required to succesfuly perform clean-up
## Backup your patches, if you have any
# rm -rf /usr/src
# mkdir -p /usr/src/sys
# chown -R root:wsrc /usr/src
# chmod -R 660 /usr/src
# find /usr/src/ -type d -exec chmod ug+x {} \;
## One-time: Fetching kernel source and update to specified date - for those who removed all old files
$ cd /usr
$ export CVSROOT=anoncvs@ftp.hostserver.de:/cvs
$ cvs -qd ${CVSROOT} checkout -P src/sys
$ cd /usr/src
$ time cvs -q -d${CVSROOT} up -D "2016-10-27 11:31:06" -Pd sys
## One-time clean up for those, who do not removed all files from CVS directory
$ cd /sys
$ rm -r arch/*/compile/[GR]*
$ rm arch/*/compile/.cvsignore
$ cd /usr/src
$ time cvs -q -d${CVSROOT} up -D "2016-10-27 11:31:06" -Pd sys
## Updating
$ cd /usr/src
$ time cvs -q -d${CVSROOT} up -D "2016-10-27 11:31:06" -Pd sys
## One-time before first building
$ cd /sys/arch/$(machine)/compile/GENERIC.MP ## my: cd /usr/src/sys/arch/amd64/compile/GENERIC.MP/
$ doas /usr/bin/make obj ## my doas.conf: permit nopass open as root cmd /usr/bin/make args obj
## building
$ cd /sys/arch/$(machine)/compile/GENERIC.MP ## my: cd /usr/src/sys/arch/amd64/compile/GENERIC.MP/
$ make clean
$ doas /usr/bin/make obj ## my doas.conf: permit nopass open as root cmd /usr/bin/make args obj
$ make config
$ make clean
$ time make
$ doas /usr/bin/make install