Subject: Re: upgrading NetBSD, step order
To: Brian <asemisldkfj@fastmail.fm>
From: Perry E. Metzger <perry@piermont.com>
List: netbsd-help
Date: 12/27/2005 14:50:36
"Brian" <asemisldkfj@fastmail.fm> writes:
> so over at bsdnexus forums, we're having a discussion about the proper
> order of the steps used to update an existing NetBSD system.
>
> http://forums.bsdnexus.com/viewtopic.php?id=678
>
> WIntellect claims that you should build tools, build distribution, build
> and install kernel, reboot, and install the userland.

Well, you should certainly install a new kernel before you install a
new userland, because the new userland might require the new kernel.

However, in build.sh land, the order in which some of this gets built
is more flexible than it used to be.

> as I've always understood it, you're supposed to build and install a new
> kernel before doing anything else, e.g. build tools, build and install
> kernel, reboot, build distribution, install the userland.

That's not necessary with build.sh -- you can build all the stuff and
then install it later.

> while both ways have always worked perfectly fine for me, and are only
> minutely different, to me it seems like a waste of time to run
> ./build.sh distribution before booting and testing a newly compiled
> kernel.  WIntellect however, told me that when you run ./build.sh tools,
> it uses your currently installed kernel as a reference,

As a reference for what? build.sh doesn't even care about what os it is
running on (it runs on things other than NetBSD). It pays no attention
to /netbsd, certainly.

> and if you built
> the distribution after installing a new kernel, the tools would be out
> of sync with the new kernel and could cause problems.

I have no idea what he means.

> so my question is, should you run ./build.sh distribution before or
> after building and installing a new kernel?

If you are building sets that you're going to install later, it makes
no difference. If you are installing in place during the build, you
obviously need the new kernel to be already installed or you'll get
into a bit of trouble if the new userland does new syscalls.

> and where could I find more
> info about building the tools?  there wasn't very much about it in
> /usr/src/BUILDING.

That's because it isn't terribly hard (or important -- if you don't
build the tools explicitly, build.sh in most cases just builds them
for you anyway.)

-- 
Perry E. Metzger		perry@piermont.com