LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-25-2015, 04:45 PM   #1
GreenFireFly
Member
 
Registered: Jul 2013
Posts: 217

Rep: Reputation: Disabled
Talking How to update the kernel?


Hello Everyone,

Is there package for a new linux kernel i can install and kernel headers package? Is this all that is need to update the kernel? Any else the need to be done after?

BTW: I'm on Slackware 14.1 64bit Multilib.

Last edited by GreenFireFly; 07-26-2015 at 11:13 AM.
 
Old 07-25-2015, 04:52 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,825

Rep: Reputation: Disabled
Hello,

1) No package for a new kernel. Generally you'll have to build it yourself.
2) You don't have to change the kernel headers when you install a new kernel.
3) You will have to build and install the modules associated with the kernel.
4) Which new kernel do you want to install and why?
5) Read http://docs.slackware.com/howtos:sla...kernelbuilding first.

PS URL fixed, thanks lems.

Last edited by Didier Spaier; 07-26-2015 at 06:37 AM. Reason: OS added.
 
Old 07-25-2015, 08:48 PM   #3
1337_powerslacker
Member
 
Registered: Nov 2009
Distribution: Slackware64-current,Ubuntu,openSuSE,Manjaro
Posts: 829
Blog Entries: 9

Rep: Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554
Quote:
Originally Posted by GreenFireFly View Post
Hello Everyone,

Is there package for a new linux kernel i can install and kernel headers package? Is this all that is need to update the kernel? Any else the need to be done after?

BTW: I'm on Slackware 14.1 64bit Multilib.
Definitely follow Didier's advice; it is quite sound. I would add the proviso, however, that building the kernel, once you get the hang of it, will become second nature. Unlike some other distros, Slackware makes it easy to build from source directly from kernel.org. I myself am running the latest, 4.1.3, and it is quite stable. Just make sure you follow the directions in the tutorial specified by Didier. Having said that, have fun!

Regards,

Matt
 
Old 07-26-2015, 06:31 AM   #4
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
Didier's link corrected (a `g' was missing):
http://docs.slackware.com/howtos:sla...kernelbuilding

This document helped me, here are some notes I made based on the document above as well as LQ postings when I started to build my kernel:

Get a kernel tarball*. Then:
Code:
tar -C /usr/src -jxvf linux-kernel.tar.xz
cd /usr/src
rm linux
ln -s linux-new-kernel linux
(You can build your kernel as user as well, so you could unpack it in $HOME.)

* There is a script getkernel that I wrote which is able to get the latest kernel of your kernel minor version, or the latest stable one.

Then either copy the config from /boot or use:
zcat /proc/config.gz > /usr/src/linux/.config

Patrick releases configs for newer kernels as well, see the testing/ directory.

Then:
Code:
cd /usr/src/linux
make oldconfig
make menuconfig
Some options to consider:
Code:
General Setup -> Local version
General Setup -> Kernel .config support
General Setup -> Automatic process group scheduling
Processor type and features -> Timer Frequency -> 1000 Hz
Processor type and features -> Processor Family -> Your model
Processor type and features -> Preemption model -> Preemptible kernel
# I turned this off since I had problems when using the nvidia binary blob with it.
Kernel hacking -> Kernel debugging
After exiting and saving your changes, run this command to build the kernel:

Code:
make bzImage modules
Consider adding a -jX to the above make command to speed it up, where X is the number of your cores plus one.
You can either run `nproc', or `grep cores /proc/cpuinfo' to get the correct number.

