From owner-freebsd-hackers Wed Aug 28 00:27:12 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA08698 for hackers-outgoing; Wed, 28 Aug 1996 00:27:12 -0700 (PDT) Received: from mail0.iij.ad.jp (root@mail0.iij.ad.jp [192.244.176.61]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id AAA08693 for ; Wed, 28 Aug 1996 00:27:09 -0700 (PDT) Received: from uucp1.iij.ad.jp (uucp1.iij.ad.jp [192.244.176.73]) by mail0.iij.ad.jp (8.6.12+2.4W/3.3W9-MAIL) with ESMTP id QAA16169 for ; Wed, 28 Aug 1996 16:27:04 +0900 Received: (from uucp@localhost) by uucp1.iij.ad.jp (8.6.12+2.4W/3.3W9-UUCP) with UUCP id QAA09611 for freebsd-hackers@freebsd.org; Wed, 28 Aug 1996 16:27:04 +0900 Received: from xxx.fct.kgc.co.jp by yyy.kgc.co.jp (8.7.5/3.4W4:96080715) id QAA19708; Wed, 28 Aug 1996 16:25:28 +0900 (JST) Received: from localhost by xxx.fct.kgc.co.jp (8.7.5/3.3W8:95062916) id QAA01642; Wed, 28 Aug 1996 16:25:25 +0900 (JST) Message-Id: <199608280725.QAA01642@xxx.fct.kgc.co.jp> To: freebsd-hackers@freebsd.org Subject: Suggestion: let config(8) support symbolic linked /usr/src/sys/compile X-Mailer: Mew version 1.06 on Emacs 19.28.2, Mule 2.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Date: Wed, 28 Aug 1996 16:25:23 +0900 From: Toshihiro Kanda Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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<-----