LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-27-2019, 10:04 AM   #1
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,697
Blog Entries: 19

Rep: Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499
What is the procedure for upgrading a kernel on Slackware?


I ask because slackpkg tells me there is a new kernel available: 4.4.190. I assume this is to provide protection against spectre. Now most distros, when told to "upgrade" a kernel, actually install the new kernel alongside the old for safety. But I have a nasty feeling that slackware, which tends to take instructions very literally, might actually upgrade the working kernel and perhaps mess up my next boot. So what does one do in such cases?

One thing I've already tried is to fetch and install this specific version (kernel-generic-4.4.190-x86_64-1) by name using slackpkg. That doesn't work. Should I download the kernel image by hand and then use installpkg? The subsequent bootloader configuration isn't an issue; I know how to do that. I just want to know, as a fairly new slacker, what the normal procedure is for upgrading the kernel itself.

Last edited by hazel; 10-27-2019 at 10:28 AM.
 
Old 10-27-2019, 10:37 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,078

Rep: Reputation: Disabled
Just follow the instructions given in this email:
http://www.slackware.com/lists/archi...ecurity.687785

More generally it is recommended to register to the Slackware Security mailing list, following instructions given here:
http://www.slackware.com/lists/

It is also good practice to check the ChangeLog for the version and architecture you are running, for instance https://mirrors.slackware.com/slackw.../ChangeLog.txt

Last edited by Didier Spaier; 10-27-2019 at 10:45 AM.
 
2 members found this post helpful.
Old 10-27-2019, 11:07 AM   #3
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
Quote:
Originally Posted by hazel View Post
But I have a nasty feeling that slackware, which tends to take instructions very literally, might actually upgrade the working kernel and perhaps mess up my next boot. So what does one do in such cases?
Take a look at my blog post on this, it will give you an idea:

https://www.linuxquestions.org/quest...ackware-37876/

Quote:
Originally Posted by hazel View Post
Should I download the kernel image by hand and then use installpkg?
Yes. Kind of.

installpkg for source, modules, huge, generic
upgradepkg for headers and firmware

This will ensure you have two [or more] kernels.

A lot of people [myself included] will not let slackpkg handle automated kernel upgrades and will blacklist the kernel modules.

Last edited by Lysander666; 10-27-2019 at 11:09 AM.
 
4 members found this post helpful.
Old 10-27-2019, 11:22 AM   #4
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,027

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
I always download the source and build from scratch. Takes about 5 minutes to build the kernel and a total of 25-30 minutes to build everything - headers, modules, firmware. Usually keep the last three or four kernel releases in /boot as backups.
 
Old 10-27-2019, 11:36 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,697

Original Poster
Blog Entries: 19

Rep: Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499
Quote:
Originally Posted by 3rensho View Post
I always download the source and build from scratch. Takes about 5 minutes to build the kernel and a total of 25-30 minutes to build everything - headers, modules, firmware.
Wow! How much memory do you have? It takes my machine about an hour to build a generic slackware kernel with all the modules (a lot less in LFS where I don't include drivers for hardware that I don't have).

@ Didier, Lysander. Thank you, gentlemen. Basic installation of kernel and modules now done and initrd created. The rest is just handwork. I'm going to switch refind to the new kernel and leave the old one in elilo for the time being. Belt and braces!

Last edited by hazel; 10-27-2019 at 11:57 AM.
 
1 members found this post helpful.
Old 10-27-2019, 12:17 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
you could take inspiration from these
blacklist kernels and

script to get latest kernel ( assumes slackpkg update has been done )
Code:
#!/bin/bash
Kernels="${HOME}/Kernels"

[[ -e ${Kernels} ]] || mkdir -p "${Kernels}"
cd "${Kernels}" || exit

