Subject: building 1.3 under 1.2
To: None <current-users@NetBSD.ORG>
From: Michael Richardson <mcr@sandelman.ottawa.on.ca>
List: current-users
Date: 11/21/1997 15:15:09
-----BEGIN PGP SIGNED MESSAGE-----


  I successfully built a 1.3 GENERIC kernel (for /i386) on a 1.2
system yesterday. There some gotchas, and there also some steps that
I didn't get right. The 1.2 ifconfig may lock your 1.3 kernel.
  These are the steps that I did. I didn't need to chroot to do
this, and I didn't need to be root, and I could do this over NFS
without root-NFS priveledges. I will send-pr the patch to make (bin/4553)
I will also send-pr my "mortalinstall" (bin/4554), which just skips all
operations in /usr/bin/install that require root.

1.	edit netbsd13.csh, (included below) set $NETBSD13, source
	it. You'll want to "rehash" etc. after the installs. 

2.	sup the distribution/extract src into $BSDSRCDIR. set $ARCH to
	`uname -m` 
3.	cd mortalinstall; make obj; (unsetenv DESTDIR; make
	CFLAGS+=-Dlint); make INSTALL=obj.$ARCH/mortalinstall BINDIR=/usr/bin
	install 
3.	cd $BSDSRCDIR/etc; make distrib-dirs
4.	cd $BSDSRCDIR/usr/share/mk; make install
5.	(cd $BSDSRCDIR/usr.bin/make; patch <$DESTDIR/make.patch }
6.	(cd $BSDSRCDIR/usr.bin/make; set foo=$DESTDIR; unsetenv
	DESTDIR; make -m $foo/usr/share/mk
	CFLAGS+='-D_PATH_SYSPATH=\"'$foo/usr/share/mk'\" -Dlint' clean obj
	all) 
7.      (cd $BSDSRCDIR; make includes)
8.	(cd $DESTDIR/usr; mv include include2; mkdir include; cd
	include; ln -s /usr/include/* .; rm sys; mkdir sys; cd sys; ln -s
	/usr/include/sys/* .; rm cdefs.h; cp $DESTDIR/usr/include2/sys/cdefs.h
	.; vi cdefs.h ) 
	# remove lines 150 to 158
7.	(cd $BSDSRCDIR/usr.bin/make; make install)
9.	(cd $DESTDIR/usr/include; cp /usr/include/sys/stat.h sys/stat.h)
10.	(cd $BSDSRCDIR/usr.bin/yacc; make obj; make all && make install)
11.	(cd $BSDSRCDIR/usr.sbin/config; make obj; make all && make install)
12.	(cd $BSDSRCDIR/gnu/usr.bin/gcc; make obj; make all && make install)
	# this is done because of the elink*.c problems. if you don't
	# have any 3com cards, maybe this can be skipped
	# you'll want to either install the cc1 in /usr/libexec, or
	# edit $BSDSRCDIR/gnu/usr.bin/gcc/cc/Makefile to read:
	#         -DMD_EXEC_PREFIX=\"$(DESTDIR)/usr/libexec/\" 
	# 
13.	rehash.
14.	cd $BSDSRCDIR/sys/arch/$ARCH/conf
15.	config GENERIC
16.	cd ../compile/GENERIC; make depend && make     
17.	install new kernel, reboot, *carefully* (I had problems with
	ifconfig in netstart hanging the system).
18.	cd $DESTDIR/usr; rm -r include
19.	cd $BSDSRCDIR/usr.bin/rpcgen; (unsetenv DESTDIR; make
	CFLAGS+=-Dlint); make install
	# so that librpcsrv will compile.
19.	cd $BSDSRCDIR; make build
21.	when satisfied with stuff in $DESTDIR, I make installed on the
	system without $DESTDIR set.
21.	I had to do:


netbsd13.csh:
# file of variables to set for non-root NetBSD1.3 build

# somewhere with disk space.
setenv NETBSD13  /m/taulu/1/netbsd13

setenv BSDOBJDIR $NETBSD13/usr/obj
setenv BSDSRCDIR $NETBSD13/usr/src
setenv DESTDIR   $NETBSD13
setenv BINOWN    $USER
setenv INSTALL   $NETBSD13/usr/bin/mortalinstall

# set to some group I'm in.
set mygroup=staff
setenv BINGRP   $mygroup
setenv MANGRP 	$mygroup
setenv MANOWN	$USER
setenv DOCGRP 	$mygroup
setenv DOCOWN	$USER
setenv NLSGRP	$mygroup
setenv NLSOWN	$mygroup
setenv LIBOWN	$USER
setenv LIBGRP 	$mygroup

setenv OBJMACHINE 1

set path=($NETBSD13/sbin $NETBSD13/usr/sbin $NETBSD13/bin $NETBSD13/usr/bin $path)





make.patch:
*** pathnames.h1	Thu Nov 20 12:48:32 1997
- --- pathnames.h	Thu Nov 20 12:48:41 1997
***************
*** 40,42 ****
- --- 40,46 ----
  #define	_PATH_DEFSHELLDIR	"/bin"
  #define	_PATH_DEFSYSMK		"sys.mk"
  #define	_PATH_DEFSYSPATH	"/usr/share/mk"
+ 
+ #ifndef _PATH_SYSPATH
+ #define _PATH_SYSPATH _PATH_DEFSYSPATH
+ #endif
*** main.c1	Thu Nov 20 13:07:03 1997
- --- main.c	Thu Nov 20 13:07:20 1997
***************
*** 451,457 ****
  	Lst sysMkPath;			/* Path of sys.mk */
  	char *cp = NULL, *start;
  					/* avoid faults on read-only strings */
! 	static char syspath[] = _PATH_DEFSYSPATH;
  
  #ifdef RLIMIT_NOFILE
  	/*
- --- 451,457 ----
  	Lst sysMkPath;			/* Path of sys.mk */
  	char *cp = NULL, *start;
  					/* avoid faults on read-only strings */
! 	static char syspath[] = _PATH_SYSPATH;
  
  #ifdef RLIMIT_NOFILE
  	/*


-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQB1AwUBNHWI/cmxxiPyUBAxAQFNSAMAqG51jJ1EXKcgYwEQSUhjToTrVRVUxw4Z
3p9gMcDoyL4x6hEzp0DUCIdWjZl1WtVrC6LZtOz109iyZC8rNjbp4xuboRc985dN
t01XoT6WE6mPUio5NUvAv/TqLVPVFOnP
=6zyc
-----END PGP SIGNATURE-----