Update Manager -- Kernel Cleanup

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Update Manager -- Kernel Cleanup

Post by pgmer6809 »

Currently when one uses Update Manager to remove kernels no longer needed, after EVERY kernel it removes it re-runs grub to regenerate grub.cfg.
If one has queued several (up to 20?) kernels for removal this wastes a LOT of time.
Is it possible to modify Update Manager so that it only does the 'update grub' thing, when it has reached the end of the job queue?
Would there be reliability risks to this? i.e. you remove a redundant, unused, kernel but the grub.cfg does not (yet) reflect that, will this affect your ability to boot if the system crashes in the meantime?
pgmer6809.
Last edited by LockBot on Mon Nov 06, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
SMG
Level 25
Level 25
Posts: 31047
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Update Manager -- Kernel Cleanup

Post by SMG »

pgmer6809 wrote: Sat May 06, 2023 12:55 pm Currently when one uses Update Manager to remove kernels no longer needed, after EVERY kernel it removes it re-runs grub to regenerate grub.cfg.
If one has queued several (up to 20?) kernels for removal this wastes a LOT of time.
Is it possible to modify Update Manager so that it only does the 'update grub' thing, when it has reached the end of the job queue?
Would there be reliability risks to this? i.e. you remove a redundant, unused, kernel but the grub.cfg does not (yet) reflect that, will this affect your ability to boot if the system crashes in the meantime?
This forum is for your questions related to Programming & Development (for projects you are coding) or you getting involved in help with Linux Mint programming and development. Your questions do not seem to be either so maybe I am misunderstanding.

You can find the Update Manager (mintupdate) code here if you want to check and see what is possible. If you are wanting to know if a feature can be changed, you would check the Issues section to see if that has been already requested and either make a new feature request or you can ask about the possibility in the Linuxmint: Discussions on GitHub.

If kernels were not installed manually, one can use the Automatic Maintenance section (Update Manager > Preferences - Automation tab) to remove obsolete kernels and dependencies.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

Re: Update Manager -- Kernel Cleanup

Post by pgmer6809 »

Thanks for the reply. TBH I am not certain where to post this. I did not have a link to mintupdate on github.
This is more in the nature of a feature request so I suppose it belongs on the mintupdate repo, but is there a Mint forum for feature requests since one cant be expected to be able to guess the location of the source?

Also as regards the source I did go to the repo and download the zip but the one thing I can't find amidst all the customization and languages and .png files is the actual (I assume Python) code that does anything.
pgmer6809
User avatar
SMG
Level 25
Level 25
Posts: 31047
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Update Manager -- Kernel Cleanup

Post by SMG »

pgmer6809 wrote: Tue May 09, 2023 12:07 pmThis is more in the nature of a feature request so I suppose it belongs on the mintupdate repo, but is there a Mint forum for feature requests since one cant be expected to be able to guess the location of the source?
New ideas can go in the Linuxmint: Discussions on GitHub. If you go to that page, on the left under Categories is Ideas. The Ideas webpage indicates, "Share ideas for new features."
Image
A woman typing on a laptop with LM20.3 Cinnamon.
User avatar
Termy
Level 12
Level 12
Posts: 4254
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Update Manager -- Kernel Cleanup

Post by Termy »

pgmer6809 wrote: Sat May 06, 2023 12:55 pm [...]
Hi, unfortunately this is not reasonably possible. I believe the update-grub wrapper for grub-mkconfig(8) is set to run after the installation or removal of the relevant packages themselves, likely as part of the pre- and post-installation scripts. It's the same for generating an initramfs for each kernel, where appropriate. Since installing or removing a kernel directly requires that the bootloader be updated, you're poop out of luck, I'm afraid.

I see what you mean though. It's a drawback of the packaging system in general, but one I can't see being avoided. AFAIK, one package can't talk to another, otherwise it would be good if a package could see what other packages are enqueued, then hold off on things like updating GRUB until the last applicable package is done, at which point the post- stuff could kick in. Unfortunately, I'm not sure this is feasible with how packaging is handled in this packaging system, and I'm not sure it'd be worth implementing. If something went wrong before that end part, a user could end up with a mess.
I'm also Terminalforlife on GitHub.
Locked

Return to “Programming & Development”