Installing it (change the names/flavors [`generic', `smp'] according to your needs):
Code:
make modules_install
cp arch/x86_64/boot/bzImage /boot/vmlinuz-generic-version-LOCALVERSION
cp System.map /boot/System.map-generic-version-LOCALVERSION
cp .config /boot/config-generic-version-LOCALVERSION
cd /boot
rm System.map
ln -s System.map-generic-version-LOCALVERSION System.map
If using an initrd, you could run the following command:
Code:
 /usr/share/mkinitrd/mkinitrd_command_generator.sh /boot/new-vmlinuz-image
Run the command it displays, and if using lilo, add this to your kernel/image section:
Code:
initrd = /boot/initrd.gz
Don't forget to run
Code:
lilo -v
Another, maybe cleaner way would be to use/write a SlackBuild to do this, so you can remove or upgrade the kernel as a package using Slackware's pkgtools. But I haven't looked into it yet.

Last edited by lems; 07-26-2015 at 06:34 AM.
 
1 members found this post helpful.
Old 07-26-2015, 07:12 AM   #5
oldtechaa
Member
 
Registered: May 2015
Location: US
Distribution: Fedora
Posts: 364

Rep: Reputation: 83
You could also use: slackware64-current kernel packages.

Building a kernel is a good exercise though. Besides what everybody else said, you can remove a lot of device drivers from the kernel if you know you'll never need them.

Once you do it a couple times, it'll be easy. I just started using Linux this past year and have probably already compiled kernels 50 times, mainly just for fun and speed and optimization.

Just be sure to build your filesystem into the kernel, so you don't need an initrd. Could someone explain why a generic kernel with no filesystems enabled is a good idea?
 
Old 07-26-2015, 11:12 AM   #6
GreenFireFly
Member
 
Registered: Jul 2013
Posts: 217

Original Poster
Rep: Reputation: Disabled
Hello Everyone,

Ok thanks for the info guys.
 
Old 07-26-2015, 09:47 PM   #7
ryanpcmcquen
Member
 
Registered: Apr 2013
Distribution: DistroWanderer
Posts: 381

Rep: Reputation: Disabled
Late to the game, but I have a script that will compile kernels for you and even update LILO:

https://github.com/ryanpcmcquen/linu...re/kernelMe.sh

Just read the top of the script on how to use it, basically you run the script and it prompts you to choose mainline, stable or longterm, then figures out what the latest one is by parsing kernel.org. Some hidden features include passing a kernel config file to it (like the ones Pat puts up on ftp), like so:

Code:
KERNELCONFIG=/usr/src/config-huge-4.1.1.x64 sh kernelMe.sh
Note that the full path is required.

And building a generic kernel (instead of the default HUGE):

Code:
HUGE=n sh kernelMe.sh
I use it all the time to compile the latest stable kernel. Let me know if you have any issues, and if you find it useful, GitHub stars are always appreciated!
 
3 members found this post helpful.
Old 07-27-2015, 01:28 PM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,045

Rep: Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597Reputation: 5597
Quote:
Originally Posted by oldtechaa View Post
You could also use: slackware64-current kernel packages.
Make sure you do an installpkg instead of an upgradepkg so that your original kernel can remain unaffected.

Quote:
Originally Posted by oldtechaa View Post
Could someone explain why a generic kernel with no filesystems enabled is a good idea?
Because while I may use ext4, someone else may use btrfs, or JFS. Including all filesystems gets away from the idea behind a generic kernel, and including only the popular filesystems may make the people who don't use them think the kernel is "bloated".
 
Old 08-11-2015, 01:56 PM   #9
Bertman123
Member
 
Registered: Jun 2010
Distribution: Slackware Current 64 bit KDE 5
Posts: 342

Rep: Reputation: 73
Quote:
Originally Posted by ryanpcmcquen View Post
Late to the game, but I have a script that will compile kernels for you and even update LILO:

https://github.com/ryanpcmcquen/linu...re/kernelMe.sh

Just read the top of the script on how to use it, basically you run the script and it prompts you to choose mainline, stable or longterm, then figures out what the latest one is by parsing kernel.org. Some hidden features include passing a kernel config file to it (like the ones Pat puts up on ftp), like so:

Code:
KERNELCONFIG=/usr/src/config-huge-4.1.1.x64 sh kernelMe.sh
Note that the full path is required.

And building a generic kernel (instead of the default HUGE):

Code:
HUGE=n sh kernelMe.sh
I use it all the time to compile the latest stable kernel. Let me know if you have any issues, and if you find it useful, GitHub stars are always appreciated!
I just tried this out and was easy enough to use. Thanks for this. Gave you a star on github.
 
1 members found this post helpful.
Old 08-11-2015, 02:03 PM   #10
ryanpcmcquen
Member
 
Registered: Apr 2013
Distribution: DistroWanderer
Posts: 381

Rep: Reputation: Disabled
Quote:
Originally Posted by Bertman123 View Post
I just tried this out and was easy enough to use. Thanks for this. Gave you a star on github.
Thanks!
 
1 members found this post helpful.
Old 08-12-2015, 12:22 AM   #11
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 3,526

Rep: Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420Reputation: 3420
Most of you probably already know it but Alien Bob's page on building a custom kernel is especially good.... located H E R E Besides the lil' tidbits like how to get a display (ex: in a terminal) for root while logged in as User, Eric has the courage to risk post good technique, even if it draws hipster criticism like for running "make xconfig". Doing configs for kernels in this way is not just a mere convenience, it is a better learning experience and safer because all 3 items (category, specific, and help) all show all the time if nothing else just to relieve doubt but also explained and creates an association for where, what, and why.
 
1 members found this post helpful.
Old 08-12-2015, 07:19 AM   #12
oldtechaa
Member
 
Registered: May 2015
Location: US
Distribution: Fedora
Posts: 364

Rep: Reputation: 83
I agree. I see no reason why one should not use xconfig when possible. It is far more convenient than config, especially when you decide you need to go back to a previous option, and the single-tree option makes it easier to have multiple branches open, but just use the arrow keys to navigate, versus menuconfig's single-layer view.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SAN drives don't start update applying kernel update fsuchipj Linux - Newbie 1 04-18-2012 02:26 AM
Yum update stopped responding during kernel update install, now server load is high pulsorock Linux - Kernel 1 12-31-2008 01:55 AM
Problems with NVIDIA drivers after kernel update with yast online update Sheytan Linux - Software 4 05-06-2007 10:27 AM
YaST Online Update(YOU) Kernel Update? batorma Linux - Newbie 9 10-30-2005 03:17 AM
Problems with NVIDIA drivers after kernel update with yast online update Sheytan Linux - Distributions 0 10-13-2004 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration