NetBSD upgrade from sources

NetBSD

Yesterday I finally find the time to upgrade wolverine, my NetBSD test server. I was in the mood to try something new, so I decided to perform the upgrade starting from sources.

It was really smooth, although it took a lot of time to compile everything (wolverine is a PIII 500Mhz). Here are the steps performed.

Backup data (/etc):

$ tar zcvf etc-3.0.tar.gz /etc

Prepare the directories (as root):

% mkdir /usr/src
% mkdir /usr/obj
% mkdir -p /usr/builds/i386
% mkdir -p /usr/releases/i386

Change the ownership of those directories to you user.

Get the sources:

$ wget ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-3.0.2/source/sets/*.tgz

Unpack the sources:

$ for file in *.tgz; do tar zxvf $file -C /; done

Build or update the crosscompiler:

$ cd /usr/src
$ ./build.sh -D /usr/builds/i386 -R /usr/releases/i386 -u -m i386 tools

Crosscompile the kernel:

$ ./build.sh -D /usr/builds/i386 -R /usr/releases/i386 -u -m i386 kernel=GENERIC

Install the new kernel (as root):

% cd /
% mv netbsd netbsd-3.0
% cp /usr/src/sys/arch/i386/compile/obj/GENERIC/netbsd .

Reboot the system.

Crosscompile the userland:

$ build.sh -D /usr/builds/i386/ -R /usr/releases/i386/ -U -u -m i386 build

Install (as root):

% build.sh -D /usr/builds/i386/ -R /usr/releases/i386/ -U -u -m i386 install=/

Review postinstall failed checks and fix things accordingly.

Update /etc (as root):

% /usr/sbin/etcupdate
Filed under bsd sysadmin unix

glider [ minitrack ] ikiwiki Creative Commons VIM powered