Will make modules_install replace old kernel modules?
I built kernel in this sequence make make modules sudo make modules_install sudo make install I am not sure if I boot from the old kernel,will the old kernel load the new-installed modules or keep it's own modules?
On Thu, 28 May 2015 11:26:02 +0800, Gao Peng said:
I am not sure if I boot from the old kernel,will the old kernel load the new-installed modules or keep it's own modules.
If you did it properly, then you should have 2 kernels, each with a distinct value for uname -r, and 2 directories under /lib/modules, one for each kernel. Each kernel then proceeds to load modules from /lib/modules/`uname -r`. So if you have a 3.19.0 kernel, and a 4.0.1 kernel, they'll both be sitting in /boot (each with its own initramfs, probably), and the 3.19.0 will load from /lib/modules/3.19.0 and the 4.0.1 will load from /lib/modules/4.0.1 And, of course, you hopefully have grub/grub2/whatever configured to allow you to select a kernel by having multiple definition stanzas, one per kernel... Extreme example (I keep a *lot* of kernels around because I keep breaking them): [~] ls /boot/vmlinuz-[34]* /boot/vmlinuz-3.17.0-0.rc6.git2.1.fc22.x86_64 /boot/vmlinuz-4.0.0-rc3-next-20150310-dirty /boot/vmlinuz-3.18.0-0.rc3.git0.1.fc22.x86_64 /boot/vmlinuz-4.0.0-rc5-next-20150324 /boot/vmlinuz-3.19.0-0.rc3.git2.1.fc22.x86_64 /boot/vmlinuz-4.0.0-rc6-next-20150331 /boot/vmlinuz-4.0.0-next-20150421 /boot/vmlinuz-4.1.0-rc1-next-20150428 /boot/vmlinuz-4.0.0-rc1-next-20150224 /boot/vmlinuz-4.1.0-rc2-next-20150506 /boot/vmlinuz-4.0.0-rc1-next-20150226-dirty /boot/vmlinuz-4.1.0-rc4-next-20150521 /boot/vmlinuz-4.0.0-rc1-next-20150303-dirty /boot/vmlinuz-4.1.0-rc5-next-20150526 /boot/vmlinuz-4.0.0-rc2-next-20150306-dirty [~] ls /boot/initramfs-[34]* /boot/initramfs-3.17.0-0.rc6.git2.1.fc22.x86_64.img /boot/initramfs-4.0.0-rc3-next-20150310-dirty.img /boot/initramfs-3.18.0-0.rc3.git0.1.fc22.x86_64.img /boot/initramfs-4.0.0-rc5-next-20150324.img /boot/initramfs-3.19.0-0.rc3.git2.1.fc22.x86_64.img /boot/initramfs-4.0.0-rc6-next-20150331.img /boot/initramfs-4.0.0-next-20150421.img /boot/initramfs-4.1.0-rc1-next-20150428.img /boot/initramfs-4.0.0-rc1-next-20150224.img /boot/initramfs-4.1.0-rc2-next-20150506.img /boot/initramfs-4.0.0-rc1-next-20150226-dirty.img /boot/initramfs-4.1.0-rc4-next-20150521.img /boot/initramfs-4.0.0-rc1-next-20150303-dirty.img /boot/initramfs-4.1.0-rc5-next-20150526.img /boot/initramfs-4.0.0-rc2-next-20150306-dirty.img [~] ls /lib/modules 3.17.0-0.rc6.git2.1.fc22.x86_64 4.0.0-rc1-next-20150224 4.0.0-rc3-next-20150310-dirty 4.1.0-rc2-next-20150506 3.18.0-0.rc3.git0.1.fc22.x86_64 4.0.0-rc1-next-20150226-dirty 4.0.0-rc5-next-20150324 4.1.0-rc4-next-20150521 3.19.0-0.rc3.git2.1.fc22.x86_64 4.0.0-rc1-next-20150303-dirty 4.0.0-rc6-next-20150331 4.1.0-rc5-next-20150526 4.0.0-next-20150421 4.0.0-rc2-next-20150306-dirty 4.1.0-rc1-next-20150428 Hope that helps it make sense...
Got it! thx! On Thu, May 28, 2015 at 11:43 AM, <Valdis.Kletnieks@vt.edu> wrote:
On Thu, 28 May 2015 11:26:02 +0800, Gao Peng said:
I am not sure if I boot from the old kernel,will the old kernel load the new-installed modules or keep it's own modules.
If you did it properly, then you should have 2 kernels, each with a distinct value for uname -r, and 2 directories under /lib/modules, one for each kernel. Each kernel then proceeds to load modules from /lib/modules/`uname -r`.
So if you have a 3.19.0 kernel, and a 4.0.1 kernel, they'll both be sitting in /boot (each with its own initramfs, probably), and the 3.19.0 will load from /lib/modules/3.19.0 and the 4.0.1 will load from /lib/modules/4.0.1
And, of course, you hopefully have grub/grub2/whatever configured to allow you to select a kernel by having multiple definition stanzas, one per kernel...
Extreme example (I keep a *lot* of kernels around because I keep breaking them):
[~] ls /boot/vmlinuz-[34]* /boot/vmlinuz-3.17.0-0.rc6.git2.1.fc22.x86_64 /boot/vmlinuz-4.0.0-rc3-next-20150310-dirty /boot/vmlinuz-3.18.0-0.rc3.git0.1.fc22.x86_64 /boot/vmlinuz-4.0.0-rc5-next-20150324 /boot/vmlinuz-3.19.0-0.rc3.git2.1.fc22.x86_64 /boot/vmlinuz-4.0.0-rc6-next-20150331 /boot/vmlinuz-4.0.0-next-20150421 /boot/vmlinuz-4.1.0-rc1-next-20150428 /boot/vmlinuz-4.0.0-rc1-next-20150224 /boot/vmlinuz-4.1.0-rc2-next-20150506 /boot/vmlinuz-4.0.0-rc1-next-20150226-dirty /boot/vmlinuz-4.1.0-rc4-next-20150521 /boot/vmlinuz-4.0.0-rc1-next-20150303-dirty /boot/vmlinuz-4.1.0-rc5-next-20150526 /boot/vmlinuz-4.0.0-rc2-next-20150306-dirty [~] ls /boot/initramfs-[34]* /boot/initramfs-3.17.0-0.rc6.git2.1.fc22.x86_64.img /boot/initramfs-4.0.0-rc3-next-20150310-dirty.img /boot/initramfs-3.18.0-0.rc3.git0.1.fc22.x86_64.img /boot/initramfs-4.0.0-rc5-next-20150324.img /boot/initramfs-3.19.0-0.rc3.git2.1.fc22.x86_64.img /boot/initramfs-4.0.0-rc6-next-20150331.img /boot/initramfs-4.0.0-next-20150421.img /boot/initramfs-4.1.0-rc1-next-20150428.img /boot/initramfs-4.0.0-rc1-next-20150224.img /boot/initramfs-4.1.0-rc2-next-20150506.img /boot/initramfs-4.0.0-rc1-next-20150226-dirty.img /boot/initramfs-4.1.0-rc4-next-20150521.img /boot/initramfs-4.0.0-rc1-next-20150303-dirty.img /boot/initramfs-4.1.0-rc5-next-20150526.img /boot/initramfs-4.0.0-rc2-next-20150306-dirty.img [~] ls /lib/modules 3.17.0-0.rc6.git2.1.fc22.x86_64 4.0.0-rc1-next-20150224 4.0.0-rc3-next-20150310-dirty 4.1.0-rc2-next-20150506 3.18.0-0.rc3.git0.1.fc22.x86_64 4.0.0-rc1-next-20150226-dirty 4.0.0-rc5-next-20150324 4.1.0-rc4-next-20150521 3.19.0-0.rc3.git2.1.fc22.x86_64 4.0.0-rc1-next-20150303-dirty 4.0.0-rc6-next-20150331 4.1.0-rc5-next-20150526 4.0.0-next-20150421 4.0.0-rc2-next-20150306-dirty 4.1.0-rc1-next-20150428
Hope that helps it make sense...
participants (2)
-
Gao Peng -
Valdis.Kletnieks@vt.edu