SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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!
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:
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.
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?
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!
Make sure you do an installpkg instead of an upgradepkg so that your original kernel can remain unaffected.
Quote:
Originally Posted by oldtechaa
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".
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.