Gentoo Archives: gentoo-server

From: Kerin Millar <kerin@×××××××××××××××.net>
To: gentoo-server@××××××××××××.org
Subject: Re: [gentoo-server] linux-headers: insanity? WAS: linux-headers update?
Date: Thu, 31 Mar 2005 15:02:49
Message-Id: 424C1121.9000201@recruit2recruit.net
In Reply to: Re: [gentoo-server] linux-headers: insanity? WAS: linux-headers update? by Wes Kurdziolek
1 Wes Kurdziolek wrote:
2 > Linus meant that the kernel headers shouldn't be a moving target --
3 > changing the kernel headers w/o accounting for all the packages that
4 > rely on them is dangerous. It has the potential to break glibc which
5 > virtually everything in a Linux system depends on.
6
7 Sorry but that's not simply not correct. Changing the headers does
8 absolutely *nothing* unless you (re)build a package that includes a
9 portion of those headers. After all, they are simply headers - it's not
10 a library. The issue arises if you build said package against headers
11 which are *newer* than the kernel you are running.
12
13 There is absolutely no requirement to rebuild anything if you upgrade
14 your headers. The breakage of glibc can occur as follows (just to
15 provide an example):
16
17 1) You have system-wide linux-headers-2.6.8 and you run kernel-2.6.8.
18 All affected packages have been built against those headers.
19 2) You update linux-headers-2.6.8 to linux-headers-2.6.9.
20 3) You _opt_ to rebuild, say, glibc (and yes, it is entirely optional).
21 4) glibc now makes use of kernel API functions which are in advance of
22 the kernel you are still running - b0rkage. In this case, you'd either
23 have to rebuild glibc against <=linux-headers-2.6.8 or upgrade to
24 >=kernel.2.6.9.
25
26 The message that the linux-headers ebuild displays is simply a
27 recommendation i.e. "you might like to rebuild glibc now to leverage the
28 kernel in so far as possible". It's not mandatory.
29
30 > I'd also like to mention that Gentoo is not alone in providing a kernel
31 > headers package -- I know Debian and Red Hat do, as well. However, they
32 > have life easier than Gentoo due to its source-based nature. In binary
33 > distributions, they have to rebuild their binary packages when they
34 > update the kernel headers, so those get updated as well.
35
36 No, they don't have to. The last time I checked, the standard headers
37 package in Debian was comparatively ancient - based on a 2.5 snapshot if
38 I recall (it's reasonable to assume that these are the headers they use
39 when generating their packages). It might not be optimal, but the point
40 is this: it doesn't matter from the point of view of functional
41 integrity. They make available newer headers packages but there is
42 absolutely no requirement for them to rebuild their packages against
43 newer headers as long as the standard kernel they ship is not older than
44 the headers (which is invariably the case).
45
46 Lots of people are running 2.6 kernels on systems that were built with
47 2.4 headers. I've also heard of people running 2.4 kernels on distros
48 built with 2.2 headers and it wouldn't surprise me if you could even run
49 a 2.6 kernel on a system built with 2.2 headers.
50
51 Perhaps some packages may be released that mandate certain headers (for
52 example, if they wanted to use the CryptoAPI functions which are only
53 available in 2.6 in vanilla terms). In those cases, I'd imagine that
54 they would use the "bad" method of traversing /usr/src/linux rather than
55 using the system-wide headers, just as 3rd party kernel modules do. I'm
56 not aware of any such packages though.
57
58 What Linus was complaining about was distros that don't use independent
59 system-wide headers at all and, instead, use the hack of symlinking
60 /usr/include/linux and /usr/include/asm to their counterparts in a
61 kernel source tree. That's a terrible thing to do, it means that any
62 package you build that uses kernel headers will be affected according to
63 your "kernel du jour" which greatly increases the likelihood of
64 breakage. This is why Gentoo uses independent headers which are
65 generally *not* a moving target, as does just about any decent distro
66 these days. But with Gentoo you still have to ensure that you do not
67 upgrade your headers in advance of your kernel version *and* rebuild
68 packages against them. This usually isn't an issue; the headers tend to
69 be several steps behind any kernel available in portage. The only reason
70 it's an issue now is because Gentoo have now pushed 2.6 as part of the
71 "default" 2005.0 profile.
72
73 Finally, can 2.4 users please not mess around with package.masks and the
74 like except where it is strictly necessary. The correct way to do this
75 is to link to the 2005.0/2.4 profile as I have mentioned already:
76
77 # cd /etc
78 # rm make.profile
79 # ln -s ../usr/portage/profiles/default-linux/x86/2005.0/2.4 make.profile
80
81 Regards,
82
83 --Kerin Francis Millar
84 --
85 gentoo-server@g.o mailing list

Replies

Subject Author
Re: [gentoo-server] linux-headers: insanity? WAS: linux-headers update? Wes Kurdziolek <xunil@×××××××××.com>