LinuxQuestions.org
Help answer threads with 0 replies.
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 04-18-2024, 10:24 AM   #1
SlackCoder
Member
 
Registered: Nov 2020
Posts: 42

Rep: Reputation: Disabled
Any suggestions to auto-install the kernel into the EFI?


What are some good ways on upgrade to automatically install the kernel into the EFI?

The Arch linux wiki describes a number of ways. Bind mounting the EFI onto /boot would be nice, but it would need to use the soft-links created by Slackware's kernel package on install. The EFI's FAT filesystem format does not support soft-links.
 
Old 04-18-2024, 11:25 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,658

Rep: Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708
Also, soft links only work when the storage spaces for both source and target are mounted which is not the expected situation pre-boot.
 
Old 04-18-2024, 12:14 PM   #3
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,355

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Assuming you are using elilo with Slackware, switch over to grub bootlloader after running grub-mkconfig edit /boot/grub/grub.cfg to use vmlinuz-huge symlink and change root=UUID=xxxx-cxxx to root=/dev/xxxxx
If can boot the huge kernel without an initrd this should work

Last edited by colorpurple21859; 04-18-2024 at 12:16 PM.
 
3 members found this post helpful.
Old 04-18-2024, 01:01 PM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,898

Rep: Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020Reputation: 5020
I use a 'slackup' post-install script triggered by kernel-modules package updates to copy them over to the efi partition:
https://github.com/glangshaw/slacksc...kernel-modules
 
1 members found this post helpful.
Old 04-22-2024, 11:03 AM   #5
SlackCoder
Member
 
Registered: Nov 2020
Posts: 42

Original Poster
Rep: Reputation: Disabled
The simplest without having to install any packages is to add this to your /etc/rc.d/rc.local. It only works if updating only the kernel without the initrd is sufficient. You'll need to replace [EFI kernel location] to the one used by your system.

Code:
EFI_KERNEL="[EFI kernel location]"

>/dev/null 2>&1 nohup bash -c "inotifywait /boot --event CREATE --event MOVED_TO --quiet --monitor --include \"vmlinuz$\" | xargs -I {} cp -H /boot/vmlinuz $EFI_KERNEL" &
Note: Edited to remove installpkg patch

Last edited by SlackCoder; 04-22-2024 at 12:47 PM.
 
Old 04-24-2024, 05:32 PM   #6
breaker
Member
 
Registered: Mar 2022
Distribution: Slackware 15.0
Posts: 87

Rep: Reputation: 29
Are you using an EFI stub loader to directly boot the kernel? If so, I just copy the new files to the EFI system partition after booting with the old kernel, then reboot. As long as the file names remain the same. Just make a script to do this.

This assumes you don't use ELILO, GRUB, nor any other bootloader.
 
Old 04-25-2024, 05:19 AM   #7
denydias
Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 297

Rep: Reputation: Disabled
I have a script to update many things I need to use. One of its functions is upkernel(). It does exactly what you are looking for and many more. It's not pretty but serves me well for many years. If you want to take a look:

https://gitlab.com/-/snippets/2012761#L145

You may safely remove many of its extra features to fit your needs.
 
Old 04-25-2024, 05:54 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,597
Blog Entries: 19

Rep: Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455
I wouldn't feel safe automating such a vital function. I copy my kernel and initrd to the ESP by hand and then edit elilo.conf. It only takes a minute or so.
 
Old 04-25-2024, 10:27 AM   #9
rizitis
Member
 
Registered: Mar 2009
Location: Greece,Crete
Distribution: Slackware64-current, Slint
Posts: 647

Rep: Reputation: 491Reputation: 491Reputation: 491Reputation: 491Reputation: 491
...

EDIT: I use this script just in case you like something like this https://github.com/rizitis/siab

Last edited by rizitis; 04-25-2024 at 10:46 AM.
 
1 members found this post helpful.
Old 04-25-2024, 01:09 PM   #10
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 974

Rep: Reputation: 663Reputation: 663Reputation: 663Reputation: 663Reputation: 663Reputation: 663
Quote:
Originally Posted by hazel View Post
I wouldn't feel safe automating such a vital function. I copy my kernel and initrd to the ESP by hand and then edit elilo.conf. It only takes a minute or so.
Yes, but that is some minute(s) per machine. If you are responsible for keeping many machines up to date automation like that script is really a must. You will feel safe with automation if you first test the update on some (possible virtual) machine(s) and know that you are comfortable booting from installation media or some other live media to fix anything that has been messed up.

On the other hand, with only a single machine to care about you would spend more time configuring and testing an automated routine than to fix your single machine.

regards Henrik
 
Old Yesterday, 12:58 PM   #11
SlackCoder
Member
 
Registered: Nov 2020
Posts: 42

Original Poster
Rep: Reputation: Disabled
For those willing to automatic things a bit, I've created a service which installs the kernel on updates. It watches for changes to the kernel, or firmware and modules if mkinitrd.conf is defined. The program then waits for the install programs to finish before updating the EFI.

https://git.server.ky/slackcoder/efi-sync/about/

Slackbuilds here:
https://git.server.ky/slackcoder/sla.../tree/efi-sync
 
1 members found this post helpful.
Old Yesterday, 01:51 PM   #12
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,061

Rep: Reputation: Disabled
Solution: use GRUB and let the kernel and initramfs stay in /boot, where they belong.
 
5 members found this post helpful.
Old Yesterday, 09:14 PM   #13
truepatriot76
Member
 
Registered: Apr 2014
Location: California, USA
Distribution: slackware64-current
Posts: 232

Rep: Reputation: 195Reputation: 195
I'm going to side with colorpurple21859 & Didier on this one - if you want to automate and use current with it's frequent kernel updates: Grub is the way to go. I automate slackpkg with modifications to /usr/libexec/slackpkg/functions.d/post-functions.sh and have multiple kernels.

Current with multiple kernels really hammers the fragile vfat EFI partition and I have corrupted this partition more than once with elilo. Use Grub and it remains untouched.
 
Old Today, 12:18 AM   #14
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,597
Blog Entries: 19

Rep: Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455
Quote:
Originally Posted by truepatriot76 View Post
Current with multiple kernels really hammers the fragile vfat EFI partition and I have corrupted this partition more than once with elilo.
Can you expand on this, please? In what sense is the ESP "fragile". I am asking because I have a serious problem with current kernels that will require some kind of bisection and that means copying over a lot of kernels. I very much don't want to switch from elilo to GRUB, partly because I dislike its complexities, and partly because my machine's UEFI doesn't respond well to attempts to switch boot order via efibootmgr.
 
Old Today, 07:42 AM   #15
nhattu1986
LQ Newbie
 
Registered: Dec 2005
Distribution: slackware
Posts: 21

Rep: Reputation: 14
Quote:
Originally Posted by hazel View Post
Can you expand on this, please? In what sense is the ESP "fragile". I am asking because I have a serious problem with current kernels that will require some kind of bisection and that means copying over a lot of kernels. I very much don't want to switch from elilo to GRUB, partly because I dislike its complexities, and partly because my machine's UEFI doesn't respond well to attempts to switch boot order via efibootmgr.
I think it because:
1. ESP partition is FAT32 partition
2. FAT32 does not handle unexpected reboot well
3. linux will mount FAT32 partition with write cache enable
4. If we write the new kernel, while waiting for system to flush the data and we got unexpected reboot, file will get corrupt or sometime, the whole partition get corrupt.
 
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
[SOLVED] efi/boot/boot64.efi and slack uefi install Q BW-userx Slackware 4 10-14-2022 10:13 AM
[SOLVED] efi pxe 0 for IPv4/efi pxe 0 for IPv6 upon trying to install on a no OS pc diveceroc Linux - Newbie 2 08-18-2019 01:49 PM
[SOLVED] Ooooy. EFI boot mmx64.efi.efi not found bulgin Linux - Newbie 12 12-20-2018 11:03 AM
[SOLVED] Can't find /boot/efi/EFI/Slackware/vmlinuz kernel configuration ironQiu Slackware 4 02-09-2015 06:21 AM

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

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