Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 1995 13:13:54 PDT
From:      Bill Fenner <fenner@parc.xerox.com>
To:        current@freebsd.org
Subject:   kernel versions and config's rm -rf
Message-ID:  <95Sep24.131401pdt.177475@crevenia.parc.xerox.com>

next in thread | raw e-mail | index | archive | help
I usually like to be able to tell kernel builds apart by their version
numbers... like "oh, PARC_MROUTER #1 has the mbuf leak, you want to run
PARC_MROUTER #2".  I built a -stable kernel to test multicast routing in
-stable, but forgot to put MROUTING in it.  So I built another one, and
then was really confused because they were both FENESTRO #0, so build date
was my only hint as to which one I was currently running.

Instead of "rm -rf", maybe config could just do "make clean; rm *.h Makefile",
to keep the "version" file around?

Also, do we really want the kernel version number to start at 0?  Under SunOS,
my only other kernel building experience, version numbers start at 1, so to
see all these version 0 kernels all the time kinda makes me think that
something went wrong, and then I have to say "oh, yeah, FreeBSD's kernel
version numbers start at 0".

(This is because SunOS pre-increments the version number, while FreeBSD
doesn't.  This makes sense if you want to manually set the version number,
but it does mean that without changing newvers.sh, kernels start at 0).

Attached is a patch for newvers.sh and for usr.sbin/config/main.c for
someone's perusal.

  Bill


--- newvers.sh.orig	Sun Sep 24 12:48:32 1995
+++ newvers.sh	Sun Sep 24 12:48:55 1995
@@ -48,7 +48,7 @@
 
 if [ ! -r version ]
 then
-	echo 0 > version
+	echo 1 > version
 fi
 
 touch version


--- usr.sbin/config/main.c.orig	Sun Sep 24 12:53:43 1995
+++ usr.sbin/config/main.c	Sun Sep 24 13:07:55 1995
@@ -117,21 +117,18 @@
 		exit(2);
 	}
 	else if (!no_config_clobber) {
-		char tmp[strlen(p) + 8];
+		char tmp[strlen(p) + 59];
 
-		fprintf(stderr, "Removing old directory %s:  ", p);
+		fprintf(stderr, "Cleaning old directory %s:  ", p);
 		fflush(stderr);
-		sprintf(tmp, "rm -rf %s", p);
+		sprintf(tmp, "cd %s; make clean > /dev/null ; "
+				"rm Makefile machine *.c *.h", p);
 		if (system(tmp)) {
 			fprintf(stderr, "Failed!\n");
 			perror(tmp);
 			exit(2);
 		}
 		fprintf(stderr, "Done.\n");
-		if (mkdir(p, 0777)) {
-			perror(p);
-			exit(2);
-		}
 	}
 	loadaddress = -1;
 	dtab = NULL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?95Sep24.131401pdt.177475>