NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fix the Guide (Re: Recovering from botched update?)



On Jun 16,  9:22am, Thor Lancelot Simon wrote:
} On Sun, Jan 24, 2010 at 10:30:16AM -0800, John Nemeth wrote:
} > 
} >      Checking that it is the default going forward might be useful, but
} > it doesn't help with older versions until such a change is pullled up.
} 
} As far as I can tell, on any version of NetBSD from the NetBSD-5 branch
} point until now (and probably earlier), the simplest command to build
} the system is "build.sh -U -O <absolute path to desired objdir> distribution".

     Everything inside /etc/mk.conf is enclosed in .ifdef BSD_PKG_MK.
Did a fresh cvs up immediately before doing this test.  Note that the
first test was done as root.  build.sh is rev. 1.228.  From visual
inspection, I note that bsd.prog.mk and bsd.kernobj.mk are used in
determining TOOLDIR.  Those are rev. 1.246 and rev. 1.12 respectively.
BTW, the host is currently:

P4-3679GHz: {261} uname -a
NetBSD P4-3679GHz 5.99.22 NetBSD 5.99.22 (GENERIC) #4: Sun Dec 20 01:24:17 PST 
2009  
jnemeth@P4-3679GHz:/usr/local/NetBSD-current/i386-objdir/sys/arch/i386/compile/GENERIC
 i386

P4-3679GHz: {250} cd /usr/src
P4-3679GHz: {251} ./build.sh -U -O /usr/obj distribution

The last few lines are:

-----

#    objdir  /usr/obj/tools
===> TOOLDIR path:
===> DESTDIR path:     /usr/obj/destdir.i386
===> RELEASEDIR path:     /usr/obj/releasedir

ERROR: TOOLDIR '' invalid
*** BUILD ABORTED ***

-----

Doing:

-----

   252  rm -r /usr/obj
   253  mkdir /usr/obj
   254  chmod 777 /usr/obj
   255  su jnemeth

-----

produced the exact same result.

} By (matt's) code inspection, this should be the case all the way back
} to NetBSD 2.0.

     As shown above, my test showed differently.

} This will put the tooldir in the objdir and even automatically create
} the objdir if it does not exist and the user has permission to do so.

     After the test, /usr/obj contained:

-----

P4-3679GHz: {264} ls -aglR /usr/obj
total 12
drwxr-xr-x   3 root  wheel  512 Jan 24 12:48 ./
drwxr-xr-x  21 root  wheel  512 Jan 24 12:48 ../
drwxr-xr-x   2 root  wheel  512 Jan 24 12:48 tools/

/usr/obj/tools:
total 8
drwxr-xr-x  2 root  wheel  512 Jan 24 12:48 ./
drwxr-xr-x  3 root  wheel  512 Jan 24 12:48 ../

-----

} I see no compelling reason to put a more complex procedure in the Guide
} though we should probably note that using relative paths on the build.sh
} command line is a bad idea.

     In any event, sections 33.1.1 and 33.1.5 (2) are inconsistent in
that the latter has -O -T.  33.1.5 also uses -u, but I left that for
now.  The instructions should be consistent.

     Yet more tests...

     The guide currently says:

-----

33.1.1. Building a new userland

The first step is to build the userland:

$ cd /usr/src
$  ./build.sh -U distribution

33.1.2. Building a new kernel

The next step will build the kernel:

$ cd /usr/src
$ ./build.sh -O ../obj -T ../tools kernel=<KERNEL>
     
-----

Following 33.1.1, the build blows up complaining about a missing
/usr/obj.  Making /usr/obj and retesting blows up with an invalid
TOOLDIR.  Trying "./build.sh -O ../obj -U distribution" also blows up
with an invalid TOOLDIR.  Trying with an "/usr/obj" also bombs.  Trying
with "./build.sh ... tools distribution" as suggested elsewhere also
bombs.

     The last couple of changes to build.sh are:

----------------------------
revision 1.228
date: 2010/01/13 02:24:06;  author: pooka;  state: Exp;  lines: +6 -3
need object directory for etc/mtree to run distrib-dirs
----------------------------
revision 1.227
date: 2010/01/13 02:18:25;  author: pooka;  state: Exp;  lines: +7 -5
In rumptest, create obj dirs before distrib dirs.  Fail if distrib dir
creation fails.

per clue-by-4 from mrg
----------------------------

Neither bsd.prog.mk nor bsd,kernobj.mk have been touched since 2003.

     On a whim, I rebuilt /bin/sh and reinstalled it.  No difference.

}-- End of excerpt from Thor Lancelot Simon


Home | Main Index | Thread Index | Old Index