LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   A reminder for upgrading - I did it again :( (https://www.linuxquestions.org/questions/slackware-14/a-reminder-for-upgrading-i-did-it-again-4175462993/)

s3phir0th115 05-23-2013 02:56 AM

I might have forgotten about it long ago, but now that I manually alter my lilo.conf to add absolute hard drive partition locations based on the drive itself, and do things like use the generic kernel, it just has come with habit.

wildwizard 05-23-2013 03:20 AM

I no longer have this problem.

Any kernel I have in lilo.conf has been copied to a subdir under /boot along with its initrd image.

The kernel images that Slackware installs are therefor not used directly and can be changed without causing grief.

ruario 05-23-2013 03:54 AM

Quote:

Originally Posted by rkelsen (Post 4956878)
3 cheers for UEFI and eLILO!

Once the new kernel has been added to elilo.conf, there is nothing more to do. :)

You don't need UEFI for that, Slackware also ships with Syslinux (which includes Extlinux). You can do the same thing.

Once the new kernel has been added to extlinux.conf, there is nothing more to do. :)

perbh 05-23-2013 09:38 AM

He he - in my wayyy distant youth I used to forget it about every 2nd time - which is the reason why I never use it anymore ... legacy-grub for me, 3 times over!!

allend 05-23-2013 10:43 AM

I have written a modified version of the lookkernel function in slackpkg that checks if a generic kernel has been upgraded. It reminds that a new initrd is needed and will offer to run a mkinitrd command if there is a file /boot/lastmkinitrd.txt.
The file /boot/lastmkinitrd.txt was initially generated with:
Code:

/usr/share/mkinitrd/mkinitrd_command_generator.sh > /boot/lastmkinitrd.txt
The modified function is in a file /usr/libexec/slackpkg/functions.d/q_mkinitrd-function.sh that needs to be set executable for the modified function to be sourced. The file name is started with q as it needs to be listed after the existing post-functions.sh
Code:

lookkernel() {
        NEWKERNELMD5=$(md5sum /boot/vmlinuz 2>/dev/null)
        if [ "$KERNELMD5" != "$NEWKERNELMD5" ]; then
                if $(stat -c %N /boot/vmlinuz | grep -q generic); then
                      echo -e "\n
Your kernel image was updated to a generic kernel. You need a new initrd."
                        NEWKERNELVERSION=$(stat -c %N /boot/vmlinuz | sed -e "s/'$//" -e 's/.*-\([1-9]\)/\1/')
                        if [ -d /lib/modules/$KERNELVERSION ] && [ -f /boot/lastmkinitrd.txt ]; then
                              MKINITRD_CMD=$(sed 's/-k .\{5,13\} -/-k '$NEWKERNELVERSION' -/' /boot/lastmkinitrd.txt)
                              echo -e "\n
$MKINITRD_CMD
Do you want slackpkg to run the above command? (Y/n)"
                              answer
                              if [ "$ANSWER" != "n" ] && [ "$ANSWER" != "N" ]; then
                                        $MKINITRD_CMD && echo "$MKINITRD_CMD" > /boot/lastmkinitrd.txt
                              fi
                        fi
                fi
                if [ -x /sbin/lilo ]; 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)"
                        answer
                        if [ "$ANSWER" != "n" ] && [ "$ANSWER" != "N" ]; then
                                /sbin/lilo
                        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
}

Now I get the lilo reminder _after_ dealing with the initrd!

1337_powerslacker 05-23-2013 02:27 PM

Quote:

Originally Posted by brianL (Post 4956564)
Me too. Anybody who hasn't?

Certainly not I. I can't count the number of times I upgraded a kernel (or just compiled a newer version on my own), and forgot to run lilo. Hello, series of 99's!

Painful memories, those. But you live and learn and go on.

rkelsen 05-23-2013 06:58 PM

Quote:

Originally Posted by ruario (Post 4957092)
You don't need UEFI for that

Actually, I had no choice. It's what came with the laptop. It doesn't have a 'legacy' mode.

I'm guessing it'll only get harder to find non-UEFI hardware from here on out.


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