Gentoo Archives: gentoo-dev

From: Ciaran McCreesh <ciaranm@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Ebuilds referencing /usr/src/linux makes baby Jesus kill kittens
Date: Fri, 23 Jul 2004 22:25:24
Message-Id: 20040723232250.6a3dbe33@snowdrop.home
1 Just a friendly reminder that you should really avoid messing around
2 with /usr/src/linux inside ebuilds. In particular, code like the
3 following is utterly wrong:
5 if [ ! -e "/usr/src/linux/include/linux/dm-ioctl.h" ] ; then
6 eerror
7 eerror "Your currently linked kernel (/usr/src/linux) hasn't"
8 eerror "been patched for device mapper support."
9 eerror
10 die "kernel not patched for device mapper support"
11 fi
13 Don't try to do clever things with /usr/src/linux to determine whether a
14 kernel has a particular feature. Especially don't go near .config. The
15 kernel running may not be the kernel in /usr/src/linux. The box in
16 question might be a chroot setup or a netboot system or a system built
17 with a crosscompiler, in which case /usr/src/linux* won't exist at all.
18 The user might be sharing kernel binaries between dozens of identical
19 boxes and only building on one. The user might be building kernels
20 in/home to avoid having to build kernels as root or chown a bunch of
21 stuff. The /usr/src/linux symlink might be out of date. The box might be
22 building binary packages for a different system.
24 You shouldn't be using /usr/src/linux for headers either. I suggest
25 people give the following a good read before they commit even more
26 broken code to the tree:
30 Think of the kittens, people!
32 --
33 Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox)
34 Mail : ciaranm at
35 Web :