Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Since when does module-rebuild delete modules for previous kernel version?
Date: Thu, 08 Jul 2021 00:36:18
Message-Id: 2b8a3908-01a8-5a00-3ed7-d73cb1630052@gmail.com
In Reply to: [gentoo-user] Re: Since when does module-rebuild delete modules for previous kernel version? by Nikos Chantziaras
1 Nikos Chantziaras wrote:
2 > On 08/07/2021 02:18, Neil Bothwick wrote:
3 >> On Thu, 8 Jul 2021 02:09:17 +0300, Nikos Chantziaras wrote:
4 >>
5 >>> So far, so good. But when I ran "emerge @module-rebuild", which
6 >>> rebuilds these two packages:
7 >>>
8 >>>     app-emulation/vmware-modules
9 >>>     x11-drivers/nvidia-drivers
10 >>>
11 >>> The vmwware and nvidia kernel modules got deleted from
12 >>> /lib/modules/5.10.47-gentoo.
13 >>>
14 >>> This is bad. When did this change? How can I prevent this from
15 >>> happening?
16 >>
17 >> Hasn't this always been the case. emerging a package removes files
18 >> installed by the previous merge.
19 >>
20 >> I think adding /lib/modules to CONFIG_PROTECT will prevent their
21 >> deletion.
22 >
23 > I just tried that after "eselect kernel set 1" and rebuilding modules,
24 > and it doesn't help.
25 >
26 > I am quite sure the modules were not uninstalled in my old system. It
27 > could be that I had to set some option somewhere, but I don't remember
28 > :-/
29 >
30 >
31 >
32
33
34 I don't recall it doing that way either.  I've had a kernel go bad
35 before and had to reboot a old kernel.  If it deleted the files in the
36 old modules directory, then my GUI wouldn't come up because the video
37 drivers would no longer be there.  I think I'd remember that.  :/
38
39 Just for giggles, I did a ls for my current installed kernel versions
40 modules directory.  This is what it shows.
41
42
43 root@fireball / # ls -al /lib/modules/4.19.40-gentoo/
44 total 80
45 drwxr-xr-x  4 root root  4096 May  3  2020 .
46 drwxr-xr-x 14 root root  4096 Jul  1 01:39 ..
47 lrwxrwxrwx  1 root root    29 May 15  2019 build ->
48 /usr/src/linux-4.19.40-gentoo
49 drwxr-xr-x  3 root root  4096 Apr 23  2020 kernel
50 -rw-r--r--  1 root root   334 May  3  2020 modules.alias
51 -rw-r--r--  1 root root   530 May  3  2020 modules.alias.bin
52 -rw-r--r--  1 root root 12021 Apr 23  2020 modules.builtin
53 -rw-r--r--  1 root root 15879 May  3  2020 modules.builtin.bin
54 -rw-r--r--  1 root root   156 May  3  2020 modules.dep
55 -rw-r--r--  1 root root   321 May  3  2020 modules.dep.bin
56 -rw-r--r--  1 root root     0 May  3  2020 modules.devname
57 -rw-r--r--  1 root root    36 Apr 23  2020 modules.order
58 -rw-r--r--  1 root root    55 May  3  2020 modules.softdep
59 -rw-r--r--  1 root root  3838 May  3  2020 modules.symbols
60 -rw-r--r--  1 root root  4271 May  3  2020 modules.symbols.bin
61 lrwxrwxrwx  1 root root    29 Apr 23  2020 source ->
62 /usr/src/linux-4.19.40-gentoo
63 drwxr-xr-x  2 root root  4096 Feb 15 01:23 video
64
65 root@fireball / # ls -al /lib/modules/5.6.7-gentoo/
66 total 184
67 drwxr-xr-x  4 root root   4096 Apr 20 01:47 .
68 drwxr-xr-x 14 root root   4096 Jul  1 01:39 ..
69 lrwxrwxrwx  1 root root     27 May  2  2020 build ->
70 /usr/src/linux-5.6.7-gentoo
71 drwxr-xr-x  3 root root   4096 May  9  2020 kernel
72 -rw-r--r--  1 root root    334 Apr 20 01:47 modules.alias
73 -rw-r--r--  1 root root    530 Apr 20 01:47 modules.alias.bin
74 -rw-r--r--  1 root root  12558 May  9  2020 modules.builtin
75 -rw-r--r--  1 root root      0 Apr 20 01:47 modules.builtin.alias.bin
76 -rw-r--r--  1 root root  16054 Apr 20 01:47 modules.builtin.bin
77 -rw-r--r--  1 root root 101792 May  9  2020 modules.builtin.modinfo
78 -rw-r--r--  1 root root    193 Apr 20 01:47 modules.dep
79 -rw-r--r--  1 root root    401 Apr 20 01:47 modules.dep.bin
80 -rw-r--r--  1 root root      0 Apr 20 01:47 modules.devname
81 -rw-r--r--  1 root root     36 May  9  2020 modules.order
82 -rw-r--r--  1 root root     55 Apr 20 01:47 modules.softdep
83 -rw-r--r--  1 root root   3768 Apr 20 01:47 modules.symbols
84 -rw-r--r--  1 root root   4321 Apr 20 01:47 modules.symbols.bin
85 lrwxrwxrwx  1 root root     27 May  9  2020 source ->
86 /usr/src/linux-5.6.7-gentoo
87 drwxr-xr-x  2 root root   4096 Apr 20 01:47 video
88
89 root@fireball / # ls -al /lib/modules/5.10.46-gentoo/
90 total 184
91 drwxr-xr-x  3 root root   4096 Jul  1 01:39 .
92 drwxr-xr-x 14 root root   4096 Jul  1 01:39 ..
93 lrwxrwxrwx  1 root root     29 Jul  1 01:39 build ->
94 /usr/src/linux-5.10.46-gentoo
95 drwxr-xr-x  3 root root   4096 Jul  1 01:39 kernel
96 -rw-r--r--  1 root root    108 Jul  1 01:39 modules.alias
97 -rw-r--r--  1 root root    335 Jul  1 01:39 modules.alias.bin
98 -rw-r--r--  1 root root  12739 Jul  1 01:39 modules.builtin
99 -rw-r--r--  1 root root      0 Jul  1 01:39 modules.builtin.alias.bin
100 -rw-r--r--  1 root root  16480 Jul  1 01:39 modules.builtin.bin
101 -rw-r--r--  1 root root 103263 Jul  1 01:39 modules.builtin.modinfo
102 -rw-r--r--  1 root root     37 Jul  1 01:39 modules.dep
103 -rw-r--r--  1 root root     74 Jul  1 01:39 modules.dep.bin
104 -rw-r--r--  1 root root      0 Jul  1 01:39 modules.devname
105 -rw-r--r--  1 root root     36 Jul  1 01:39 modules.order
106 -rw-r--r--  1 root root     55 Jul  1 01:39 modules.softdep
107 -rw-r--r--  1 root root     49 Jul  1 01:39 modules.symbols
108 -rw-r--r--  1 root root     12 Jul  1 01:39 modules.symbols.bin
109 lrwxrwxrwx  1 root root     29 Jul  1 01:39 source ->
110 /usr/src/linux-5.10.46-gentoo
111 root@fireball / #
112
113
114 I currently have three available kernels, one I did recently and have
115 yet to reboot and use.  I also haven't changed the pointer and
116 re-emerged any modules yet.  Still, as one can see, there is a video
117 directory for video which contains my nvidia drivers for each kernel
118 version like this:
119
120
121 root@fireball / # ls -al /lib/modules/4.19.40-gentoo/video/
122 total 28020
123 drwxr-xr-x 2 root root     4096 Feb 15 01:23 .
124 drwxr-xr-x 4 root root     4096 May  3  2020 ..
125 -rw-r--r-- 1 root root    80504 May  3  2020 nvidia-drm.ko
126 -rw-r--r-- 1 root root 27162104 May  3  2020 nvidia.ko
127 -rw-r--r-- 1 root root  1437216 May  3  2020 nvidia-modeset.ko
128 root@fireball / # ls -al /lib/modules/5.6.7-gentoo/video/
129 total 43536
130 drwxr-xr-x 2 root root     4096 Apr 20 01:47 .
131 drwxr-xr-x 4 root root     4096 Apr 20 01:47 ..
132 -rw-r--r-- 1 root root    92224 Apr 19 22:38 nvidia-drm.ko
133 -rw-r--r-- 1 root root 40951920 Apr 19 22:38 nvidia.ko
134 -rw-r--r-- 1 root root  1566736 Apr 19 22:38 nvidia-modeset.ko
135 -rw-r--r-- 1 root root  1950824 Apr 19 22:38 nvidia-uvm.ko
136 root@fireball / #
137
138
139 So, at least when I updated that 5.6.7 kernel ages ago, it didn't delete
140 anything old.  It should install to the new location as if it is a new
141 install, since it is a new kernel, it sort of is a new install since it
142 has never been installed for THAT kernel before. 
143
144 Has this changed?  Is it a setting somewhere that is a new default? 
145 Can't imagine what that is tho.  I know I don't like the change if it
146 has because I tend to keep multiple kernels installed as fall backs.  If
147 I have to fall back on a older kernel, I expect everything to work like
148 it did the last time I used that kernel as far as drivers go, including
149 and especially video drivers. 
150
151 So, let me test this theory a bit.  I used eselect to point to new
152 kernel.  I emerged the nvidia drivers again and here is the listing now,
153 old kernels and the one I've yet to use but just re-emerged the drivers
154 for. 
155
156
157 root@fireball / # ls -al /lib/modules/4.19.40-gentoo/video/
158 total 28020
159 drwxr-xr-x 2 root root     4096 Feb 15 01:23 .
160 drwxr-xr-x 4 root root     4096 May  3  2020 ..
161 -rw-r--r-- 1 root root    80504 May  3  2020 nvidia-drm.ko
162 -rw-r--r-- 1 root root 27162104 May  3  2020 nvidia.ko
163 -rw-r--r-- 1 root root  1437216 May  3  2020 nvidia-modeset.ko
164
165 root@fireball / # ls -al /lib/modules/5.6.7-gentoo/video/
166 total 43536
167 drwxr-xr-x 2 root root     4096 Apr 20 01:47 .
168 drwxr-xr-x 4 root root     4096 Apr 20 01:47 ..
169 -rw-r--r-- 1 root root    92224 Apr 19 22:38 nvidia-drm.ko
170 -rw-r--r-- 1 root root 40951920 Apr 19 22:38 nvidia.ko
171 -rw-r--r-- 1 root root  1566736 Apr 19 22:38 nvidia-modeset.ko
172 -rw-r--r-- 1 root root  1950824 Apr 19 22:38 nvidia-uvm.ko
173
174 root@fireball / # ls -al /lib/modules/5.10.46-gentoo/video/
175 total 43532
176 drwxr-xr-x 2 root root     4096 Jul  7 19:24 .
177 drwxr-xr-x 4 root root     4096 Jul  7 19:24 ..
178 -rw-r--r-- 1 root root    93000 Jul  7 19:22 nvidia-drm.ko
179 -rw-r--r-- 1 root root 40953232 Jul  7 19:22 nvidia.ko
180 -rw-r--r-- 1 root root  1566784 Jul  7 19:22 nvidia-modeset.ko
181 -rw-r--r-- 1 root root  1947848 Jul  7 19:22 nvidia-uvm.ko
182 root@fireball / #
183
184
185 So, old version of modules are still there as they should be and new
186 modules installed for the new kernel version.  This is the build info:
187
188
189 [ebuild   R    ] x11-drivers/nvidia-drivers-460.67:0/460::gentoo  USE="X
190 driver tools -dist-kernel -static-libs"
191
192
193 It seems to work as it used to here.  Maybe a USE flag above will change
194 that?? I dunno.
195
196 Dale
197
198 :-)  :-)