LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackpkg again , Press the "Enter" key to continue... (https://www.linuxquestions.org/questions/slackware-14/slackpkg-again-press-the-enter-key-to-continue-4175694065/)

babydr 04-21-2021 09:14 PM

Slackpkg again , Press the "Enter" key to continue...
 
From a script in cron , that would be a VERY concerning message .

#!/bin/bash
slackpkg -batch=on -default_answer=y upgrade-all


Code:

Your kernel image was updated, and lilo does not appear to be used on
your system.  You may need to adjust your boot manager (like GRUB) to
boot the appropriate kernel (after generating an initrd if required).
Press the "Enter" key to continue...

Hth , JimL

quickbreakfast 04-22-2021 02:16 AM

I don't see your problem, because your electronic marvel is telling you the kernel has been updated and the new kernel will need a new initrd to boot into Slackware.

So after you've created the new initrd file, either edit either lilo (which your electronic marvel can't find) to point to the new kernel and initrd files, and run lilo, or your grub file.

Unless you have blacklisted your current kernel, it's likely to have been removed.

willysr 04-22-2021 03:40 AM

you don't run slackpkg upgrade-all in cron, especially during development cycle

lovemeslk 04-22-2021 05:16 AM

Quote:

Originally Posted by willysr (Post 6243618)
you don't run slackpkg upgrade-all in cron, especially during development cycle

Your right Willy. Mine runs slackpkg install-new then upgrade-all'
Before geninitrd came out my script made the initrd.gz.
But now it also downlads the latest nvidia driver and installs it.
I been running current many years. This current has been Kernel king
for updates.
I love the new Slackpkg because it doesn't wipe your mirror as before.
This allow me to make that choice in my spare time. Nothing is perfect but
at least the next cron cycle it restarts the upgrade again.
But I also keep a sync of slackware on hard drive.
That gets synced first in case you lose internet do to an upgrade.
Nothing is perfect.
Keep up your wonderful work on SBOPKG.

chrisretusn 04-22-2021 06:13 AM

Quote:

Originally Posted by willysr (Post 6243618)
you don't run slackpkg upgrade-all in cron, especially during development cycle

I would go one step further, you shouldn't run slackpkg in cron if you are using -current. To many ways things can go wrong.

Ser Olmy 04-22-2021 06:35 AM

Perhaps we're missing the point here.

I think the real question posed by the OP is: Should -default_answer=y also cover the "Press ENTER" prompt (which is purely informational) when the kernel is updated?

I'd say yes, but add that it would be great if it would also be possible for a script to detect that this condition was detected by slackpkg (an exit code, a semaphore file in /tmp or /run, or whatever).

chrisretusn 04-22-2021 10:04 AM

Quote:

Originally Posted by Ser Olmy (Post 6243660)
Perhaps we're missing the point here.

I think the real question posed by the OP is: Should -default_answer=y also cover the "Press ENTER" prompt (which is purely informational) when the kernel is updated?

I'd say yes, but add that it would be great if it would also be possible for a script to detect that this condition was detected by slackpkg (an exit code, a semaphore file in /tmp or /run, or whatever).

Sure, agree, script should continue.

That brings up what should it do when slackpkg is upgraded and it drops you out, to restart the process?

I still say upgrading -current is via cron is asking for problems.

allend 04-22-2021 11:30 AM

Quote:

you don't run slackpkg upgrade-all in cron, especially during development cycle
I do see a use case for this. Consider someone maintaining a bank of identical machines who updates a master then wants to push that out to the rest.
Quote:

I think the real question posed by the OP is: Should -default_answer=y also cover the "Press ENTER" prompt (which is purely informational) when the kernel is updated?
Easy enough to do. Create an executable file, say xx_lookkernel in /usr/libexec/slackpkg/functions.d containing
Code:

lookkernel() {
        NEWKERNELMD5=$(md5sum /boot/vmlinuz 2>/dev/null)
        if [ "$KERNELMD5" != "$NEWKERNELMD5" ]; then
                if [ -x /sbin/lilo ] && [ -r /etc/lilo.conf ] && grep -q initrd /etc/lilo.conf ; then
                        echo -e "\n
Your kernel image was updated, and your /etc/lilo.conf indicates
the use of an initrd for at least one of your kernels. Be sure to
regenerate the initrd for the new kernel and handle any needed
updates to your bootloader.
"
                        answer
                elif [ -x /sbin/lilo ] && [ -r /etc/lilo.conf ] ; then
                        echo -e "\n
Your kernel image was updated.  Be sure to handle any needed updates
to your bootloader (possibly as simple as running /sbin/lilo).
"
                        answer
                else
                        echo -e "\n
Your kernel image was updated, and lilo does not appear to be used on
your system.  You may need to adjust your boot manager (like GRUB) to
boot the appropriate kernel (after generating an initrd if required)."
                fi
                echo -e "Press the \"Enter\" key to continue...\n "
                answer
        fi
}

This will replace the existing lookkernel() function with one that respects the batch=on option.

babydr 04-22-2021 05:22 PM

Hello ALL , Thank you . @"Ser Olmy" , Exactly .

Especially @allend , Had to find the real differences in your version of lookkernel function , The section of post-functions.sh that contains lookkernel also used "answer" but I was confused ...
As the name 'answer' is a valid command at /usr/bin/answer and is a part of elm . Has completely different usage .
So I did some grep'ng around the paths below post-functions to see if there was a function named 'answer' defined and found that the changes you posted used the function 'answer' from core-functions.sh .

Yes , I understand , NOT using this in a cron script . Sorry . For the present it must be .
Tnx , again . JimL

babydr 06-10-2021 07:13 PM

Hello ALL , As of slackpkg-15.0.5-noarch-1 (& Possibly earlier) the concern mentioned in this thread is fixed .
Marking SOLVED .


All times are GMT -5. The time now is 01:05 AM.