UPDATING revision 1.145
1$NetBSD: UPDATING,v 1.145 2006/01/31 22:54:22 martin Exp $
2
3This file (UPDATING) is intended to be a brief reference to recent
4changes that might cause problems in the build process, and a guide for
5what to do if something doesn't work.
6
7For a more detailed description of the recommended way to build NetBSD
8using build.sh, see the BUILDING file.
9
10Note that much of the advice in this UPDATING file was written before
11build.sh existed.  Nevertheless, the advice here may be useful for
12working around specific problems with build.sh.
13
14See also: BUILDING, build.sh, Makefile.
15
16Recent changes:
17^^^^^^^^^^^^^^^
18
1920060131:
20	the protocol between the sparc64 bootloader (ofwboot) and
21	the kernel was changed. Before installing a new kernel,
22	you need to update ofwboot. After a full build, just copy
23	/usr/mdec/ofwboot to /, or do a rebuild of
24	src/sys/arch/sparc/stand/ofwboot and install the result to /.
25
2620050917:
27	arch/*/conf/std.* was changed to include conf/std, which
28	contains MI options previously enabled by default.
29	If you have kernel config files which doesn't include
30	arch/*/conf/std.*, you need to edit them to include conf/std
31	to get the previous configuration.
32
3320050830:
34	named.conf was moved from /etc/namedb to /etc.
35	postinstall(8) migrates this during interactive use.
36	Users of MKUPDATE=yes will need to manually rectify
37	this in their DESTDIR.
38
3920050825:
40	Some data structures in sys/device.h, related to interface
41	attributes and locator names, were changed. config(1) was
42	modified to emit the new data structures.
43	Thus usr.bin/config must be updated (and run on the kernel
44	configuration file) before a new kernel can be built.
45
4620050531:
47	genassym.sh(8) was moved to genassym(1). You need to either build
48	tools first or install the version of genassym from /usr/bin before
49	you can build a kernel again.
50
5120050520:
52	Because a kernfs bug which xentools relies on was fixed,
53	xentools up to xentools20-2.0.3nb4 won't work with new kernel.
54
5520050417:
56	postinstall(8) was moved from /etc to /usr/sbin and made part
57	of the "base" set, to make it easier to invoke after an
58	upgrade.
59
6020050325:
61	pcppi(4) was separated in two devices, adding attimer(4).  Be sure
62	to add a config line for an attimer(4) device in your kernel
63	configuration, or you won't be able to set the pitch of the beep
64	with wsconsctl.  Depending on the default value for the pitch, you
65	might even not hear any more beep.  Also, it is advised to attach both
66	devices the same way (i.e., both on isa or both on acpi) or the
67	pcppi(4) device may fail to find the attimer(4) one.
68
6920050211:
70	Fixes to tools/Makefile.gnuhost may cause UPDATE=1 builds in
71	some of the cross tools to fail if they use configure. Some configure's
72	cache the environment passed in and notice the new environment is
73	different and abort. Doing a clean in tools/ should be enough to
74	make a build continue.
75
7620050109:
77	Since su is using pam by default now, make sure that you have
78	/etc/pam.d populated (postinstall will do that automatically
79	for you). Otherwise su will fail open (i.e. will not require
80	a password).
81
8220041229:
83	Make had a path resolution bug that manifested itself as not
84	being able to install openpam.3. This bug has been fixed, but
85	you might need to rebuild make manually first to get through
86	the build.
87
8820041201:
89	Userland programs have been changed to use /dev/bpf instead of
90	/dev/bpfX. You need to create that device by installing a new
91	MAKEDEV and running it, or mv /dev/bpf0 /dev/bpf && rm /dev/bpf[0-9]*
92
9320041006:
94
95	A bug was introduced into /bin/sh (var.c rev 1.35) which causes
96	variables to not export correctly to subshells in all cases. This
97	will cause builds to break if that version of /bin/sh is installed
98	on the system. The proper version of /bin/sh can be verified with:
99
100        ident /bin/sh | grep var
101
102	Any /bin/sh w. version 1.35 will not work and needs to be updated
103	before attempting a build.
104	
10520041001:
106	The ipfilter kernel sources moved from sys/netinet to
107	dist/sys/ipf/netinet. Due to the move some Makefile
108	dependencies are now dangling requiring a make cleandir
109	before they work again (kdump, ktruss, rescue, ipf, and
110	ftp-proxy are the victims).
111
11220040715:
113	The rc.d/sendmail script now uses a heuristic to determine
114	if sendmail should be started at boot time.  It checks the
115	contents of /etc/mailer.conf, /etc/mail/submit.cf, and the
116	owner and mode of the sendmail binary to see if any changes
117	to the mail infrastructure have been made.  If no changes
118	are detected, it will start an SMTP listener.
119
120	Setting sendmail=NO in /etc/rc.conf will override this.
121
122	If you are only using sendmail by default and only for
123	local delivery, it is important that you also update your
124	sendmail.cf so that the SMTP listener only listens on the
125	loopback interface.
126
12720040715:
128	The method by which athhal-elf.o gets pulled into i386
129	kernel builds has been changed again.  The latest version
130	of bsd.files.mk is no longer required.
131
13220040621:
133	Due to the recent rototill of tools/compat it's crucial one starts
134	from a clean objdir under tools/*.
135
136	This is mostly due to generated files (yacc and lex sources) needing
137	to be generated with new rules from bsd.hostprog.mk.
138
139	The safest course is to rm -rf all objects under tools before building.
140
14120040516:
142	The end-user modifiable X11 configuration has been moved
143	from /usr/X11R6/lib/X11/<dir> to /etc/X11/<dir>.
144	Ensure that src and xsrc is up to date, and run
145	"make cleandir" in src/x11 before your next build.
146
147	postinstall currently doesn't migrate the files from
148	/usr/X11R6/lib/X11/* to /etc/X11/* although it does
149	detect that this needs to occur, so you'll have to
150	manually move these files yourself.
151
15220040426:
153	Support for the original dynamic sysctl node structure has
154	been removed in favor of the newer layout.  This affects
155	consumers of the create and delete interface, as well as
156	the dynamic discovery mechanism.  This is believed only to
157	be the sysctl(8) binary itself, at this point in time, so
158	the only effect of this should be that a sysctl binary
159	built from sources dated between 2003/12/04 and 2004/03/24
160	will not work on a kernel built from sources dated after
161	2004/04/25.  If you need a new sysctl binary but build.sh
162	does not work, make sure that your revision of
163	src/sys/sys/sysctl.h is 1.112 (or later), and then the
164	do the following:
165
166	cd /usr/src (or wherever your source tree is)
167	make USETOOLS=no includes
168	cd lib/libc
169	make USETOOLS=no dependall install
170	cd ../../sbin/sysctl
171	make USETOOLS=no dependall install
172
173	If you are using older sysctl binary, GNU autoconf would fail to
174	identify your machine architecture, and tries to build binary for
175	"unknown-unknown-netbsd20F" or something like that.  if that happens,
176	make sure to follow the above steps.
177
17820040425:
179	The ffs superblock issues listed below under 20040109 and 20030402
180	are now automatically addressed by the /etc/rc.d/fixsb script or by
181	sysinst when it checks a a filesystem. The manual fsck_ffs -b16 -c4
182	invocation mentioned below will continue to work and is now
183	automated by those scripts.  Note that under certain circumstances,
184	affected filesystems upgraded to a -current kernel first before
185	upgrading their userland with the fixsb and fsck_ffs fixes may
186	encounter a 'freeing free inode' panic when writing to the affected
187	filesystem, so it is a good idea to repair the filesystem as soon as
188	possible.  For more details on the fixsb script, see pr install/25138.
189
19020040418:
191	statfs(2) and friends have been replaced with statvfs(2). Before
192	installing a newly build userland make sure that you are running
193	a newly built kernel with COMPAT_20 set. In addition your libc
194	build might not work (undefined SYS_statfs symbol) because make
195	clean does not know how to remove files it does not know about
196	anymore. Manually remove all generated .S sources and objects
197	from the libc build directory.
198
19920040326:
200	The method by which athhal-elf.o gets pulled into i386 kernel builds
201	has been changed. The file is now stored as a uuencoded file in CVS
202	and the generated Makefile will use the new .uue rules from bsd.file.mk
203	to build it.
204
205	This means you must have the latest bsd.files.mk installed when
206	building a kernel without USETOOLS=yes.
207
20820040318:
209	A bug in the cgd(4) blowfish code was corrected, without
210	provision of backwards compatibility, after several public
211	notices over several months. Users of cgd with blowfish cipher
212	ONLY must dump their data before updating their kernels, and
213	recreate cgd's and restore data using the new kernel. See
214	(recent message to current-users, URL when mail-index has updated)
215
21620040313:
217	On acorn32, the opms and qms drivers have been withdrawn, and
218	the old wsqms driver is now called qms.  Kernel config files
219	will need updating.  See the ones in sys/arch/acorn32/conf
220	for examples.
221
22220040125:
223	On acorn32, the beep and sysbeep devices are no longer
224	needed, and will need to be deleted from kernel configuration
225	files.
226
22720040109:
228	Compatibility for old ffs superblock layouts has been
229	added, and the restrictive fsck checks have been reenabled
230	when using those layouts.  If you have been using -current
231	since 20030402, you may find that fsck again signals fatal
232	superblock mismatches.  To repair, make sure you have
233	an updated fsck_ffs and then you can use fsck_ffs -b 16 -c 4
234	to complete the filesystem upgrade.  A message has
235	been added to the kernel which should detect this problem.
236	See the following discussion for more information:
237	http://mail-index.NetBSD.org/current-users/2004/01/11/0022.html
238
23920031203:
240	New binutils builds may fail due to old dependencies.
241	It's necessary to "make cleandir" to ensure that
242	the dependencies will be rebuilt correctly.
243
24420031111:
245	A newer mkdep is needed.  Error noting that is
246		cc: Ambiguous abbreviation --
247
24820031008:
249	/usr/include/sys/disklabel_mbr.h was removed.
250	It's necessary to "make cleandir" to ensure that
251	the dependencies will be rebuilt correctly.
252
25320031007:
254	A sign exension bug was fixed which set all the high bits
255	of our newly expanded ffs fs_flags.  This should only
256	affect users who installed or upgraded in September of 2003.
257	A small utility program was posted to tech-kern which
258	should fix this problem, and a warning message was added
259	to the kernel which should discover and warn about it.  See
260	http://mail-index.NetBSD.org/tech-kern/2003/10/07/0005.html
261
26220030906:
263	With the addition of siginfo support the old signal trampoline
264	code has been deprecated to COMPAT_16. Make sure that your running
265	kernel has COMPAT_16 enabled before building userland.
266
26720030801:
268	With the new openssl, there is some header and library shuffling.
269	rm -f /usr/include/des.h /usr/include/kerberosIV/* /lib/libdes* \
270	/usr/lib/libdes* before building.
271
27220030703:
273	Texinfo was updated to 4.6.  To avoid failures when trying to
274	build the included texinfo files, do:
275
276	cd src/gnu/usr.bin/texinfo
277	make MKINFO=no dependall install
278
27920030630:
280	Groff was updated to 1.19; it's probably necessary to do
281		cd share/mk && make install
282		cd src/gnu/usr.bin/groff
283		make MKMAN=no dependall install
284	(untested).
285
28620030516:
287	Due to bugs in the export handling code, invalid export lines
288	were accepted before and caused the kernel to panic when
289	mountd got restarted because it freed memory that had already
290	been freed. This has been fixed and the kernel checks
291	export addresses very strictly. If you upgrade your kernel,
292	make sure you also upgrade mountd, because if your export
293	file contains lines with an old inet4 address syntax (i.e.
294	a.b.c or a.b or a), they will get rejected by the new kernel.
295
29620030402:
297	The superblock layout for FFS was changed.  If you have 1.6
298	fsck binaries, they will signal a fatal superblock mismatch
299	with the first alternate, because they compare too many
300	fields (even ones that aren't useful).  If possible, upgrade
301	your fsck_ffs binary before using a new kernel.
302	None of this signals actual filesystem damage.
303
30420030324:
305	sendmail version 8.12.8 was imported.  Since sendmail is
306	now setgid to the smmsp group, and runs in "collection"
307	mode for most common activities, there is a new config
308	file called submit.cf that needs to live in /etc/mail.
309	The generic submit.cf sample in /usr/share/sendmail/cf
310	is named netbsd-msp.cf.  Upgrading your regular sendmail
311	configuration file is also strongly advised.
312
313	See the section named "MESSAGE SUBMISSION PROGRAM" in
314	the updated /usr/share/sendmail/README file for more
315	information.
316
31720030117:
318	Texinfo was updated to 4.3.  To avoid failures when trying to
319	build the included texinfo files, do:
320
321	cd src/gnu/usr.bin/texinfo
322	make MKINFO=no dependall install
323
32420021223:
325	The METALOG format changed slightly, to remove the leading
326	"${DESTDIR}" from path names.
327	This only affects people building with UNPRIVED.
328	For complete safety, remove the DESTDIR entirely and
329	update tools/mtree, before running make build.
330
33120021219:
332	CVS repository layout was changed.  See the following for details
333	if you are using (anonymous) cvs to update your tree.
334
335	http://mail-index.NetBSD.org/netbsd-announce/2002/12/19/0000.html
336
33720021219:
338	install(1) had a '-N dbdir' option added, to specify an
339	alternate location to look up users & groups (instead
340	of the host system passwd(5) and group(5) databases).
341
342	The build system was modified to take advantage of
343	this option (using ${NETBSDSRCDIR}/etc), so if you
344	use USETOOLS==no, you may have to rebuild and
345	reinstall usr.bin/xinstall first.
346
34720021130:
348	fparseln(3) moved from libutil to libc.
349	If building to DESTDIR=/, reinstall the includes
350	and rebuild libc:
351		make includes
352		make do-lib-libc
353	If using build.sh, "cd tools/compat && make clean"
354	before rebuilding the tools.
355
35620021126:
357	The mk.conf(5) variable SYS_INCLUDE has been deprecated,
358	including the optional "SYS_INCLUDE=symlinks" support.
359	All header files, including <sys/*.h> are copied into
360	/usr/include.
361
36220021121:
363	The C run-time support files crtbegin.o and crtend.o
364	(and their companions crtbeginS.o and crtendS.o) were
365	split up, with new crti.o and crtn.o files resulting.
366	This means that libtool needs to be rebuilt once the
367	new libraries are installed.  The process of rebuilding
368	libtool will cause it to automatically notice the new
369	required files, but it *must* be rebuilt in order to
370	do this.
371
372	An out-of-date libtool will result in shared libraries
373	which lack _init() and _fini() routines, which means that
374	their global contructors/destructors will not be invoked.
375
37620021121:
377	A bug related to how ARM ELF objects were tagged has been
378	corrected.
379
380	NetBSD ARM ELF uses the soft-VFP floating point model by
381	default.  However, the assembler lacked support for marking
382	objects as using the VFP floating point format, and the
383	compiler was not properly passing the flag indicating "soft-VFP"
384	to the assembler.
385
386	Unfortunately, this means that the linker will now consider
387	old (i.e. not marked "softvfp") NetBSD ARM ELF objects to be
388	incompatible with new (properly marked) objects.
389
390	The problem will only manifest itself if you attempt to compile
391	a new program using the fixed toolchain, and link that program
392	against old libraries which do not have the proper "softvfp"
393	markings.  ALL OF YOUR EXISTING BINARIES AND SHARED LIBRARIES
394	WILL CONTINUE TO WORK PROPERLY.
395
396	The only work-around for the problem is to recompile all of
397	the libraries on the system.  The easiest way to do this for
398	system libraries is to install a binary snapshot; they are
399	generally available on releng.NetBSD.org.  Any packages you
400	have installed which supply libraries will have to be recompiled
401	if you wish to link new programs against those libraries.
402
403	If you have questions about this matter, please contact
404	port-arm@NetBSD.org.
405
40620021011:
407	Systrace has been improved to support privilege elevation.
408	Updating the kernel requires the userland part of systrace
409	to be rebuilt.
410
41120021010:
412	The config(8) grammar was changed to allow options to register
413	dependencies on attributes, as well as other options.  Users
414	must update and reinstall usr.sbin/config before building a new
415	kernel.
416
41720021009:
418	A new attribute dependency syntax was introduced to config(8),
419	which is now used by the SCSI configuration description.  Users
420	must update and reinstall usr.sbin/config before building a new
421	kernel.
422
42320021003:
424	Several changes have been made to the autoconfiguration
425	framework.  Users must update and reinstall usr.sbin/config
426	before building a new kernel.
427
42820021001:
429	The i386mp branch has been merged.  To compile a kernel, users
430	will need to add the option 'cpu* at mainbus?' to their configuration
431	file.  Multiprocessor kernels will need
432	ioapic*		at mainbus? apid ?
433	options		MULTIPROCESSOR
434	options		COM_MPLOCK
435
43620020922:
437	MKDYNAMICROOT=yes enabled by default, which means that
438	certain shared libraries are installed into /lib, the shared
439	linker is installed into /libexec, and all programs in /bin
440	and /sbin are dynamically linked.
441	If you do not use "make build", you should ensure that
442	you have the libraries and shared linker in the new locations,
443	with:
444		make do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.elf_so
445
44620020917:
447	USE_NEW_TOOLCHAIN has been replaced with:
448	    -	TOOLCHAIN_MISSING -- set to "yes" on platforms for which
449		there is no working in-tree toolchain (hppa, ns32k, sh5,
450		x86_64).
451	    -	EXTERNAL_TOOLCHAIN -- if defined by the user, points to the
452		root of an external toolchain (e.g. /usr/local/gnu).  This
453		enables the cross-build framework even for TOOLCHAIN_MISSING
454		platforms.
455
45620020906:
457	gehenna-devsw has been merged into the trunk. Need to update and
458	reinstall usr.sbin/config before building the kernel.
459
46020020822:
461	Crunched rescue tools (contents of /bin and /sbin, plus others)
462	are now provided in /rescue.
463
464	To ensure that these are built statically linked (no matter
465	what the setting of LDSTATIC is), use a crunchgen(1) built
466	from sources newer than 20020820 (see the next entry).
467
46820020820:
469	crunchgen(1) changed to ensure that the generated program
470	is statically linked.
471
472	Solution: update and reinstall usr.bin/crunch
473
47420020605:
475	smmsp user/group has been added for sendmail.
476
477	Add the following into /etc/group:
478
479	smmsp:*:17:
480
481	and the following to /etc/master.passwd (via vipw):
482
483	smmsp:*:17:17::0:0:Sendmail Message Submission Program:/nonexistent:/sbin/nologin
484
48520020515:
486	sshd user/group has been added.  Need to hand add this in, or sshd
487	will not let you log in (with default, or UsePrivlegeSeparation=yes)
488
489	Add the following into /etc/group:
490
491	sshd:*:16:
492
493	and the following to /etc/master.passwd (via vipw):
494
495	sshd:*:16:16::0:0:& pseudo-user:/var/chroot/sshd:/sbin/nologin
496	
497	Also /var/chroot/sshd directory needs to be present (digged as part of
498	the build process).
499
50020020426:
501	NBUILDJOBS obsoleted in favor of just using -j.
502
50320020426:
504	etc/postinstall added, which performs various checks for 
505	configuration file updates and changes, and can fix most of
506	the problems identified.
507	This should make it much easier to upgrade a system's
508	configuration from earlier systems (as far back as NetBSD 1.5).
509
51020020320:
511	<bsd.lib.mk> needs a new install(1) for its "-a cmd" support.
512	Build and install at usr.bin/xinstall before the build.
513
51420020319:
515	Raw IPv6 socket now makes strict checking for sa_family and sa_len
516	on send(2) operation.  Be sure to have sbin/rtsol and usr.sbin/rtsold
517	newer than November 2001 when you upgrade the kernel.
518
51920020311:
520	ssh configuration files were moved from /etc to /etc/ssh.  Beware
521	if you restart your machine from remote.  Note that sshd.conf needs
522	to be changed (due to the use of "/etc" inside).
523
52420020223:
525	Users of the VAX port will need to rebuild and install gas
526	so it deal with the now present register prefix used in all
527	the VAX assembly files.
528
52920020118:
530	ntpd user/group has been added.  Need to hand add this in or builds
531	will break as mtree aborts early.
532
533	Add the following into /etc/group:
534
535	ntpd:*:15:
536
537	and the following to /etc/master.passwd (via vipw):
538
539	ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
540
54120011207:
542	If you're attempting to build a snapshot on sparc64 and are getting
543	reloc errors from the toolchain groff binary this means your native
544	toolchain has some broken C++ bits.
545
546	To fix:
547
548	Build a new toolchain (i.e. build.sh -t)
549	Use the new toolchain to build and install natively (i.e. /usr/lib)
550
551	gnu/lib/libgcc
552	gnu/lib/libstdc++
553
554	After this a snapshot will be able to be built.
555
55620011201:
557	In order for a sparc64 build to work you must have a working awk. If
558	you've built and installed a system with the new toolchain up to this
559	point you do not have a working awk as its ability to do floating
560	point is broken. 
561
562	To build:
563
564	remake and install gnu/lib/libgcc
565	remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links
566	against the new libgcc.a)
567
56820011128:
569	Kernel config information was changed to use defflag in
570	the various "files" files.  Bug fixes to config(8) are
571	required in order for this to work properly.  Make sure
572	to build and install in usr.sbin/config before attempting
573	to build a new kernel.
574
57520011030:
576	libc/locale/wcstod.c now needs new lint(1). Update lint(1)
577	before building libc.
578
57920011029:
580	The new document BUILDING.mdoc (view with nroff | more, or
581	see pre-generated .txt and .html versions) describes the build
582	procedure in great detail.  BUILDING, and the USE_NEW_TOOLCHAIN
583	build process, are intended in the long run to replace this
584	manual update log.
585
586	Users building a USE_NEW_TOOLCHAIN system should read the
587	BUILDING document for caveats.  Generally, BUILDING supersedes
588	UPDATING for these systems, as tool updating is taken care of
589	by the new build system.
590
59120011028:
592	src/etc/Makefile now needs install to be able to handle
593	symlinks that point to nowhere. A bug in install that
594	prevented this was corrected.
595
596	Solution: update and reinstall usr.bin/xinstall
597	Better Solution: Use the new toolchain and it will just work
598	for you.
599
60020011006:
601	/etc/mtree/NetBSD.dist has been updated to take advantage of
602	absolute path support added to mtree(8). Older mtree(8)s don't
603	understand the format.
604
605	Solution: update and reinstall usr.sbin/mtree
606
60720011004:
608	Crunchgen has been updated to work via reach-over makefiles. Updating
609	is suggested before running a snapshot build
610
61120010915:
612	The new "ubcperf" code committed by Chuck Silvers removed
613	a header file, uvm/uvm_vnode.h.  There may be stale .depend
614	files that still reference this file.
615
616	Solution: "make cleandir && make dependall" in affected
617	directories.
618
61920010803:
620	grep.info is now built from grep.texi using makeinfo.  Since it
621	requires makeinfo v4.0, you need to install new texinfo before
622	building gnu/usr.bin/grep.  To install new texinfo, please follow
623	the instruction described in 20010726 entry.
624
62520010803: 
626	(i386 only): i386 kernel now uses new instructions like
627	`fxsave' which old gas doesn't understand.  To build the
628	kernel successfully, you need to build and install a new toolchain, 
629	(i.e., build.sh -t) or 	(temporarily) comment out "options I686_CPU" 
630	from your kernel configuration until you rebuild your userland.
631	See 20011029 above and BUILDING file in this directory for more information.
632	[updated 20020630 since i386 gas moved when USE_NEW_TOOLCHAIN enabled]
633
63420010731:
635	Bootloader update on ELF platforms.  DDB in kernels from before
636	this will be unable to read symbol tables provided by newer
637	bootloaders.
638
63920010726:
640	Texinfo was updated to 4.0.  To avoid failures when trying to
641	build the included texinfo files, do:
642
643	cd src/gnu/usr.bin/texinfo
644	make MKINFO=no dependall install
645
64620010718:
647	Enabled correct .init/.fini processing in crt0.  The way this
648	was done was to change a -I directive to cc(1), which means
649	make(1) will have a stale dependency (it will be checking the
650	timestamp on the wrong "dot_init.h").
651
652	The symptom you will see is that new programs die with SIGSEGV
653	if you have a stale dependency.
654
655	Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
656	before starting your build.
657
65820010628:
659	A construct was added to uvm_page.h that uncovered a bug
660	in lint(1).  If you get a warning/error about a non-portable
661	bitfield, update your lint(1) before proceeding.
662
66320010226:
664	Added named user/group to system. Need to hand add this in or builds
665	will break as mtree aborts early.
666
667	To work around add by hand:
668
669	named:*:14:
670
671	to /etc/group and add:
672
673	named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
674
675	to master.passwd (use vipw for instance if doing by hand).
676
677	Now a make build should progress.
678
67920010219:
680	get/setprogname() added. Any hostprogs that may use this will need
681	to be bootstrapped manually until the host system is current.
682
683	Known problems: sys/arch/macppc/stand/fixcoff
684			usr.sbin/config (adding -DMAKE_BOOTSTRAP to
685			  CFLAGS and rebuilding should work)
686			usr.sbin/mdsetimage - Build a static copy if
687			  building a snapshot before fully bootstrapped.
688
68920010204:
690	prepare the code to compile with stricter gcc flags. in
691	particular start eliminating redundant declarations. Yacc
692	needs to be installed before make build.
693
69420010114:
695	introduce .if commands(target) in make(1). You need to
696	bring everything up-to-date first, then without installing
697	anything make and install in usr.bin/make, then proceed
698	with make build.
699
70020010101:
701	bsd.subdir.mk committed 20001230 had a bug which caused
702	afterinstall targets to run too soon; update again.
703
70420001230:
705	New share/mk files needed to support .WAIT in SUBDIR variables.
706	If you get make errors, 
707		(cd share/mk; make install)
708	Also, PRINTOBJDIR has changed and is now used more heavily.
709
71020001019:
711	The `ca' device driver has been replaced by `ld'; although the
712	major and minor numbers haven't changed, you should update your /dev
713	directory.
714
71520000929:
716	The following make directives are obsoleted.
717	MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA 
718	By default, RSA is built into libcrypto.  IDEA and RC5 will not be
719	built into libcrypto.  By using MKCRYPTO_{RC5,IDEA}, you can build
720	additional library libcrypto_{idea,rc5}.
721
722
723Hints for a more successful build:
724^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
725    Use build.sh, but do not use its "expert mode":
726	This will automatically build the tools in the
727	   correct order, and it will keep the tools and the
728	   new build products from interfering with the running
729	   system.  This will allow you to ignore most of the
730	   other advice in this file.
731    Build a new kernel first:
732	This makes sure that any new system calls or features
733	   expected by the new userland will be present.  This
734	   helps to avoid critical errors when upgrading.
735    Use object directories:
736	This helps to keep stale object
737	   files from polluting the build if a Makefile "forgets"
738	   about one.  It also makes it easier to clean up after
739	   a build.  It's also necessary if you want to use the
740	   same source tree for multiple machines.
741	   To use object directories with build.sh:
742	    a) invoke build.sh with the "-M" or "-O" options.
743	   To use object directories without using build.sh:
744	    a) cd /usr/src ; make cleandir
745	    b) Add "OBJMACHINE=yes" to /etc/mk.conf
746	    c) Add "MKOBJDIRS=yes" to /etc/mk.conf
747	    d) cd /usr/src ; make build
748	   Note that running "make obj" in a directory will create
749	   in obj.$MACHINE directory.
750    Build to a DESTDIR:
751	This helps to keep old installed files (especially libraries)
752	   from interfering with the new build.
753	   To build to a DESTDIR with build.sh, use the "-D" option.
754	   To build to a DESTDIR without using build.sh, set the DESTDIR
755	   environment variable before running make build.  It should be
756	   set to the pathname of an initially empty directory.
757	   Problems: if you do not use build.sh, you might need to
758		update critical utilities without using DESTDIR since
759		nothing is executed from what is installed in DESTDIR.
760		(See critical utils, below.)
761    Build often:
762	This keeps critical utilities current enough to not choke
763	on any other part of the source tree that depends on up to
764	date functionality.  If you use build.sh, you should not have
765	this problem.
766 
767What to do if things don't work:
768^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
769When things don't work there is usually a few things that commonly
770should be done.
771    1)	make includes
772	This should be done automatically by make build.
773    2)  cd share/mk && make install
774	Again, automatically done by make build.
775
776Failsafe rebuild of a small part of the tree:
777^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
778To make sure you rebuild something correctly you want to do
779something like the following:
780    1)  Make sure the includes and .mk files are up to date.
781    2)  Make sure any program used to build the particular
782	utility is up to date.  (yacc, lex, etc...)
783    3)  cd ...path/to/util...
784	make cleandir
785	rm ...all obj directories...
786	make cleandir			# yes, again
787	make obj
788	make depend && make
789
790Failsafe rebuild of the entire tree:
791^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
792If you really want to make sure the source tree is clean and
793ready for a build try the following.  Note that sourcing /etc/mk.conf
794(a make(1) Makefile) in this manner is not right, and will not work
795for anyone who uses any make(1) features in /etc/mk.conf.
796
797---cut here---
798#!/bin/sh
799. /etc/mk.conf
800
801if [ -z $NETBSDSRCDIR ] ; then
802    NETBSDSRCDIR=/usr/src
803fi
804if [ \! -d $NETBSDSRCDIR ] ; then
805    echo Unable to find sources
806    exit 1
807fi
808find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
809
810if [ -z $BSDOBJDIR ] ; then
811    BSDOBJDIR=/usr/obj
812fi
813if [ -d $BSDOBJDIR ] ; then
814    rm -rf $BSDOBJDIR
815fi
816
817cd $NETBSDSRCDIR && make cleandir
818
819---cut here---
820
821Critical utilities:
822^^^^^^^^^^^^^^^^^^^
823	usr.bin/compile_et
824	usr.bin/make
825	usr.bin/yacc
826	usr.bin/lex
827	usr.bin/xlint
828	usr.bin/config
829
830Other problems and possible solutions:
831^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
832Symptom:Complaints involving a Makefile.
833Fix:	Rebuild usr.bin/make:
834	cd usr.bin/make && make && make install
835	Or, a failsafe method if that doesn't work:
836	cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
837
838Fix:	Make sure .mk files are up to date.
839	cd share/mk && make install
840
841Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
842Fix:	Rebuild usr.bin/config
843
844Symptom:
845Fix:	Rebuild usr.bin/yacc
846
847Symptom:
848Fix:	Rebuild usr.bin/lex
849
850Symptom:
851Fix:	rm /usr/lib/libbfd.a
852
853Symptom:Obsolete intermediate files are used during compilation
854Fix:	Try the following sequence of commands in the directory in question.
855	make cleandir; rm `make print-objdir`; make cleandir; make obj
856	(If you built the tree without "make obj" in the past, obsolete files
857	may remain.  The command tries to clean everything up)
858
859Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
860Fix:	Rebuild and install usr.bin/menuc
861
862Symptom:mklocale not found during build in share/locale/ctype
863Fix:	Build and install usr.bin/mklocale
864
865Symptom:undefined reference to `__assert13' or `__unsetenv13'
866Fix:    Rebuild and install lib/libc
867
868Symptom:usr.bin/config fails to build.
869Fix:	Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
870
871Symptom:undefined reference to `getprogname' or `setprogname'
872Fix:    Rebuild and install lib/libc
873
874Symptom:lint does not understand the '-X' option
875Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint
876