Subject: Re: Building userland sources
To: NetBSD/i386 Port <port-i386@NetBSD.org>
From: Holger Weiss <lists@jhweiss.de>
List: port-i386
Date: 07/31/2005 15:48:18
* Scott Crumpler <scrumpler@methylphreak.com> [2005-07-30 22:07]:
> I've updated my kernel sources from 2.0 to 2.0.2, and I'd like to also 
> rebuild the userland tools as well.  I used the build.sh script to 
> actually build all of the sources and that went fine, but now I want to 
> install them and I can't figure out which options.  When I used the -D 
> option and set the destination directory to /, it warned me that this 
> was only available if I also used the expert option. 
>
> Would I be safe in installing the updated userland binaries that way?

No, you shouldn't set the destination directory to /.  If building
fails, you might end up with a partly updated system.

Simply follow the examples in src/BUILDING:

| 1.   % ./build.sh tools kernel=GENERIC
|
|      Build a new toolchain, and use the new toolchain to configure and
|      build a new GENERIC kernel.
|
| 2.   % ./build.sh -U distribution
|
|      Using unprivileged mode, build a complete distribution to a DESTDIR
|      directory that build.sh selects (and will display).

Instead of those two, you could also use:

% ./build.sh -U distribution kernel

Then, in order to install userland:

| 3.   # ./build.sh -U install=/
|
|      As root, install to / the distribution that was built by example 2.
|      Even though this is run as root, -U is required so that the permis-
|      sions stored in DESTDIR/METALOG are correctly applied to the files
|      as they're copied to /.

Alternatively, you can build a release (as Andy suggested):

| 4.   % ./build.sh -U -u release
|
|      Using unprivileged mode, build a complete release to DESTDIR and
|      RELEASEDIR directories that build.sh selects (and will display).
|      MKUPDATE=yes (-u) is set to prevent the ``make cleandir'', so that
|      if this is run after example 2, it doesn't need to redo that portion
|      of the release build.

This isn't i386-specific, of course.

Holger

-- 
PGP fingerprint:  F1F0 9071 8084 A426 DD59  9839 59D3 F3A1 B8B5 D3DE