1 |
On Thu, Mar 18, 2004 at 09:37:52AM +0900, Georgi Georgiev wrote: |
2 |
> maillog: 17/03/2004-18:55:05(-0500): Peter Johanson types |
3 |
> > On Thu, Mar 18, 2004 at 08:47:30AM +0900, Georgi Georgiev wrote: |
4 |
> > > maillog: 16/03/2004-10:00:45(-0500): Peter Johanson types |
5 |
> > > > 3) config-kernel - A new tool for manipulating a few things relating to |
6 |
> > > > your kernel environment. It is purely meant to affect the way your |
7 |
> > > > kernels live on your system, and NOT for generating kernels, etc. |
8 |
> > > > Features include: |
9 |
> > > > - setting a prefix for kernel output (e.g. a new kernel |
10 |
> > > > 2.6.4-mm1 will have it's output set to |
11 |
> > > > /var/tmp/kernel-output/2.6.4-mm1). Users can choose a new prefix, or |
12 |
> > > > disable using koutput using config-kernel. |
13 |
> > > |
14 |
> > > How exactly is this going to be implemented? Is the tool going to write to a |
15 |
> > > config file or create a symlink /usr/src/linux-output for example? Don't forget |
16 |
> > |
17 |
> > All variables that affect things are going into /etc/env.d/05kernel |
18 |
> > |
19 |
> > |
20 |
> > > that the user would have to still be able to easily compile a kernel on their |
21 |
> > > own using the methods they are used to, i.e. make config, make menuconfig, make |
22 |
> > |
23 |
> > They *will*. Things will be mostly transparent to the user. When a new |
24 |
> > kernel is installed, or if a user does "config-kernel --make-koutput |
25 |
> > /usr/src/linux-2.6.4" the toplevel makefile is edited to add the line |
26 |
> > KBUILD_OUTPUT=/var/tmp/kernel-output/$KV |
27 |
> |
28 |
> So, this one variable does not go into /etc/env.d/05kernel? In fact, if the |
29 |
> variable is set in the environment, there is no need to set it in the makefile |
30 |
> as well, right? The environment would override it anyway. |
31 |
|
32 |
No, a variable KBUILD_OUTPUT_PREFIX is set, which kernel-2.eclass will |
33 |
use to determine what gets added to the makefile at installation time. |
34 |
The reason for this is we don't want KBUILD_OUTPUT set globally, as this |
35 |
would screw up having 2.6.3 and 2.6.4 both compile (they'd put things in |
36 |
the same spot, etc, etc). This is why we have to set it for each kernel. |
37 |
|
38 |
> |
39 |
> > By adding this variable, when someone does: |
40 |
> > # make menuconfig |
41 |
> > in that source tree, all the output files end up wherever KBUILD_OUTPUT |
42 |
> > points to. that's all it takes. You can run all the normal make commands |
43 |
> > as normal, but things end up elsewhere. No nasty hacking. The below |
44 |
> > stuff is unnessecary. |
45 |
> > |
46 |
> > When users want to override the output, *then* they can specify things |
47 |
> > on the command line. A normal user wanting to build a kernel for some |
48 |
> > Alpha box they have can do the following: |
49 |
> > $ mkdir ~/kernel-output/2.6.4-alpha |
50 |
> > $ cd /usr/src/linux-2.6.4 |
51 |
> > $ make ARCH=alpha O=~/kernel-output/2.6.4-alpha menuconfig |
52 |
> > $ make ARCH=alpha O=~/kernel-output/2.6.4-alpha |
53 |
> > |
54 |
> > And they've then built a kernel for an alpha (assuming they have the |
55 |
> > toolchain in their PATH, etc, etc) against the sources they had no write |
56 |
> > access to. |
57 |
> > |
58 |
> > This make sense? |
59 |
> |
60 |
> Sure does. |
61 |
> |
62 |
> The reason for the nasty hacking is because I wanted to be able to easily |
63 |
> rebuild different versions (EXTRAVERSION-s) of a kernel using the same source. |
64 |
> Setting KBUILD_OUTPUT only sounds as if someone could easily screw up. I mean, |
65 |
> the user would have to run config-kernel *and* edit the version in the Makefile |
66 |
> in the original source every time. I think this step could easily be moved to |
67 |
> config-kernel. |
68 |
> |
69 |
> For example, config-kernel could derive the version from the output directory |
70 |
> name (if we agree to a naming convention), and edit the versions in the |
71 |
> Makefile every time. Or it could require more parameters on the command line? |
72 |
> Or it could support optional parameters, and only when they are provided, it |
73 |
> could edit the Makefile. It would also have to create a file in the output |
74 |
> directory, so the next time, when a user switches back to a previously used |
75 |
> KBUILD_OUTPUT directory, the old version is restored automatically. In fact, |
76 |
> config-kernel could directly create the first five lines in |
77 |
> $KBUILD_OUTPUT/Makefile if the file is not already there, and simply restore |
78 |
> the lines if the file is available. |
79 |
> |
80 |
> I used too many words, but my point was that kernel version and output |
81 |
> directory have to be consistent between switches. |
82 |
> |
83 |
|
84 |
Yeah, It hadn't occured to me to try to incorporate more than one |
85 |
EXTRAVERSION compile with this system. Doing things like this would get |
86 |
really complicated/messy, but this might be mitigated by making: |
87 |
KBUILD_OUTPUT= $KBUILD_OUTPUT_PREFIX/$MAJOR.$MINOR.$PATCHLEVEL$EXTRAVERSION |
88 |
So that this happens automagically. whenever you change EXTRAVERSION in |
89 |
the toplevel makefile. Only problem with that is the destination |
90 |
directory isn't guaranteed to exist if you do this. config-kernel could |
91 |
be extended to add a --set-extraversion foo which could handle all those |
92 |
particulars though. WOuld this be sufficient? |
93 |
|
94 |
-pete |
95 |
|
96 |
> -- |
97 |
> () Georgi Georgiev () Break into jail and claim police brutality. () |
98 |
> () chutz@×××.net () () |
99 |
> () +81(90)6266-1163 () () |
100 |
|
101 |
|
102 |
|
103 |
-- |
104 |
Peter Johanson |
105 |
<latexer@g.o> |
106 |
|
107 |
Key ID = 0x6EFA3917 |
108 |
Key fingerprint = A90A 2518 57B1 9D20 9B71 A2FF 8649 439B 6EFA 3917 |