Page 1 of 2

[SOLVED] Installing correct kernel source

Posted: 12. Aug 2017, 18:15
by pnbalaji
Hi,

I have been running Salix 14.2 on my laptop for several years and this week I installed Salix on my desktop also.

My WiFi adapter in my desktop is buggy and I need to build a patch in order to get it work correctly. I installed dkms without any issues.

However, I am not able to install the correct kernel source. See the results below.

Code: Select all

jumper@darkstar ~ $ uname -a
Linux darkstar 4.4.19 #2 SMP Mon Aug 22 14:37:39 CDT 2016 x86_64 Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz GenuineIntel GNU/Linux
jumper@darkstar ~ $ 

jumper@darkstar ~ $ sudo slapt-get -i kernel-source
Reading Package Lists...Done
The following NEW packages will be installed:
  kernel-source 
0 upgraded, 0 reinstalled, 1 newly installed, 0 to remove, 0 not upgraded.
Need to get 86.8MB of archives.
After unpacking 625.2MB of additional disk space will be used.
1/1 Get http://mirrors.xmission.com/salix/x86_64/slackware-14.2/ kernel-source 4.4.75-noarch-1 [86.8MB]...^C0%

As you can see from the above, the installed kernel is 4.4.19 whereas when I try to install the kernel-source, it is trying to pull the source for 4.4.75 instead of 4.4.19.

Can someone help on how to install the kernel-source for 4.4.19? Why is it trying to pull the source for 4.4.75 though the installed kernel is 4.4.19?

Thanks,
Balaji.

Re: Installing correct kernel source

Posted: 12. Aug 2017, 19:43
by ChuangTzu
you need to upgrade your kernel first:

Code: Select all

sudo slapt-get -i kernel-huge kernel-firmware kernel-modules
do not upgrade the kernel headers unless changing to a different kernel series

then

Code: Select all

sudo lilo -v
then reboot and install

Code: Select all

sudo slapt-get -i kernel-source
Ref: https://docs.salixos.org/wiki/How_to_in ... ent_kernel

Re: Installing correct kernel source

Posted: 13. Aug 2017, 00:02
by pnbalaji
It did not work. See the result below when I tried to upgrade the kernel.

Code: Select all

jumper@darkstar ~ $ sudo slapt-get -i kernel-huge kernel-firmware kernel-modules
Password: 
Reading Package Lists...Done
kernel-huge is up to date.
kernel-firmware is up to date.
kernel-modules is up to date.
0 upgraded, 0 reinstalled, 0 newly installed, 0 to remove, 0 not upgraded.

Done

jumper@darkstar ~ $ ll /var/log/packages/kernel*
-rw-r--r-- 1 root root  55990 Aug 12 18:51 /var/log/packages/kernel-firmware-20170626git-noarch-1
-rw-r--r-- 1 root root  25087 Aug 12 18:51 /var/log/packages/kernel-headers-4.4.75-x86-1
-rw-r--r-- 1 root root    969 Aug 12 18:51 /var/log/packages/kernel-huge-4.4.75-x86_64-1
-rw-r--r-- 1 root root 248542 Aug 12 18:51 /var/log/packages/kernel-modules-4.4.75-x86_64-1
It appears that I have the 4.4.75 kernel, but "uname -r" is showing only 4.4.19.

One more thing, I did not install lilo. I installed grub2 as the boot manager.

Thanks,
Balaji.

Re: Installing correct kernel source

Posted: 13. Aug 2017, 01:34
by ChuangTzu
try

Code: Select all

sudo update-grub
or the manual way:
https://www.linuxquestions.org/question ... le-501738/

then reboot

if grub is not updated then you will still run the old kernel.....

Re: Installing correct kernel source

Posted: 13. Aug 2017, 02:09
by pnbalaji
I actually followed my own topic viewtopic.php?f=30&t=7089 to install grub2 and I ran update-grub as part of the grub install process.

Thanks,
Balaji.

Re: [SOLVED] Installing correct kernel source

Posted: 13. Aug 2017, 02:32
by pnbalaji
Actually re-running the "sudo update-grub" helped. I am able to build the patch for my rtl8192cu chipset based wifi adapter and now my WiFi is working fine.

Thanks for your help.

Thanks,
Balaji.

Re: [SOLVED] Installing correct kernel source

Posted: 13. Aug 2017, 21:46
by ChuangTzu
Glad it helped. :)

Re: Installing correct kernel source

Posted: 31. Aug 2017, 14:44
by mimosa
ChuangTzu wrote:do not upgrade the kernel headers unless changing to a different kernel series
This is a point that continues to puzzle me. Different people give different advice. Can you explain the rationale for this?

Presumably, changing to a different series will have knock-on effects elsewhere and is therefore best avoided under normal circumstances.

Re: [SOLVED] Installing correct kernel source

Posted: 31. Aug 2017, 21:16
by ChuangTzu
Hi Mimosa,

Short answer, its how I've always done it and old habits and all....
https://docs.salixos.org/wiki/How_to_in ... ent_kernel (scroll down to Note:....)

Longer answer, I think it has to do with compiling/recompiling glibc....
https://www.linuxquestions.org/question ... rs-596517/
https://www.linuxquestions.org/question ... ost2872221

Re: [SOLVED] Installing correct kernel source

Posted: 31. Aug 2017, 22:09
by DidierSpaier
Here is my take on this.

First, for "official" upgrades, i.e. at the initiative of the distribution maintainers:
  • As long as the kernel is upgraded among the same series the kernel headers can, and are, "upgraded". This has been done lately in Slackware stable (aka 114.2): 4.4.38 => 4.4.74 => 4.4.75, and all of these occasions kernel headers were upgraded accordingly, with no issue reported. Similarly, there have been a lot of "incremental" kernel upgrades in Slackware-current (4.9.n => 4.9.n+1) with associated upgrades of kernel headers as shown in this ChangeLog.
  • But if the kernel series changes, e.g. 4.4.38 => 4.9.26 on Thu May 4 22:14:08 UTC 2017 as shown in the same ChangeLog, the GNU libc has to be upgraded to match the one used to compile the new kernel.
Then what to do in case of an upgrade at the initiative of the user?
This is explained in this article from Eric Hameleers (see under the title "Slackware kernel-headers package".
In this article Eric more or less implicitly assumes that the kernel upgrade and is a "major" upgrade, as that's what is needed e.g. to get a new kernel driver that supports a recent hardware.
Thus his note:
As long as you do not upgrade your glibc package, you should not upgrade or remove the kernel-headers package.
actually stands only for major kernel upgrades, not in in the same series.
I think that the same applies to Gapan's note in this article mostly from Mimosa:
NOTE: The kernel-headers package should not be upgraded if you're staying within the same Salix release. Only upgrade it if at the same time you are upgrading your entire system to a newer release.