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 03-22-2018, 03:05 AM   #1
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 156

Rep: Reputation: Disabled
Updating slackpkg and add eliloconfig ?


Hello,

after a few times when I forgot to write eliloconfig when upgrade kernel to new one I feel a little bit discriminated against lilo users because slackpkg asked to run lilo. I think it's can be added in function lookkernel() in file post-function.sh of slackpkg to check if /boot/efi is mounted and if is mounted to ask for eliloconfig instead lilo.
 
Old 03-23-2018, 03:40 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
It is easy to do this for yourself by adding a custom function to slackpkg. https://www.linuxquestions.org/quest...ml#post5771592
 
Old 03-23-2018, 05:13 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
If you know how to create a patch and then send it to Pat Volkerding, the chances of getting it included are higher.
 
Old 03-23-2018, 10:31 AM   #4
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
i am also looking for an easier way to set up elilo. At least have the elilo.conf file commented.
 
Old 03-23-2018, 11:18 AM   #5
trollog
Member
 
Registered: Oct 2014
Posts: 151

Rep: Reputation: Disabled
commented elilo.conf file would be nice

But otherwise it seems like elilo is about as simple/complex as it needs to be.
I think I wouldn't want it automated much more than it is.

lilo has simplicity on it's side- there just aren't all that many ways to "do" it,
and only 1 of 2 places to "put" it...

I don't see that same degree of uniformity or simplicity with the array of configurations
possible with elilo

I think it would not be possible to automate it like lilo and still not have a mess of compromises
that nobody's happy with.

Also doesn't hurt to know something about your bootloader on the rare occasions when things go sideways.

.
 
Old 03-23-2018, 12:19 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Quote:
Originally Posted by solarfields View Post
At least have the elilo.conf file commented.
Have a look in /usr/doc/elilo-<version> at README.TXT and elilo.txt.
 
1 members found this post helpful.
Old 03-23-2018, 03:59 PM   #7
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
how i did not think of that
 
Old 03-24-2018, 03:45 AM   #8
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 156

Original Poster
Rep: Reputation: Disabled
Code:
--- /usr/libexec/slackpkg/functions.d/post-functions.sh 2017-10-10 10:40:20.000000000 +0300
+++ post-functions.sh   2018-03-24 10:40:37.865627653 +0200
@@ -212,10 +212,25 @@
                                /sbin/lilo
                        fi
                else
-                       echo -e "\n
+                       if [ -d /sys/firmware/efi ]; then
+                               MACHINE=$(uname -m)
+                               if mount | grep vfat | grep -wq /boot/efi ; then
+                                       if [ "$MACHINE" == "x86_64" ]; then
+                                               cp /boot/elilo-x86_64.efi /boot/efi/EFI/Slackware/elilo.efi
+                                       else
+                                               cp /boot/elilo-ia32.efi /boot/efi/EFI/Slackware/elilo.efi
+                                       fi
+                                       cp /boot/vmlinuz /boot/efi/EFI/Slackware/vmlinuz
+                                       echo -e "\n
+Your kernel image was updated and copied with elilo efi file to /boot/efi/EFI/Slackware.
+Check it out before reboot. If you need start eliloconfig to adjust your boot manager."
+                               fi
+                       else
+                               echo -e "\n
 Your kernel image was updated and lilo is not found on your system.
 You may need to adjust your boot manager (like GRUB) to boot appropriate
 kernel."
+                       fi
                fi
        fi
 }
Here is what I do, now is time to wait for new kernel in current to test the changes. If some one bash guru find error, pls let me know.

Last edited by gildbg; 03-24-2018 at 08:31 AM. Reason: fix syntax error
 
3 members found this post helpful.
Old 03-24-2018, 10:30 AM   #9
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
@gildbg - Thanks for taking on the challenge!
My minor quibble is that the user should be be prompted to make the changes, rather than accept the changes after they have have been made.
 
