Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 1996 16:25:23 +0900
From:      Toshihiro Kanda <candy@fct.kgc.co.jp>
To:        freebsd-hackers@freebsd.org
Subject:   Suggestion: let config(8) support symbolic linked /usr/src/sys/compile
Message-ID:  <199608280725.QAA01642@xxx.fct.kgc.co.jp>

next in thread | raw e-mail | index | archive | help
  Hello.  The document SMM:1 describes how to separate
/usr/src/sys/compile directory from /usr/src. (see
/usr/share/doc/smm/01.setup/paper.ascii.gz "6.6. Recompiling and
reinstalling system software".)  I modified config(8) to support this
facility.

  In FreeBSD, steps to separate are:

  1. Make `obj' directories.  (At the first time only)
    1.1 # mkdir /usr/obj/sys
    1.2 # mv /usr/src/sys/compile /usr/obj/sys
    1.3 # mkdir /usr/obj/sys/libkern
    1.4 # ln -s /usr/obj/sys/libkern /usr/src/sys/libkern/obj
(1.3 and 1.4 are done by `make obj' in /usr/src)

  2. Build a kernel.
    2.1 # cd /usr/src/sys/i386/conf
    2.2 # config KERNEL
    2.3 # cd ../../compile
    2.4 # rm machine; ln -s /usr/src/sys @; ln -s /usr/src/sys/i386 machine
    2.5 # make all install

My modification is very simple.  In the step 2.2, `config -l KERNEL'
will do step 2.4 automatically.  How about this idea?

  Thank you.

candy@fct.kgc.co.jp (Toshihiro Kanda)

-----8<----------8<----------8<----------8<----------8<-----
# patch for /usr/src/usr.sbin/config/
# (FreeBSD 2.1.5R)
*** config.h.orig	Wed Aug 28 15:08:23 1996
--- config.h	Wed Aug 28 15:08:32 1996
***************
*** 215,220 ****
--- 215,221 ----
  int	dst;
  int	profiling;
  int	debugging;
+ int	shadow_directory;
  
  int	maxusers;
  u_int	loadaddress;
*** main.c.orig	Wed Jul 10 13:15:23 1996
--- main.c	Wed Aug 28 15:25:36 1996
***************
*** 75,81 ****
  	int ch;
  	char *p;
  
! 	while ((ch = getopt(argc, argv, "gpn")) != EOF)
  		switch (ch) {
  		case 'g':
  			debugging++;
--- 75,81 ----
  	int ch;
  	char *p;
  
! 	while ((ch = getopt(argc, argv, "gpln")) != EOF)
  		switch (ch) {
  		case 'g':
  			debugging++;
***************
*** 83,88 ****
--- 83,91 ----
  		case 'p':
  			profiling++;
  			break;
+ 		case 'l':
+ 			shadow_directory++;
+ 			break;
  		case 'n':
  			no_config_clobber = TRUE;
  			break;
***************
*** 185,192 ****
--- 188,211 ----
  	{
  	char xxx[80];
  
+ 	if (shadow_directory) {
+ #define SYSDIR "/usr/src/sys"
+ 		(void) strcpy(xxx, SYSDIR);
+ 		if (symlink(xxx, path("@"))) {
+ 			perror(path("@"));
+ 			exit(2);
+ 		}
+ 		(void) sprintf(xxx, "@/%s/include", machinename);
+ 		if (symlink(xxx, path("machine"))) {
+ 			perror(path("machine"));
+ 			exit(2);
+ 		}
+ #undef SYSDIR
+ 	}
+ 	else {
  	(void) sprintf(xxx, "../../%s/include", machinename);
  	(void) symlink(xxx, path("machine"));
+ 	}
  	}
  	makefile();			/* build Makefile */
  	headers();			/* make a lot of .h files */
-----8<----------8<----------8<----------8<----------8<-----




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608280725.QAA01642>