Gentoo Archives: gentoo-dev

From: Georgi Georgiev <chutz@×××.net>
To: gentoo-dev@l.g.o
Cc: gentoo-dev@l.g.o, brix@××××.org, x86-kernel@g.o
Subject: Re: [gentoo-dev] [LAST CHANCE]: kernel + kernel module ebuild changes
Date: Wed, 17 Mar 2004 23:47:55
Message-Id: 20040317234730.GA5712@lion.gg3.net
In Reply to: [gentoo-dev] [LAST CHANCE]: kernel + kernel module ebuild changes by Peter Johanson
1 maillog: 16/03/2004-10:00:45(-0500): Peter Johanson types
2 > 3) config-kernel - A new tool for manipulating a few things relating to
3 > your kernel environment. It is purely meant to affect the way your
4 > kernels live on your system, and NOT for generating kernels, etc.
5 > Features include:
6 > - setting a prefix for kernel output (e.g. a new kernel
7 > 2.6.4-mm1 will have it's output set to
8 > /var/tmp/kernel-output/2.6.4-mm1). Users can choose a new prefix, or
9 > disable using koutput using config-kernel.
10
11 How exactly is this going to be implemented? Is the tool going to write to a
12 config file or create a symlink /usr/src/linux-output for example? Don't forget
13 that the user would have to still be able to easily compile a kernel on their
14 own using the methods they are used to, i.e. make config, make menuconfig, make
15 all, etc. I've been using a similar system on some of my machines (some where I
16 don't have nvidia cards), and I implemented it the following way:
17
18 $ ls -F /usr/src/linux-build
19 2.6.3-x1/
20 2.6.4-x1/
21 CVS/
22 _makefile
23
24 $ readlink /usr/src/linux-build/2.6.4-x1/makefile
25 ../_makefile
26
27 $ cat /usr/src/linux-build/_makefile # I am dropping some irrelevant lines
28 ifeq (,$(VERSION))
29 -include Makefile
30 ifeq (,$(VERSION))
31 version_item = $(shell perl -e '@a=("$(1)"=~m,(\d+)\.(\d+)\.(\d+)([-_].+)?(-[^-/]+?)$$,);print $$a[$(2)]')
32 dummy := $(shell echo VERSION = $(call version_item,$(shell basename $(CURDIR)),0) > Makefile)
33 dummy := $(shell echo PATCHLEVEL = $(call version_item,$(shell basename $(CURDIR)),1) >>Makefile)
34 dummy := $(shell echo SUBLEVEL = $(call version_item,$(shell basename $(CURDIR)),2) >>Makefile)
35 dummy := $(shell echo EXTRAVERSION= $(call version_item,$(shell basename $(CURDIR)),3)$(call version_item,$(shell basename $(CURDIR)),4) >>Makefile)
36 include Makefile
37 endif
38
39 SRCVER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(X_RCVERSION)
40 SRCTREE = $(SRC_PREFIX)/usr/src/linux-$(SRCVER)
41 FLAGS += -C $(SRCTREE) O=$(O) VERSION=$(VERSION) PATCHLEVEL=$(PATCHLEVEL) SUBLEVEL=$(SUBLEVEL) EXTRAVERSION=$(EXTRAVERSION)
42
43 # this I need for some module-building
44 ifdef SUBDIRS
45 FLAGS += SUBDIRS=$(SUBDIRS)
46 endif
47
48 kernel_targets=menuconfig config oldconfig gconfig xconfig all modules bzImage modules_install
49
50 $(kernel_targets):
51 $(MAKE) $(FLAGS) $@
52
53 flags:
54 @echo $(FLAGS)
55
56 source-location:
57 @echo $(SRCTREE)
58
59 build-location:
60 @echo $(O)
61
62 # the ugliest target follows
63 install:
64 sh $(SRCTREE)/arch/$(myARCH)/boot/install.sh $(FULLVER) $(FULLVER)/arch/$(myARCH)/boot/bzImage $(FULLVER)/System.map ""
65
66 endif
67
68 # vim:ft=make:
69
70 $ make -C /usr/src/linux-build/2.6.4-x1/ flags
71 make: Entering directory `/usr/src/linux-build/2.6.4-x1'
72 -C /usr/src/linux-2.6.4 O=/usr/src/linux-build/2.6.4-x1 VERSION=2 PATCHLEVEL=6 SUBLEVEL=4 EXTRAVERSION=-x1
73 make: Leaving directory `/usr/src/linux-build/2.6.4-x1'
74
75 Comments?
76
77 --
78 /\ Georgi Georgiev /\ BOFH Excuse #328: Fiber optics caused gas /\
79 \/ chutz@×××.net \/ main leak \/
80 /\ +81(90)6266-1163 /\ /\

Replies

Subject Author
Re: [gentoo-dev] [LAST CHANCE]: kernel + kernel module ebuild changes Peter Johanson <latexer@g.o>