1 members found this post helpful.
Old 03-25-2018, 04:41 AM   #10
phi11ip
Member
 
Registered: Jul 2007
Location: Nottingham, UK
Distribution: Slackware64-current
Posts: 93

Rep: Reputation: 23
A couple of caveats:
1. For a full install the file /sbin/lilo will exist and the patch will never be run. One solution is to delete the file but a better test would be
Code:
if [ -f /etc/lilo.conf ]
as the elilo.conf is only created if lilo is configured.
2. Will not work for generic kernels.
 
Old 03-26-2018, 09:07 AM   #11
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 156

Original Poster
Rep: Reputation: Disabled
Yep,
it's should be: if [ -x /sbin/lilo ] && [ ! -d /sys/firmware/efi ]; then
I now saw it.

Code:
--- /usr/libexec/slackpkg/functions.d/post-functions.sh 2018-03-26 17:02:38.674602360 +0300
+++ post-functions.sh   2018-03-26 17:01:15.206302661 +0300
@@ -203,7 +203,7 @@
 lookkernel() {
        NEWKERNELMD5=$(md5sum /boot/vmlinuz 2>/dev/null)
        if [ "$KERNELMD5" != "$NEWKERNELMD5" ]; then
-               if [ -x /sbin/lilo ]; then
+               if [ -x /sbin/lilo ] && [ ! -d /sys/firmware/efi ]; then
                        echo -e "\n
 Your kernel image was updated.  We highly recommend you run: lilo
 Do you want slackpkg to run lilo now? (Y/n)"
@@ -212,10 +212,25 @@
                                /sbin/lilo
                        fi
                else
-                       echo -e "\n
+                       if [ -d /sys/firmware/efi ]; then
+                               MACHINE=$(uname -m)
+                               if mount | grep vfat | grep -wq /boot/efi ; then
+                                       if [ "$MACHINE" == "x86_64" ]; then
+                                               cp /boot/elilo-x86_64.efi /boot/efi/EFI/Slackware/elilo.efi
+                                       else
+                                               cp /boot/elilo-ia32.efi /boot/efi/EFI/Slackware/elilo.efi
+                                       fi
+                                       cp /boot/vmlinuz /boot/efi/EFI/Slackware/vmlinuz
+                                       echo -e "\n
+Your kernel image was updated and copied with elilo efi file to /boot/efi/EFI/Slackware.
+Check it out before reboot. If you need start eliloconfig to adjust your boot manager."
+                               fi
+                       else
+                               echo -e "\n
 Your kernel image was updated and lilo is not found on your system.
 You may need to adjust your boot manager (like GRUB) to boot appropriate
 kernel."
+                       fi
                fi
        fi
 }

Why do you think will now work for generic kernels ? If the kernel images is different script will copy from boot directory file vmlinuz to /boot/efi/EFI/Slackware/vmlinuz
 
Old 03-27-2018, 03:27 AM   #12
phi11ip
Member
 
Registered: Jul 2007
Location: Nottingham, UK
Distribution: Slackware64-current
Posts: 93

Rep: Reputation: 23
As far as I understand it the /boot/vmlinuz is a symlink to the huge kernel. Users of the generic kernel would need to copy /boot/vmlinuz-generic. They would also have to update their initrd file. It's a long time since I've used a generic kernel and possibly my memory is playing tricks with me :-(
 
Old 03-27-2018, 05:30 AM   #13
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
As an aside to help someone in a remote location to install Slint alongside Debian I recently used grub.

Easy way to upgrade the boot loader after a kernel upgrade, or just when installing it register a new system in the boot manager:
Code:
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda
Additionally in case of multi boot of Linux systems these commands can be typed from the any of these systems.

Last edited by Didier Spaier; 03-27-2018 at 06:32 AM. Reason: Missing hyphen added.
 
Old 03-30-2018, 08:31 AM   #14
gildbg
Member
 
Registered: Aug 2017
Distribution: Slackware, OpenBSD
Posts: 156

Original Poster
Rep: Reputation: Disabled
It's worked like a charm

@Didier Spaier suggestion trying to resolve the problem when you upgrade your kernel and work on mixed machines few with LILO few with ELILO and and write reboot after upgrade without to copy vmlinuz file to in /boot/efi/EFI/Slackware/ and then you realize that this machine is with ELILO not with LILO and you are ....

@phi11ip I look into slackpkg files and did not see such functionality if you are with LILO. I added initrd check

@allend I added yes or no question for copy new files as you suggest. Also I added error message if efi directory is not mounted.
My english isnt so good, so pls fix the language errors.

Code:
--- /usr/libexec/slackpkg/functions.d/post-functions.sh	2018-03-30 16:43:13.825538532 +0300
+++ post-functions.sh	2018-03-30 16:43:05.899623732 +0300
@@ -203,7 +203,7 @@
 lookkernel() {
 	NEWKERNELMD5=$(md5sum /boot/vmlinuz 2>/dev/null)
 	if [ "$KERNELMD5" != "$NEWKERNELMD5" ]; then
-		if [ -x /sbin/lilo ]; then
+		if [ -x /sbin/lilo ] && [ ! -d /sys/firmware/efi ]; then
 			echo -e "\n
 Your kernel image was updated.  We highly recommend you run: lilo
 Do you want slackpkg to run lilo now? (Y/n)"
@@ -212,10 +212,38 @@
 				/sbin/lilo
 			fi
 		else
-			echo -e "\n
+			if [ -d /sys/firmware/efi ]; then
+				MACHINE=$(uname -m)
+				echo -e "\n
+Your kernel image was updated.  We highly recommend you to copy elilo, vmlinuz and initrd
+to /boot/efi/EFI/Slackware/ Do you want slackpkg to do that for you ? (Y/n)"
+				answer
+				if [ "$ANSWER" != "n" ] && [ "$ANSWER" != "N" ]; then
+					if mount | grep vfat | grep -wq /boot/efi ; then
+						if [ "$MACHINE" == "x86_64" ]; then
+							cp /boot/elilo-x86_64.efi /boot/efi/EFI/Slackware/elilo.efi
+						else
+							cp /boot/elilo-ia32.efi /boot/efi/EFI/Slackware/elilo.efi
+						fi
+						cp /boot/vmlinuz /boot/efi/EFI/Slackware/vmlinuz
+						if [ -r /boot/initrd.gz ]; then
+							cp /boot/initrd.gz /boot/efi/EFI/Slackware 1> /dev/null 2> /dev/null
+							touch -r /boot/initrd.gz /boot/efi/EFI/Slackware/initrd.gz
+						fi
+						echo -e "\n
+Your kernel image was updated and copied with elilo efi file and initrd.gz if exists to /boot/efi/EFI/Slackware.
+Check it out before reboot. If you need start eliloconfig to adjust your boot manager."
+					else
+						echo -e "\n
+Your efi partition is not mounted. Check that before reboot."
+					fi
+				fi
+			else
+				echo -e "\n
 Your kernel image was updated and lilo is not found on your system.
 You may need to adjust your boot manager (like GRUB) to boot appropriate
 kernel."
+			fi
 		fi
 	fi
 }

Last edited by gildbg; 03-30-2018 at 08:48 AM. Reason: Added yes or no question
 
  


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] Updating with slackpkg WBP Slackware 13 02-08-2018 09:18 PM
[SOLVED] slackpkg does not appear to be updating system mfoley Slackware - Installation 19 06-19-2015 08:32 AM
Updating packages w/out Slackpkg Konphine Slackware 4 09-25-2011 02:40 PM
Slackpkg updating not able to connect foolio1990 Linux - Newbie 2 09-04-2008 10:48 PM
Updating to -current with slackpkg macbeth8 Slackware 8 04-04-2008 07:14 PM

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

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