LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-21-2020, 03:21 PM   #1
ganjaplanet
LQ Newbie
 
Registered: Feb 2016
Location: Jince, Czech Republic
Distribution: Slackware, openSUSE, Debian
Posts: 28
Blog Entries: 1

Rep: Reputation: 1
How to keep 2 kernels installed on slackware current using slackpkg


Hey!

I am running slackware-current, kernel-generic-5.4.84
I want to install the new kernel-generic-5.10.1 but after previous lockup during boot, i want to keep my 5.4.84 installed as well. As i'm using slackpkg to install/remove packages, what is the correct way to force it to NOT upgrade kernrl-related packages but offer them for installation? Now i am not even able to run `slackpkg install kernel-generic-5.10.1` as it is a candidate for upgrade. It is simply not show in the list

Cheers
 
Old 12-21-2020, 03:32 PM   #2
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,845

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
Got to:
Code:
/etc/slackpkg/blacklist
uncomment the lines that start with kernel
slackpkg will not upgrade the kernel at this point.
Download and use installpkg to install 5.10.1
Add to lilo
 
1 members found this post helpful.
Old 12-22-2020, 02:33 AM   #3
vp4
LQ Newbie
 
Registered: Dec 2020
Location: Yaroslavl, Russia
Distribution: Slackware64
Posts: 5

Rep: Reputation: Disabled
I had issues having multiple package versions with the same package name (e.g. kernel-generic). Unable to recall exactly what they were. I wrote a script which repacks standard slackware kernel packages to ones with version number moved from package version to package name. Now I have the following packages installed:
Code:
$ ls -1 /var/log/packages/kernel*
/var/log/packages/kernel4.4.240-firmware-0-x86_64-1vp
/var/log/packages/kernel4.4.240-generic-0-x86_64-1vp
/var/log/packages/kernel4.4.240-modules-0-x86_64-1vp
/var/log/packages/kernel4.4.240-nvidia340-0.108-x86_64-1vp
/var/log/packages/kernel5.10.1-firmware-0-x86_64-1vp
/var/log/packages/kernel5.10.1-generic-0-x86_64-1vp
/var/log/packages/kernel5.10.1-modules-0-x86_64-1vp
/var/log/packages/kernel5.10.1-nvidia340-0.108-x86_64-1vp
/var/log/packages/kernel5.4.82-firmware-0-x86_64-1vp
/var/log/packages/kernel5.4.82-generic-0-x86_64-1vp
/var/log/packages/kernel5.4.82-modules-0-x86_64-1vp
/var/log/packages/kernel5.4.82-nvidia340-0.108-x86_64-1vp
/var/log/packages/kernel-firmware-20201005_58d41d0-noarch-1
/var/log/packages/kernel-headers-4.4.240-x86-1
Though it's not an answer to "How to do it using slackpkg" I can provide here the script if you wish. It's rather simple.
 
Old 12-22-2020, 11:16 AM   #4
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,988

Rep: Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560Reputation: 1560
Quote:
Originally Posted by ganjaplanet View Post
I am running slackware-current, kernel-generic-5.4.84
I want to install the new kernel-generic-5.10.1 but after previous lockup during boot, i want to keep my 5.4.84 installed as well. As i'm using slackpkg to install/remove packages, what is the correct way to force it to NOT upgrade kernrl-related packages but offer them for installation? Now i am not even able to run `slackpkg install kernel-generic-5.10.1` as it is a candidate for upgrade. It is simply not show in the listCheers
I keep at least two kernels versions installed and can boot to generic (default), huge and the last working kernel. There are other ways to this. This is how I would accomplish what you want.

You did not mention what boot system you use. I use lilo, elilo can be similarly configured, not familiar enough with grub to comment on that. I also do not know what you currently have installed.so I will go with the 5.4.84 kernel. I am going to guess that the huge kernel is NOT installed. I am writing this for slackpkg installed only.

I am going to guess you would want to go with the latest 5.10.2 kernel instead of the 5.10.1 kernel.

Note: I wrote this for slackware64-current, then realized you stated slackware-current. So I modified this for slackware-current, so be forewarned I might have missed something as far a details go. The procedure should be good.

The contents of the /boot directory as guessed.
Code:
System.map -> System.map-generic-smp-5.4.84-smp
System.map-generic-5.4.84
System.map-generic-smp-5.4.84-smp
config -> config-generic-smp-5.4.84-smp
config-generic-5.4.84
config-generic-smp-5.4.84-smp
initrd-tree/
initrd.gz
vmlinuz -> vmlinuz-generic-smp-5.4.84-smp
vmlinuz-generic -> vmlinuz-generic-5.4.84
vmlinuz-generic-5.4.84
vmlinuz-generic-smp > vmlinuz-generic-smp-5.4.84-smp
vmlinuz-generic-smp-5.4.84-smp
The kernel packages must be blacklisted. Noted that kernel-headers is included.
Code:
kernel-generic
kernel-huge
kernel-modules
kernel-source
kernel-headers
This is how I would setup /etc/lilo.conf, applicable sections only. This takes advantage of how kernel-generic is installed so you won't have to make changes with any 5.10.x updates to lilo.conf
Code:
### Global options
default=Generic-5.4.84
## kernel images ##
# Generic 5.10.x kernel
image=/boot/vmlinuz-generic-smp
  initrd=/boot/initrd.gz
  label=Generic-5.10.x
# Generic 5.4.84 kernel
image=/boot/vmlinuz-5.4.84
  initrd=/boot/initrd-5.4.84.gz
  label=Generic-5.4.84
Next edit /etc/slackpkg/blacklist to comment out the kernel packages except for kernel-huge, then run.
Code:
/boot# slackpkg download kernel-generic kernel-modules kernel-source kernel-headers
Now edit /etc/slackpkg/blacklist to uncomment the kernel packages to blacklist them again.

The next step is to install the updated kernel packages.
Code:
/boot# installpkg /var/cache/packages/slackware64/*/*.txz
Then clear the slackpkg cache
Code:
/boot# rm /var/cache/packages/slackware64/*/*
Now create symlinks for the 5.4.84 generic kernel to match what we are using in lilo.conf
Code:
/boot# ln -s config-generic-smp-5.4.84-smp config-5.4.84
/boot# ln -s System.map-generic-smp-5.4.84-smp System.map-5.4.84
/boot# ln -s vmlinuz-generic-smp-5.4.84-smp vmlinuz-5.4.84
Now that the symlinks are done, run makeinitrd, first for the 5.4.84 kernel, then the 5.10.2 kernel.
Note: I use an /etc/mkinitrd.conf file for my setting for mkinitrd.
Code:
/boot# mkinitrd -F -k 5.4.84-smp -s initrd-tree-5.4.84 -o initrd-5.4.84.gz
/boot# mkinitrd -F -k 5.10.2-smp
Run lilo

The /boot directory should show as follows (kernel applicable only parts), order may be different.
Code:
System.map -> System.map-generic-smp-5.10.2-smp
System.map-generic-5.10.2
System.map-generic-smp-5.10.2-smp
System.map-generic-5.4.84
System.map-generic-smp-5.4.84-smp
System.map-5.4.84 > System.map-generic-smp-5.4.84-smp
config -> config-generic-smp-5.10.2-smp
config-generic-5.10.2
config-generic-smp-5.10.2-smp
config-generic-5.4.84
config-generic-smp-5.4.84-smp
config-5.4.84 > config-generic-smp-5.4.84-smp
initrd-tree/
initrd.gz
initrd-tree-5.4.84/
initrd-5.4.84.gz
vmlinuz -> vmlinuz-generic-smp-5.10.2-smp
vmlinuz-generic -> vmlinuz-generic-5.10.2
vmlinuz-generic-5.10.2
vmlinuz-generic-smp > vmlinuz-generic-smp-5.10.2-smp
vmlinuz-generic-smp-5.10.2-smp
vmlinuz-generic-5.4.84
vmlinuz-generic-smp-5.4.84-smp
vmlinuz-5.4.84 > vmlinuz-generic-smp-5.4.84-smp
To upgrade to a newer 5.10.x kernel for example 5.10.2 to 5.10.3, you need to remove the old one first. If you don't then 5.10.1 will remain installed.
Code:
/boot# removepkg /var/lib/pkgtools/packages/kernel*-5.10.2-*
Comment out the kernel entries in blacklist and run.
Code:
/boot# slackpkg download kernel-generic kernel-modules kernel-source kernel-headers
Uncomment the kernel entries in blacklist.
Install the updated kernel
Code:
/boot# installpkg /var/cache/packages/slackware64/*/*.txz
Clear the slackpkg cache
Code:
/boot# rm /var/cache/packages/slackware64/*/*
Run mkinitrd (reminder I use /etc/mkinitrd.conf for my settings).
Code:
/boot# mkinitrd -F -k 5.10.3-smp
Run lilo

No need to do anything with the 5.4.48-smp kernel as it already setup.

If interested I can post my procure for upgrade my kernels on this system. This is the /boot directory applicable files. I use slackware64-current and have slackpkg+ installed.
Code:
System.map -> System.map-generic-5.10.2
System.map-generic-5.10.1
System.map-generic-5.10.2
System.map-huge-5.10.2
System.map-working -> System.map-generic-5.10.1
config -> config-generic-5.10.2.x64
config-generic-5.10.1.x64
config-generic-5.10.2.x64
config-huge-5.10.2.x64
config-working -> config-generic-5.10.1.x64
initrd-tree/
initrd-tree-working/
initrd-working.gz
initrd.gz
vmlinuz -> vmlinuz-generic-5.10.2
vmlinuz-generic -> vmlinuz-generic-5.10.2
vmlinuz-generic-5.10.1
vmlinuz-generic-5.10.2
vmlinuz-huge -> vmlinuz-huge-5.10.2
vmlinuz-huge-5.10.2
vmlinuz-working -> vmlinuz-generic-5.10.1

Last edited by chrisretusn; 12-22-2020 at 11:17 AM.
 
4 members found this post helpful.
  


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
having trouble after upgrading 14.1 slackware using slackpkg and slackpkg+ [solved] slackartist Slackware 1 12-28-2015 07:28 AM
Slackware ARM (current) epic mistake: the current Android kernels are kicked out! Darth Vader Slackware 16 08-25-2013 04:36 PM
Using Slackware-Current kernels in Slackware-11 davimint Slackware 3 06-13-2007 03:23 PM
slackware current question on the current kernels davimint Slackware 3 06-03-2007 07:39 AM

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

All times are GMT -5. The time now is 03:40 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