1 |
[Also posted to gentoo-user and forum] |
2 |
|
3 |
In order to scratch an itch that I've been having with either a new |
4 |
kernel install or a recompilation of a kernel with a new config and |
5 |
forgetting packages that installed kernel modules, I've created |
6 |
kernelmod-rebuild to assist in the process of rebuilding packages. |
7 |
|
8 |
This script is based on revdep-rebuild (i.e. I started with it and |
9 |
changed it to do what I want) but instead of looking for broken library |
10 |
dependencies, it looks for packages that have installed kernel modules. |
11 |
|
12 |
What this script does is locate the packages that have installed modules |
13 |
into /lib/modules, determines which ebuilds to rebuild based on that |
14 |
list and rebuilds them. |
15 |
|
16 |
What this script doesn't do is locate the packages such as vmware that |
17 |
installed modules outside of the emerge process (since portage is |
18 |
unaware of those modules). Unfortunately, you will still have to |
19 |
remember to rerun the configuration process for those packages. |
20 |
|
21 |
Here is the usage statement from the script |
22 |
|
23 |
garath root # kernelmod-rebuild --help |
24 |
Usage: /usr/bin/kernelmod-rebuild [OPTIONS] [--] [EMERGE_OPTIONS] |
25 |
|
26 |
Rebuild packages that have installed kernel modules |
27 |
|
28 |
-X, --package-names recompile based on package names, not exact versions |
29 |
-q, --quiet be less verbose |
30 |
|
31 |
Calls emerge, all other options are used for it (e. g. -p, --pretend). |
32 |
Here is a sample run of the script on my system: |
33 |
|
34 |
garath root # kernelmod-rebuild --package-names --quiet --pretend --verbose |
35 |
|
36 |
Finding packages which install kernel modules... |
37 |
Packages will be recompiled. |
38 |
|
39 |
Collecting list of packages to rebuild... done. |
40 |
|
41 |
Cleaning list of packages to rebuild... done. |
42 |
|
43 |
Evaluating package order... done. |
44 |
|
45 |
All prepared. Starting rebuild... |
46 |
|
47 |
These are the packages that I would merge, in order: |
48 |
|
49 |
Calculating dependencies ...done! |
50 |
[ebuild R ] media-sound/alsa-driver-0.9.8 -oss |
51 |
[ebuild R ] media-video/nvidia-kernel-1.0.4496-r3 |
52 |
|
53 |
Now you can remove -p (or --pretend) from arguments and re-run kernelmod-rebuild. |
54 |
This script is useful for when you decide to try out the latest |
55 |
test-kernel, but can't remember all of the packages that you've |
56 |
installed that build modules. It is also useful when you make changes |
57 |
to your kernel config and recompiled that kernel (as that can |
58 |
occasionally break modules depending upon what you changed). |
59 |
|
60 |
The ebuild for this script is located at |
61 |
http://varnerfamily.org/pvarner/gentoo/kernelmod-rebuild-0.1.ebuild.tar.gz |
62 |
|
63 |
To install the ebuild, download the tar file and extract it to your |
64 |
portage overlay directory. For example, I have set the variable |
65 |
PORTDIR_OVERLAY in my make.conf file to /usr/local/portage. Here is how |
66 |
I installed the package on my machine: |
67 |
|
68 |
garath root # cd /usr/local/portage |
69 |
garath portage # wget http://varnerfamily.org/pvarner/gentoo/kernelmod-rebuild-0.1.ebuild.tar.gz |
70 |
garath portage # tar xvzf kernelmod-rebuild-0.1.ebuild.tar.gz |
71 |
garath portage # rm kernelmod-rebuild-0.1.ebuild.tar.gz |
72 |
garath portage # emerge -pv kernelmod-rebuild |
73 |
garath portage # emerge -v kernelmod-rebuild |
74 |
|
75 |
If you are on a different architecture than x86, you either need to edit |
76 |
the ebuild or set ACCEPT_KEYWORDS="~arch" as I have marked those |
77 |
architectures unstable/testing since I don't have machines to test on. |
78 |
It should work properly, but I couldn't test it :) |
79 |
|
80 |
If you want to report a bug, either reply to this thread or send me an |
81 |
email to the address listed in the man page. |
82 |
|
83 |
Finally, I have submitted the ebuild to bugzilla (bug# 34921) |
84 |
<http://bugs.gentoo.org/show_bug.cgi?id=34921> with the request that |
85 |
the script be included in the gentoolkit package. Hopefully, it will be |
86 |
accepted as part of the toolkit, but even if it isn't, I hope that some |
87 |
of you can find it useful. |
88 |
|
89 |
Regards, |
90 |
Paul |
91 |
|
92 |
-- |
93 |
gentoo-dev@g.o mailing list |