Page 1 of 2

Update Manager not showing 4.17 kernel in list of kernels

Posted: Fri Jul 13, 2018 11:45 pm
by Nick Payne
I just updated from Mint 18.3 to Mint 19 (reformat and clean install). I've installed the 2.17.5 kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17.5/ and booted it, but when I run Update Manager and select "Linux Kernels" from the View menu, only the 4.15 kernels appear. I also had the 2.17 kernel installed and running on 18.3, and the Update Manager in that version *did* show the 2.17 kernels installed from the same location when asked to show Linux Kernels. Here's a couple of screen grabs from Mint 19, showing the running kernel and the Kernels dialog box in Update Manager:

Code: Select all

nick@nick-mint:~$ uname -a
Linux nick-mint 4.17.5-041705-generic #201807081431 SMP Sun Jul 8 14:33:41 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
kernels.png

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 12:22 am
by smurphos
I'm guessing this is something to do with package format - the current 4.15 ubuntu supported kernels are delivered to mint as 5 packages - ubuntu have made a lot of changes here recently and mintupdate was adapted to deal with them. It looks like the mainline kernel builds are based on 4 packages.

Which packages did you install in total for 4.17.5? Please post back the output of dpkg -l | grep "linux\-[a-z]*\-"


You are not the first to notice this - https://github.com/linuxmint/mintupdate/issues/356

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 2:16 am
by trytip
it will only show up if you use ukuu

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 2:20 am
by smurphos
trytip wrote:
Sat Jul 14, 2018 2:16 am
it will only show up if you use ukuu
Manually installed mainline kernels used to show in update manager prior to the fixes applied to mintupdate to support the new 4.15 kernel packaging conventions. I'm pretty sure the underlying issue is that current mintupdate doesn't recognise the mainline package naming format linux-image-unsigned-$version$-generic

Mintupdate appears to be looking for the format linux-image-$version$-generic.

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 2:33 am
by trytip
it was easier for me to use ukuu then try to figure out which mainline files i needed. ukuu did it all with no issues. i made a big ooopsy while ukuu was installing 4.17.5 i wanted to copy that format , but as soon as i hit ctrl+c to copy :lol: the ukuu terminal command said Error: something dpkg. my brain was not working ctrl+c aborts any and most operations in terminal. it was able to remove and install again. good idea not to play with the keyboard while terminal is doing surgery

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 3:08 am
by smurphos
Does ukuu handle mainline kernel removal as well?

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 3:30 am
by gm10
smurphos wrote:
Sat Jul 14, 2018 2:20 am
trytip wrote:
Sat Jul 14, 2018 2:16 am
it will only show up if you use ukuu
Manually installed mainline kernels used to show in update manager prior to the fixes applied to mintupdate to support the new 4.15 kernel packaging conventions. I'm pretty sure the underlying issue is that current mintupdate doesn't recognise the mainline package naming format linux-image-unsigned-$version$-generic

Mintupdate appears to be looking for the format linux-image-$version$-generic.
Basically that, it doesn't handle unsigned Ubuntu kernels in the repos, either. In fact it is hardcoded to look at only package names starting with "linux-image-3" or "linux-image-4". It's a rather limited piece of code in that regard.

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 3:34 am
by smurphos
gm10 wrote:
Sat Jul 14, 2018 3:30 am
Basically that, It doesn't handle unsigned Ubuntu kernels in the repos, either. In fact it is hardcoded to look at only packages starting with "linux-image-3" or "linux-image-4". It's a rather limited piece of code in that regard.
Thank-you gm10 - that explains why my attempt this morning to locally patch mint-update to fix this didn't work....time to try again.

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 3:39 am
by gm10
smurphos wrote:
Sat Jul 14, 2018 3:34 am
gm10 wrote:
Sat Jul 14, 2018 3:30 am
Basically that, It doesn't handle unsigned Ubuntu kernels in the repos, either. In fact it is hardcoded to look at only packages starting with "linux-image-3" or "linux-image-4". It's a rather limited piece of code in that regard.
Thank-you gm10 - that explains why my attempt this morning to locally patch mint-update to fix this didn't work....time to try again.
It's a few files you'll need to patch, checkKernels.py, kernelwindow.py and Classes.py at first glance.

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 4:09 am
by smurphos
Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 4:57 am
by gm10
smurphos wrote:
Sat Jul 14, 2018 4:09 am
Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)
That's simple to fix though, in checkKernels.py just skip all unsigned ones that are not flagged as installed, should cover all use cases.

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 5:30 am
by Pjotr
Why do you want to run an unsupported kernel in the first place? :shock:

Furthermore, UKUU kernels are only meant for testing and aren't fit for normal use:
https://sites.google.com/site/easylinux ... e-Utility-
(item 6.3.2, right column)

Finally: it's 4.17, not 2.17. You might want to fix your topic title and first message.

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Sat Jul 14, 2018 5:58 am
by Moem
Pjotr wrote:
Sat Jul 14, 2018 5:30 am
Finally: it's 4.17, not 2.17. You might want to fix your topic title and first message.
That explains a lot... Silly me, for always assuming that people mean to write what they end up writing. :?

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Wed Aug 15, 2018 4:06 pm
by gm10
smurphos wrote:
Sat Jul 14, 2018 4:09 am
Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)
Reviving this because I just had a moment to look into this, turned out to be simpler than I had initially thought:

This patch is for mintupdate/tara 5.4.0 and adds installed mainline kernels to the list. Obviously you can only remove them, not install them with this, this doesn't turn it into ukuu.

edit: patch removed since I put a more comprehensive version on github with a pull request to the mint repo

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Wed Aug 15, 2018 5:16 pm
by Resistor
gm10 wrote:
Wed Aug 15, 2018 4:06 pm
smurphos wrote:
Sat Jul 14, 2018 4:09 am
Yep - limited success with my limited python knowledge - I can display all unsigned kernels (including the 4.15 ones) or none at all. It doesn't look pretty.... :roll: I might come back to this if I decide I need a challenge and the issue hasn't been properly patched already. it wasn't on my to do list.... :)
Reviving this because I just had a moment to look into this, turned out to be simpler than I had initially thought, only needed a small patch to one file:

Code: Select all

--- /usr/lib/linuxmint/mintUpdate/checkKernels.py
+++ checkKernels.py
@@ -15,14 +15,17 @@
     if settings.get_boolean("use-lowlatency-kernels"):
         kernel_type = "-lowlatency"
     cache = apt.Cache()
+    signed_kernels = ['']
     for pkg in cache:
         installed = 0
         used = 0
         installable = 0
         pkg_version = ""
         package = pkg.name
-        if (package.startswith("linux-image-3") or package.startswith("linux-image-4")) and package.endswith(kernel_type):
-            version = package.replace("linux-image-", "").replace("-generic", "").replace("-lowlatency", "")
+        if (package.startswith("linux-image-3") or package.startswith("linux-image-4") or package.startswith("linux-image-unsigned-3") or package.startswith("linux-image-unsigned-4")) and package.endswith(kernel_type):
+            version = package.replace("linux-image-unsigned-", "").replace("linux-image-", "").replace("-generic", "").replace("-lowlatency", "")
+            if version in signed_kernels:
+                continue
             if pkg.is_installed:
                 installed = 1
                 pkg_version = pkg.installed.version
@@ -43,6 +46,9 @@
                     element = "0%s" % element
                 versions.append(element)
 
+            if 'unsigned' not in pkg.name: # probably don't need this check, they should be sorted alphabetically
+                signed_kernels.append(version)
+
             resultString = "KERNEL###%s###%s###%s###%s###%s###%s" % (".".join(versions), version, pkg_version, installed, used, installable)
             print(resultString.encode("utf-8").decode('ascii', 'xmlcharrefreplace'))
 
This patch is for mintupdate/tara 5.4.0 and adds installed mainline kernels to the list. Obviously you can only remove them, not install them with this, this doesn't turn it into ukuu.

mintUpdate-kernels.png

One more thing to check off the list. ;)

PS: I probably better clarify for the uninitiated: patches like the one I posted can be applied with patch, don't just copy & paste it into a terminal.
Would it be practical to paste that content directly to:
/usr/lib/linuxmint/mintUpdate/checkKernels.py .?

Assuming with elevated privileges....

Re: Update Manager not showing 2.17 kernel in list of kernels

Posted: Wed Aug 15, 2018 5:43 pm
by gm10
Resistor wrote:
Wed Aug 15, 2018 5:16 pm
Would it be practical to paste that content directly to:
/usr/lib/linuxmint/mintUpdate/checkKernels.py .?

Assuming with elevated privileges....
Very much not so, no.

edit: Instructions added to post above

Re: Update Manager not showing 4.17 kernel in list of kernels

Posted: Wed Aug 15, 2018 5:51 pm
by Resistor
I'm glad I asked, since I'm among the uninitiated.

Thank you, gm10.

Re: Update Manager not showing 4.17 kernel in list of kernels

Posted: Thu Aug 16, 2018 4:51 am
by gm10
edit: removed, see below

Re: Update Manager not showing 4.17 kernel in list of kernels

Posted: Fri Aug 17, 2018 1:54 am
by smurphos
gm10 wrote:
Thu Aug 16, 2018 4:51 am
Then just apply the updated patch, I added instructions to the post this time.
Any intention to submit your patch as a Pull Request?

Re: Update Manager not showing 4.17 kernel in list of kernels

Posted: Fri Aug 17, 2018 3:18 am
by gm10
smurphos wrote:
Fri Aug 17, 2018 1:54 am
gm10 wrote:
Thu Aug 16, 2018 4:51 am
Then just apply the updated patch, I added instructions to the post this time.
Any intention to submit your patch as a Pull Request?
Maybe. It's just a quick hack. I'm not sure I'd call it release quality yet. I guess I'd have to at least detect locally installed kernels and not display the 3 links to ubuntu below them. Might do that eventually. edit: Nvm, did: https://github.com/linuxmint/mintupdate/pull/383 - as you can see that involved a few more changes... Anyway, up to the Mint devs now.
um-kernels2.png