Gentoo Archives: gentoo-dev

From: Kumba <kumba@g.o>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Patches and the 2.4->2.6 move
Date: Mon, 20 Oct 2003 04:32:44
Message-Id: 3F9365A5.5000509@gentoo.org
In Reply to: [gentoo-dev] Patches and the 2.4->2.6 move by Donnie Berkholz
1 Donnie Berkholz wrote:
2
3 > I'd like some input on this:
4 >
5 > I have a patch that fixes SSE problems on 2.4 kernels. However, on 2.6
6 > kernels it breaks OpenGL (applications segfault).
7 >
8 > Currently I'm applying this patch if /usr/src/linux is linked to a 2.4
9 > kernel at compile-time.
10 >
11 > This means that if a user emerges xfree when linked to a 2.4 kernel,
12 > that user will need to remerge xfree after moving to 2.6 kernels. This
13 > takes about 40 minutes on a ~2GHz x86. However, if this patch is not
14 > applied, the bug will continue to exist for all Gentoo users on 2.4
15 > kernels.
16 >
17 > My request to you is:
18 > 1) Is this acceptable?
19 > 2) If not, what is a better solution? Dropping the patch entirely? Note
20 > that I don't know Mesa/programming well enough to write a patch
21 > compatible for both 2.4 and 2.6 kernels.
22 >
23 > Thanks,
24 > Donnie
25
26
27 Here's an idea. Bit demented, though.
28
29 First, why check /usr/src/linux? IMHO, that link may or may not always
30 be there or be correct. I recommend instead using the get_KV and
31 KV_to_int functions defined in /sbin/functions.sh to determine what the
32 machine is currently running.
33
34 The second part is where to apply the patch, and how. This is the
35 difficult part. I'd first say to apply it from the kernel.eclass file,
36 but this likely goes against some odd policy somewheres, which means
37 most modern 2.4 ebuilds would need updating to use this patch. Alot of
38 work is involved in tweaking all the 2.4 sources ebuilds.
39
40 The third part is How to know when to apply the patch? In pseudo-codish
41 form, here is what I can come up with.
42
43 if KV_to_int(get_KV) <= KV_to_int(2.4.99) then
44 if (use x86) && (use xfree) then
45 epatch <patch>
46 echo "${BAD}*${NORMAL} "
47 echo "${BAD}*${NORMAL} BIG FAT WARNING: You are running Xfree on an
48 x86 system and are running a 2.4 kernel.
49 echo "${BAD}*${NORMAL} Because of this, a patch has been applied to
50 the kernel to fix some SSE/3DNOW problems."
51 echo "${BAD}*${NORMAL} This patch requires you to rebuild Xfree in
52 order to take advantage of the patch's"
53 echo "${BAD}*${NORMAL} benefits. Please note that this patch is only
54 for 2.4 kernels. If you move to a 2.6"
55 echo "${BAD}*${NORMAL} kernel, you WILL need to re-merge Xfree,
56 otherwise OpenGL-based applications"
57 echo "${BAD}*${NORMAL} will fail in X."
58 echo "${BAD}*${NORMAL} "
59 fi
60 fi
61
62
63 That should go into pkg_postinst, and probably include a sleep delay
64 timer + bell dinging like on portage and baselayout ebuilds to get the
65 attention of users.
66
67 All speculation, of course, but it's a slow night and I'm in brainstorm
68 mode.
69
70
71 --Kumba
72
73 --
74 "Such is oft the course of deeds that move the wheels of the world:
75 small hands do them because they must, while the eyes of the great are
76 elsewhere." --Elrond
77
78
79 --
80 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Patches and the 2.4->2.6 move Donnie Berkholz <spyderous@g.o>