LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs > zapwai
User Name
Password

Notices


I have a text file full of tips where I jot down commands that I need to remember.
I've decided to turn them into blog posts instead.
Rate this Entry

Kernel update

Posted 07-10-2017 at 05:43 PM by zapwai
Updated 07-10-2017 at 08:25 PM by zapwai

After the first few kernel updates you put yourself through you will definitely feel much less anxiety, and it basically feels like updating every other piece of software in the system. (Choosing your own options and building your own kernel will also help to remove any fears, but has a steeper learning curve.)

Still, I tend to forget what steps I took, as it's generally been 6+ months since I last updated the kernel.

In Slackware, there is occasionally an official kernel update, conveniently available via slackpkg!
(This installs to /boot/ the compressed kernel images (vmlinuz) for both huge and generic, their system maps, and their config files, and it deletes the old ones.)

In that case there should be very little to do, so here is the minimum, post install:
  1. Bootloader config
  2. Initrd
  3. Video drivers

1) Make sure you can boot; update or double-check your bootloader config: for me that means
emacs /etc/lilo.conf && lilo.

2) Make initrd.gz; I don't love using the huge kernel, and I have a wireless keyboard that requires an initial ramdisk if I want to use the generic kernel. So I run the result of:
/usr/share/mkinitrd/mkinitrd_command_generator.sh

3) Update your video drivers; if you're using an nvidia card on a multi-lib (64-bit with some 32-bit libraries) system like myself that means you run:
sbopkg -i nvidia-kernel -i nvidia-driver:opt1="COMPAT32=yes"

------------------------------------------------------------------------

Should I build my own kernel? Only if the concept is appealing. It's usually not necessary.

In the past I needed a low-latency kernel because I was using my PC as a guitar amplifier and it was responding too slowly. Currently (kernel 4.12) this option is under Processor Type and Features > Preemption Model (Preemptible Kernel). I even tried a real-time kernel for a while.
https://askubuntu.com/questions/1266...ltime-one?rq=1
https://rt.wiki.kernel.org/index.php/Main_Page

For the average user the default voluntary setting is probably best. Choosing low-latency means, ironically enough, your computer may become less responsive to you switching applications. So it would be good for audio recording and playback, processing that you want done immediately. (And not as good for watching a video, then switching to check your email, then surfing the web all in rapid succession. Though frankly you *could* use low-latency all the time, if you really wanted to.) For me it just made more sense to have separate kernels, and I would reboot when I wanted to play with guitarix. http://guitarix.org/

If you're installing a kernel from a tarball, e.g. from https://www.kernel.org/, that's slightly more complicated than just the three steps above.
Still, if you're comfortable typing the word 'make' then you can handle this.
The most complete and brief guide I've found is this: http://www.berkes.ca/guides/linux_kernel.html
  1. untar
  2. config
  3. build
  4. copy files

And then you finish with the bootloader/initrd/video-driver steps as above.

1) tar xf linux-4.12.tar.xz && cd linux-4.12
Uncompressed, kernel 4.12 takes up 715MB, so don't go downloading 10 different kernels just to play around.

2) make menuconfig
You can load a .config file if you have a few changes to make, or simply run make oldconfig.

3) make && make modules && make modules_install
make or make all should build the dependencies, an uncompressed kernel called vmlinux, and the compressed kernel image (e.g. under arch/x86_64/boot/bzImage).
Separately you might make dep && make bzImage && make modules && make modules_install. (That last make is actually installing files to /lib/modules/.)

4) cp arch/x86_64/boot/bzImage /boot/vmlinuz-4.12
cp System.map /boot/System.map-4.12 && cp .config /boot/config-4.12

Slackware makes soft links for all three of these files, pointing to huge by default.
If you need to start over, make mrproper && make clean.
Posted in Uncategorized
Views 186 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 04:59 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration