[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Kernel flavors (Re: boot-time kernel selection)



On  1 Aug 1997, Bill Mitchell wrote:
> 
> Neither of these, however, seem to address an expressed need from
> kernel hackers to have several alternative flavors of a single kernel
> version around.
> 
> Perhaps the proper way to address this need would be for the kernel
> hackers to modify the SUBLEVEL definition in /usr/src/kernel/linux/Makefile
> to read e.g., "SUBLEVEL = 30-speed_hack" (or some such) before building
> the kernel.  That should get the kernel installed as
> /boot/vmlinuz-2.0.30-speed_hack, and get `uname -r` to say
> "2.0.30-speed_hack", and should allow differentiation between alternative
> 2.0.30 kernels.  (I haven't tried this because I'm currently unable
> to build kernels, but it looks to me like that's the way it would work).

Close, but SUBLEVEL needs to stay numeric, so it's just a tad
 more involved.

I was twiddling with GGI a while back, and wanted this very thing...
now I don't have the kernel sources (or the room), but if I remember
correctly, this is what I did to linux/Makefile.  It adds the FLAVOR
to the end of UTS_RELEASE, which uname then reads properly.  However,
I remember having to look through the rest of the kernel source--I'm
not sure whether I found anywhere that UTS_RELEASE was parsed, but
it's probably worth checking again.

Anyway, try this and see...


--- linux/Makefile.orig	Fri Aug  1 10:25:45 1997
+++ linux/Makefile	Fri Aug  1 10:24:54 1997
@@ -2,6 +2,18 @@
 PATCHLEVEL = 1
 SUBLEVEL = 44
 
+# If you want to have more than one kernel configuration per
+# kernel version, set FLAVOR -- it will be appended to
+# UTS_RELEASE in version.h (separated by a hyphen)
+#
+FLAVOR = GGI
+
+ifneq ($(strip $(FLAVOR)),)
+FLAVOR := -$(FLAVOR)
+else
+FLAVOR := 
+endif
+
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
 
 #
@@ -240,7 +252,7 @@
 	@mv -f .ver $@
 
 include/linux/version.h: ./Makefile
-	@echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > 
.ver
+	@echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(FLA
VOR)\" > .ver
 	@echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + 
$(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver
 	@mv -f .ver $@
 
@@ -285,7 +297,7 @@
 
 modules_install:
 	@( \
-	MODLIB=/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \
+	MODLIB=/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(FLAVOR); \
 	cd modules; \
 	MODULES=""; \
 	inst_mod() { These="`cat $$1`"; MODULES="$$MODULES $$These"; \




--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: