LinuxQuestions.org
Visit Jeremy's Blog.
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 02-13-2023, 02:07 PM   #16
decuser
Member
 
Registered: Sep 2003
Location: Texas
Distribution: slackware 15-64
Posts: 39

Original Poster
Blog Entries: 1

Rep: Reputation: 6

Great suggestions all around. I've done this a few times now and settled on fallback and default entries in elilo.conf, where fallback is the huge kernel and default is the generic kernel. It's all working swell. Question though, after doing the upgrade, I can just cp the kernel, edit elilo.conf and reboot. If I want to use generic though, it's tricky. I tried using mkinitrd, but it complained that modules weren't loaded and wouldn't give me a line to create the initrd. However, if I booted of the new huge, it will generate the line and I can generate the initrd, copy it and the generic kernel over, tweak the conf file and reboot and be running generic pretty quick.

If you are running generic, and do an upgrade, what steps do you take to activate the new generic kernel. Apparently, mkinitrd doesn't work until you boot into a matching kernel or at least it seems that way.
 
Old 02-13-2023, 02:23 PM   #17
Pithium
Member
 
Registered: Jul 2014
Location: Far side of the Oregon Trail
Distribution: Slackware64 15.0
Posts: 505

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
Quote:
Originally Posted by decuser View Post
Great suggestions all around. I've done this a few times now and settled on fallback and default entries in elilo.conf, where fallback is the huge kernel and default is the generic kernel. It's all working swell. Question though, after doing the upgrade, I can just cp the kernel, edit elilo.conf and reboot. If I want to use generic though, it's tricky. I tried using mkinitrd, but it complained that modules weren't loaded and wouldn't give me a line to create the initrd. However, if I booted of the new huge, it will generate the line and I can generate the initrd, copy it and the generic kernel over, tweak the conf file and reboot and be running generic pretty quick.

If you are running generic, and do an upgrade, what steps do you take to activate the new generic kernel. Apparently, mkinitrd doesn't work until you boot into a matching kernel or at least it seems that way.
mkinitrd has a lot of options and flexibility to determine what modules actually get put into it. For starters, Slackware 15.0 includes a new script called "geninitrd" that automates this. One of the README files laying around probably still has the old mkinitrd command if you want to do it yourself.

The trick is to generate the new initrd every time you update the kernel, and BEFORE you reboot. I run geninitrd immediately after 'slackpkg upgrade-all', then issue 2 cp commands to move the new vmlinuz and initrd to my EFI partition. This all has to be done in lockstep.
 
1 members found this post helpful.
Old 02-13-2023, 02:28 PM   #18
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
If I may risk a suggestion...Use dracut instead of mkinitrd, and grub instead of efibootmgr. This is done in Slint (see my sig), also keeping the running kernel in addition to the new one when upgrading. I never had a complaint like "kernel panic after an upgrade" from a Slint user since doing that (but as we do not use slackpkg, rather slapt-get with a wrapper script to build an intramfs and update grub upon kernel updates, some adaptation could be needed).

PS We only use a generic kernel. Also we very recently switched to an all-in-one kernel package, including the kernel itself, the associated modules and sanitized headers, but I digress.

Last edited by Didier Spaier; 02-13-2023 at 02:43 PM. Reason: PS added.
 
2 members found this post helpful.
Old 02-13-2023, 02:35 PM   #19
Pithium
Member
 
Registered: Jul 2014
Location: Far side of the Oregon Trail
Distribution: Slackware64 15.0
Posts: 505

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
Yeah, having everything broken down into pieces is nice as a learning opportunity but I still screw this up sometimes. I should probably stop entering the commands manually and write a script or something.
 
Old 02-13-2023, 03:16 PM   #20
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 163

Rep: Reputation: 154Reputation: 154
I'm on a pretty new desktop mobo, but I still use spinning rust, boot with Lilo, and the computer has a DVD drive.

Lilo can do either the huge or generic kernels. I can boot to huge and build anything I need for generic if it fails - and I can always go back to my Slack 15.0 install DVD and boot from there if I have to.
 
Old 02-13-2023, 03:29 PM   #21
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,359

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
With Slackware I use grub with a huge kernel, setup grub at installation I'm done. No need to create an initrd, no need to run lilo, no need to copy files to the efi partition when the kernel is upgraded.

Last edited by colorpurple21859; 02-13-2023 at 03:31 PM.
 
Old 02-13-2023, 07:17 PM   #22
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,785

Rep: Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435Reputation: 4435
It certainly is admirable that people try to help others the best way they know how but I thin k it is prudent to consider that many including this OP are obviously using elilo which implies they made the move from lilo not grub and the two are very different. I'm not knocking Greub2 because I'm quite aware that it is very flexible and powerful. My main gripe is entirely subjective and not a little from sheer habit in that I don't want, and certainly don't need a boot loader to do moire than just boot operating systems.

Somewhere a whole lot closer to lilo and elilo configuration but able to probe for any potentially bootable kernel and with a lot of flexibility if you want that is rEFInd. Compare a sample from the two bootloader configs below and decide for yourself which seems simpler, or at the vewry least more like what you are used to.

Code:
### refind.conf
###
menuentry "Slack21-611" {
  icon /EFI/refind/icons/os_uefi.png
    #volume "Slack15"
    loader /EFI/Slackware/vmlinuz-6.1.11
    #initrd /EFI/Slackware/initrd.gz
    options "root=/dev/nvme1n1p3 ro video=normal threadirqs nvme_core.default_ps_max_latency_us=0"
    #disabled
}

###
Note: A much simpler stanza works just fine but I included one that demonstrates some flexibility options

--- OR ---

Code:
### grub
# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.

# Uncomment to set your own custom distributor. If you leave it unset or empty, the default
# policy is to determine the value from /etc/os-release
GRUB_DISTRIBUTOR=
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=8
GRUB_CMDLINE_LINUX_DEFAULT="splash=silent resume=/dev/disk/by-uuid/7196f698-6b1f-4937-bf94-ce36e3b251ae mitigations=auto quiet"
GRUB_CMDLINE_LINUX=""

# Uncomment to automatically save last booted menu entry in GRUB2 environment

# variable `saved_entry'
# GRUB_SAVEDEFAULT="true"
#Uncomment to enable BadRAM filtering, modify to suit your needs

# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
# GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
#Uncomment to disable graphical terminal (grub-pc only)

GRUB_TERMINAL="gfxterm"
# The resolution used on graphical terminal
#note that you can use only modes which your graphic card supports via VBE

# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE="auto"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
# GRUB_DISABLE_LINUX_UUID=true
#Uncomment to disable generation of recovery mode menu entries

# GRUB_DISABLE_RECOVERY="true"
#Uncomment to get a beep at grub start

# GRUB_INIT_TUNE="480 440 1"
GRUB_BACKGROUND=
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_USE_LINUXEFI="true"
GRUB_DISABLE_OS_PROBER="false"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"

They both work as do some others but what works best for any individual is usually the path of least resistance, and that seems subjective.

Last edited by enorbet; 02-13-2023 at 07:22 PM.
 
1 members found this post helpful.
Old 02-13-2023, 08:35 PM   #23
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,359

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Yes, under the hood grub2 is complex and most other distros have made grub2 more complicated than what it needs to be.
grub-mkconfig does make a complicated looking config file. However one can create a simple grub.cfg file similar to this that boots.
Code:
bash-5.1$ cat /boot/grub/grub.cfg
menuentry 'Slackware-15.0'  {
	insmod all_video
	insmod part_gpt
	insmod ext2
	search --no-floppy --fs-uuid --set=root 848f4cdc-7dbe-4faf-9fc9-899d86ddeced
	echo	'Loading Linux...'
	linux	/boot/vmlinuz root=/dev/sda7 ro  
}
bash-5.1$
Quote:
They both work as do some others but what works best for any individual is usually the path of least resistance, and that seems subjective.
I agree 100%
 
Old 02-13-2023, 08:47 PM   #24
decuser
Member
 
Registered: Sep 2003
Location: Texas
Distribution: slackware 15-64
Posts: 39

Original Poster
Blog Entries: 1

Rep: Reputation: 6
After much learning and doing, I wound up blacklisting kernel from slackpkg per the update notes in the security advisory for the kernel:

Code:
vi /etc/slackpkg/blacklist 
kernel-generic.*
kernel-huge.*
kernel-modules.*
kernel-source
do the update manually:
Code:
cd /slackware64-15.0/patches/packages/linux-5.15.80/
for i in *.asc; do gpg --verify $i; done
upgradepkg kernel-*.txz
do geninitrd (just seems to know about the update)
Code:
geninitrd
check the symlinks for vmlinuz and generic in /boot
Code:
ls -l /boot
if everything's cool, run eliloconfig to put things where they belong
Code:
eliloconfig
create my whizbang conf file (I don't care for the eliloconfig version):
Code:
vi /boot/efi/efi/Slackware/elilo.conf
prompt
timeout=30
default=generic

# default linux kernel
image=vmlinuz
		root=/dev/sdb3
        label=vmlinuz
        read-only
        append="vga=normal ro"
    description="Default Linux Kernel"

# generic linux kernel
image=vmlinuz-generic-5.15.80
  initrd=initrd.gz
  root=/dev/sdb3
  label=generic
  read-only
  append="vga=normal ro"
  description="Generic Linux Kernel"
Seems to work nicely.
 
3 members found this post helpful.
Old 02-14-2023, 02:35 AM   #25
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,816

Rep: Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981
I really suggest not using eliloconfig after the first time! elilo.conf changes work without running eliloconfig. It is better to copy over the new kernels and initrd after each upgrade. The reason why is that occasionally there is a kernel upgrade that causes eliloconfig to break the efibootmgr boot order. You can still find your boot loader at your computers boot screen by pressing F8 for advanced boot options.
 
3 members found this post helpful.
Old 02-14-2023, 07:38 AM   #26
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 163

Rep: Reputation: 154Reputation: 154
To generalize, from specific lilo habits (but can be extended to elilo, grub, or whatever)

If you only have one kernel and one configuration to boot, you have created a single point of failure. When it does not work, you are screwed, and recovery will be painful.

By having multiple options (generic + huge kernels, upgraded kernel + last successful one, whatever), you have fallbacks to resume more or less normal operation when something fails.

When you have everything automated, and something borks, you may find it hard to know where it borked. For critical systems (eg, the kernel), you may wish to do more steps manually (e.g, blacklist or greylist them in your automatic update tool). This way, you know what is getting updated, and when, and you'll know exactly what needs to be undone to fix things.
 
3 members found this post helpful.
Old 02-14-2023, 08:06 AM   #27
decuser
Member
 
Registered: Sep 2003
Location: Texas
Distribution: slackware 15-64
Posts: 39

Original Poster
Blog Entries: 1

Rep: Reputation: 6
Quote:
Originally Posted by dhalliwe View Post
If you only have one kernel and one configuration to boot, you have created a single point of failure. When it does not work, you are screwed, and recovery will be painful.
Fair enough, I will add a stanza for Last Known Working (LKW)!
 
Old 02-14-2023, 08:07 AM   #28
decuser
Member
 
Registered: Sep 2003
Location: Texas
Distribution: slackware 15-64
Posts: 39

Original Poster
Blog Entries: 1

Rep: Reputation: 6
Quote:
Originally Posted by RadicalDreamer View Post
I really suggest not using eliloconfig after the first time! elilo.conf changes work without running eliloconfig. It is better to copy over the new kernels and initrd after each upgrade. The reason why is that occasionally there is a kernel upgrade that causes eliloconfig to break the efibootmgr boot order. You can still find your boot loader at your computers boot screen by pressing F8 for advanced boot options.
Pff. Good point. I'll tweak to do it manually.
 
1 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
I stopped a slackpkg upgrade-all in midstream and now I cannot slackpkg upgrade-all jkh2cpu Slackware 5 02-13-2022 03:05 AM
Kernel panic after slackpkg upgrade-all francesco bat Slackware 29 04-22-2021 03:39 PM
Weird slackpkg upgrade message during a slackpkg upgrade-all process. frtorres Slackware 8 02-13-2021 11:36 AM
[SOLVED] Slackpkg upgrade-all returns 'no packages to upgrade' after slackpkg-update has downloaded files san2ban Slackware 8 11-01-2019 05:44 AM

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

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