Subject: Re: updating, build and install order
To: NetBSD current list <current-users@netbsd.org>
From: William Allen Simpson <wsimpson@greendragon.com>
List: current-users
Date: 06/20/2003 09:16:36
Manuel Bouyer wrote:
> 
> On Thu, Jun 19, 2003 at 04:13:59PM +0200, Johnny Billquist wrote:
> > As for compiling, it don't matter which kernel you are using. So any
> 
> it does in one way for build.sh: the kernel version is used for the tools
> path (unless you use -T I guess). A build.sh -u will fail when the
> version of the running kernel changes.
> 
Thanks for pointing this out!  I hadn't noticed that after slavishly 
following the documented instructions, I had *THREE* copies of the tools: 
  /home/current/src/tools/obj/tools.NetBSD-1.6T-i386
  /home/current/src/tools/obj/tools.NetBSD-1.6U-i386
  /usr/tools

So, I spent a few hours testing combinations of parameters.  I just 
discovered that build.sh prints out the path locations several pages 
into its output.  Very handy.  I found some more errors in documentation, 
and some more pitfalls.

One of the most annoying is in
  ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/BUILDING

      -o        Set the value of MKOBJDIRS to ``no''.  Otherwise, it will be
               automatically set to ``yes'' (which is opposite to the default
               behaviour).

This lead me to conclude (with no -o, the default) that the objdirs 
would actually be created.  Apparently not!  I found that -O /usr/obj 
*MUST* be specified, and /usr/obj *MUST* be created, otherwise the obj 
will be in the src tree.  :-(

So, in my PR toolchain/21923, I'll propose diffs to document the 
following commands as recommended for budding current users:

  cd $HOME/src
  mkdir ../obj
  ./build.sh -O ../obj -T ../tools tools >&../building.tools
  ./build.sh -O ../obj -T ../tools kernel=GENERIC >&../building.kernel
  ./build.sh -O ../obj -T ../tools -U build >&../building

  su
  mv /netbsd /netbsd.old
  mv ../obj/sys/arch/i386/compile/GENERIC/netbsd /
  reboot

  cd $HOME/src
  su
  ./build.sh -O ../obj -T ../tools -U install=/ >&../installing
  etcupdate -s ./etc
  reboot

Should the -U be added when building tools and kernel?

Is there anything subtle I missed?

-- 
William Allen Simpson
    Key fingerprint =  17 40 5E 67 15 6F 31 26  DD 0D B9 9B 6A 15 2C 32