mirror="$(grep -m1 -v ^# /etc/slackpkg/mirrors)"
while read pkg
do
  for ext in .txt .txz.asc .txz
  do
    [[ -e ./${pkg##.*/}${ext} ]] && continue
    GetList+=(${pkg#./}${ext})
    [[ ${ext} != \.txz ]] && continue
    #Install+=(${pkg##*/}${ext})
    # Edit: I only hacked in Kernels dir for this post
    # this adds full path 
    Install+=("${Kernels}/${pkg##*/}${ext}")
  done 
done < <(awk '/kernel-[gmh][eo]/{print $7"/"$6}' /var/lib/slackpkg/pkglist)

xargs -r echo wget -c <<<${GetList[@]/#/ ${mirror}}
xargs -r echo sudo installpkg <<<${Install[@]}
I use grub
with multiple kernels ( I manually remove older ones )
so I gen. initrd for each kernel version
( which thankfully grub-mkconfig understands )

Code:
#!/bin/bash

Kernel=(/boot/vmlinuz*-*-*)

for version in ${Kernel[@]}
do
   [[ -e /boot/initrd-${version##*-}.gz ]] && continue || \
   echo sudo mkinitrd \
    -c \
    -k ${version##*-} \
    -f ext4 \
    -r /dev/vg_slackware/lv_root \
    -m usb-storage:ehci-hcd:ehci-pci:uhci-hcd:jbd2:mbcache:crc32c-intel:ext4 \
    -L -l uk -u \
    -o /boot/initrd-${version##*-}.gz
   remakeconf=y
done
[[ -z $remakeconf ]] \
  || echo sudo grub-mkconfig -o /boot/grub/grub.cfg
that is hardcoded for my system
I guess you could make it more generic with
Code:
grep -Eo "[[:graph:]]+ / " /etc/fstab | cut -d" " -f1
to get the root partition
and so on..

Last edited by Firerat; 10-27-2019 at 12:28 PM.
 
1 members found this post helpful.
Old 10-27-2019, 12:23 PM   #7
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,005

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Kernel build times range from 10 minutes on my newest computer to 3 hours on my oldest. It is entirely CPU-bound. This is why you want a powerful computer.

The amazing thing is that my oldest computer can still compile the kernel.
Ed

ETA:
Newest: Intel Core i7-5960X, 64GB
Oldest: Intel Core Duo T2500, 1GB

Last edited by EdGr; 10-27-2019 at 12:30 PM.
 
Old 10-27-2019, 12:24 PM   #8
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,027

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Wow! How much memory do you have?
32GB and a AMD FX-9590 processor.
 
Old 10-27-2019, 12:28 PM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,697

Original Poster
Blog Entries: 19

Rep: Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499
Well, I have 4 GB and an Intel quad-core Bay Trail processor. Old hardware but it's still the most powerful machine I've ever owned.
 
Old 10-27-2019, 12:58 PM   #10
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,811

Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
I, too, prefer manual building. I don't use slackpkg and don't prefer the concept. The only automation I allow is what I put in Chron... simple stuff. Initially I manually buolt kernels to be extremely lean back before loadable modules. Once ALSA was handled within the kernel I preferred to have newer kernels than mainstream and early WiFi only made that more valuable. I'm currently running 5.0.20 on 14.2 Slackware as well as a separate install of -Current.

I've built a couple 5.4.x kernels but a change in layout of Module.symvers caused nVidia drivers to fail to build so I'm awaiting resolution either from kernel.org or, more likely, nVidia. If one web searches for anything like "build slackware kernel" one will get several hits, including Alien Bob's old page created back during 2.4.x kernels but even it still works just fine. It just has a step or two that have since been streamlined a bit. In that page he mentions what amounts to the case that an initrd is only really required if one encrypts the /boot filesystem. I'm curious about encryption so I may soon for the first time need to go through the extra complications of initrd, but I like not having to. It's just slightly more KISS without one.

For me the best case for manual building is the expanding of comprehension and power that comes from visiting each option. For this reason I especially like Alien Bob's page since it shows how to be able to use "make xconfig" as root which means one can see each and every help section for every option that has one. That is a very helpful learning tool in my experience.
 
Old 10-27-2019, 01:35 PM   #11
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,027

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
"make xconfig" as root which means one can see each and every help section for every option that has one.
Me too.
 
Old 10-27-2019, 05:44 PM   #12
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
slackroll has commands to handle kernel upgrades. I've been using it to track -current on one of my machines and it makes things pretty painless.
 
3 members found this post helpful.
Old 10-28-2019, 04:03 AM   #13
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,697

Original Poster
Blog Entries: 19

Rep: Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499Reputation: 4499
Yes, that boots. I've just upgraded the kernel headers too. Now I can safely remove references to the old kernel.

Thank you again for all your help.

Last edited by hazel; 10-28-2019 at 04:35 AM.
 
Old 10-28-2019, 05:38 AM   #14
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,400

Rep: Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595
On my home system I run Slackware-current. I have the kernels comented out in /etc/slackpkg/blacklist and just let slackpkg update the kernels along with everything else. I use grub as boot loader so, the only thing I do is create a new initrd.gz when kernels are upgraded. I think I have had only one hiccup in the last 10 years.

On a side note if this was a critical system, I wouldn't do this. I use to customize kernels when hardware wasn't so robust and could see a difference in stock kernel and a custom kernel.

Last edited by colorpurple21859; 10-28-2019 at 05:40 AM.
 
Old 10-29-2019, 06:07 PM   #15
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
After reading this thread I had a look at times for compiling a kernel by hand on my own system, which I built in part to assist such compiling. I am following the 5.3.x series so this test is with 5.3.8.

I normally script this but running this in 2 parts so I can 'time' it:

Code:
time make -j 32 bzImage

[...]

real	1m4.256s
user	22m39.439s
sys	2m40.084s
and then:

Code:
time make -j 32 modules

[...]

real	4m43.485s
user	131m47.440s
sys	14m35.555s
Plus the actual installation of the kernel to /boot, modules to /lib/modules and editing of Lilo which adds some relatively inconsequential time to the adventure. This is using an AMD Threadripper 2950X which will be eclipsed soon enough when the 3rd Generation Threadripper CPUs come out...
 
  


Reply



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
Slackware Recent Security Kernel Updates Procedure Ani Slackware 5 05-22-2013 08:30 AM
Help on modifying the slackware dvd setup procedure Alkisx Slackware - Installation 2 10-23-2009 06:13 AM
Slackware Flags Procedure vivanguarda Slackware 4 01-09-2009 03:22 AM
kernel upgrade procedure Ibrahimbazar Linux - Kernel 2 05-29-2006 08:16 AM

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

All times are GMT -5. The time now is 11:53 AM.

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