Subject: Re: Rebuild NetBSD
To: yancm@sdf.lonestar.org <yancm@sdf.lonestar.org>
From: Chavdar Ivanov <ci4ic4@gmail.com>
List: netbsd-users
Date: 03/31/2006 14:39:24
On 31/03/06, yancm@sdf.lonestar.org <yancm@sdf.lonestar.org> wrote:
> > BSDOBJDIR /usr/obj does not exist, bailing...
>
> Yes, you must have a directory created with write permissions for the use=
r
> doing the compiling. If you do this with root, it's not a problem...
>
> Let me save you some time (maybe)...
> DO NOT DO THIS ON A CRITICAL SYSTEM the first time you try it!
>
> Here are the steps I use to rebuild the kernal and "userland".
> My source is on /usr/src and my object target is in /usr/obj.
>
> First, sync/update the src tree to a particular release branch.
>    http://mail-index.netbsd.org/netbsd-announce/2005/01/13/0000.html
>
> In my case I track the 2.xxx stable branch and so update with:
> cd /usr
> cvs -q up -rnetbsd-2 -PAd src
> [if they do not exist, create /usr/obj and /usr/tools]
> cd src   [now in /usr/src]
>
> #For clean sheet rebuild:
> ./build.sh -O ../obj -T ../tools kernel=3DMYKERNEL
> [note: MYKERNEL is a customized kernel definition file...this will
> not work for you unless you customize a kernel definition and
> use MYKERNEL for it's name!]
> # Boot into new kernel

I don't think you have to boot into the new kernel in order to perform
the following builds - after all build.sh works cross platform, surely
it will work with the previous version. On the other hand, that might
be considered a good test for the new kernel, so there you are.

> ./build.sh -O ../obj -T ../tools -u distribution

Almost always I build.sh release - takes longer, but is a better test
in my view; I also create the ISOs and use them on a few more machines
(using the update option of the installation procedure).

> ./build.sh -O ../obj -T ../tools -U install=3D/
>
> # After Install - check this
> /usr/src/etc/postinstall -s /usr/src -d // fix defaults mtree obsolete

That's done if you use the created CDs, you just have to be careful to
take a notice of the results.

>
> # Update /etc/
> /usr/sbin/etcupdate -s /usr/src/etc

I unpack the newly created etc.tgz and xetc.tgz into an empty
directory, say, /tmp/x, and

/usr/sbin/etcupdate -a -w 150 -p less -s /tmp/x

(in a large xterm - easier to do the interactive merge).

>
> Hope that helps...
>
>
>
>
>
>
>
>