Possible to install other kernels from unofficial repos through AKM?

I wondered if it would be possible to modify AKM in such a way for it to pick up on the other kernel repositories that the user adds to the /etc/pacman.conf.

1 Like

Thanks for the suggestion!
However, to be honest, that was not in my plans. :frowning:
And pacman/yay/paru provides an easy way to manage additional kernels.

Anyway, the source code is here:
https://github.com/endeavouros-team/PKGBUILDS/blob/master/akm/akm
so you could fork it and add support for other repos. The file currently contains only 378 lines of bash source code.

3 Likes

Thanks for taking your time to reply!

I realize that it was somewhat of “lazy wishing” on my part. You are of course right about pacman & co. for managing kernels as well.

And thanks for the link to the source code. Admittedly, at my current level of knowledge when it comes to coding, I doubt that I can wrap my head around it but I take it as a more long-term project and an incentive to learn more.

1 Like

The fastest way to learn code. Take code you basically know what it does and studying that existing working code. See if you can figure out what chunks of code does.

Pudge

2 Likes

It would be a pretty easy change I think.

Just replace the hard-coded list of kernels with something like:

pacman -Fl | grep "usr/lib/modules/.*pkgbase" | awk '{print $1}' | sort | uniq  

Does anything else have to change @manuel?

1 Like

Thanks @Pudge !
Nice piece of advice, I’ll keep it in mind.

2 Likes

Thank @dalto !

I am not at my EnOS machine right now to test. Do I need to make the change in the /usr/bin/akm? Will that then pick up automatically the kernels from the repos I add to /etc/pacman.conf?

1 Like

I haven’t tried it personally but it looks like you could just edit Main() in the script and change the way it sets kernels

I believe it will but I haven’t tested it so there is one way to find out. :smile:

1 Like

Sure. I’ll test it and report back! But I am afraid I cannot do it before tomorrow though. Thanks for the help and suggestion!

Made a small modification to AKM here:
https://raw.githubusercontent.com/endeavouros-team/sandbox/master/akm

If you add an experimental option -t, it should see available kernels from the additional repos you’ve configured (but no AUR).
Without that option it behaves like before.

So you could test it like this:

 wget https://raw.githubusercontent.com/endeavouros-team/sandbox/master/akm
 chmod +x ./akm
 ./akm -t

I didn’t test it with additional kernels, but I tested it by limiting the number of the official kernels, and that seemed to work.

Disclaimer: try this on your own risk! This is experimental, not well tested, and may contain bugs.

1 Like

The only problem with that is how do you guarantee that all the unofficial repos use the verbiage “kernel” and “modules” in the description?

Why not search for something that will be more likely to lead you to a kernel such as a file with the correct root containing “vmlinuz” or “pkgbase”. That is how the Arch hooks identify a kernel.

1 Like

That may be a problem, surely cannot rely on that.

Looks like Arch tools do not provide a reliable and easy way for finding kernels? If someone knows, please tell.

That’s why I made a new version of AKM (https://raw.githubusercontent.com/endeavouros-team/sandbox/master/akm) that should more reliably find kernels (by finding kernel headers first).

Your example with pacman -Fl requires having done pacman -Fy, and that latter requires root privileges which I’m trying to avoid.

Couldn’t find it, could you please tell which hook?

Off the top of my head you can look at 90-mkinitcpio-install.hook

That is what installs the kernels in /boot

Thanks.
However that doesn’t remove the need to have root permissions with pacman -Fy.

But do you see any issues with this approach for finding available kernels:

pacman -Sl | grep "^[^ ]* linux[^ ]*headers " | grep -Pv '^testing | linux-api-headers ' | awk '{print $2}' | sed 's|-headers||'

It looks for linux*headers packages and drops testing repo packages and an non-kernel package.

Just for your information - here is a listing of what shows up on Garuda when given that command:

kernel listing
┌11:56:38 WD= [~]
└───freebird@nest ─▶$ pacman -Sl | grep "^[^ ]* linux[^ ]*headers " | grep -Pv '^testing | linux-api-headers ' | awk '{print $2}' | sed 's|-headers||'
 
linux
linux-lts
linux-hardened
linux-zen
linux-lts-tkg-bmq
linux-lts-tkg-cfs
linux-lts-tkg-muqss
linux-lts-tkg-pds
linux-mainline
linux-next-git
linux-tkg-bmq-atom
linux-tkg-bmq-barcelona
linux-tkg-bmq-bobcat
linux-tkg-bmq-broadwell
linux-tkg-bmq-bulldozer
linux-tkg-bmq-cannonlake
linux-tkg-bmq-cascadelake
linux-tkg-bmq-cooperlake
linux-tkg-bmq-core2
linux-tkg-bmq-excavator
linux-tkg-bmq-goldmont
linux-tkg-bmq-goldmontplus
linux-tkg-bmq-haswell
linux-tkg-bmq
linux-tkg-bmq-icelake
linux-tkg-bmq-ivybridge
linux-tkg-bmq-jaguar
linux-tkg-bmq-k10
linux-tkg-bmq-k8
linux-tkg-bmq-k8sse3
linux-tkg-bmq-mpsc
linux-tkg-bmq-nehalem
linux-tkg-bmq-piledriver
linux-tkg-bmq-sandybridge
linux-tkg-bmq-silvermont
linux-tkg-bmq-skylake
linux-tkg-bmq-skylakex
linux-tkg-bmq-steamroller
linux-tkg-bmq-tigerlake
linux-tkg-bmq-westmere
linux-tkg-bmq-zen
linux-tkg-bmq-zen2
linux-tkg-cfs-atom
linux-tkg-cfs-barcelona
linux-tkg-cfs-bobcat
linux-tkg-cfs-broadwell
linux-tkg-cfs-bulldozer
linux-tkg-cfs-cannonlake
linux-tkg-cfs-cascadelake
linux-tkg-cfs-cooperlake
linux-tkg-cfs-core2
linux-tkg-cfs-excavator
linux-tkg-cfs-goldmont
linux-tkg-cfs-goldmontplus
linux-tkg-cfs-haswell
linux-tkg-cfs
linux-tkg-cfs-icelake
linux-tkg-cfs-ivybridge
linux-tkg-cfs-jaguar
linux-tkg-cfs-k10
linux-tkg-cfs-k8
linux-tkg-cfs-k8sse3
linux-tkg-cfs-mpsc
linux-tkg-cfs-nehalem
linux-tkg-cfs-piledriver
linux-tkg-cfs-sandybridge
linux-tkg-cfs-silvermont
linux-tkg-cfs-skylake
linux-tkg-cfs-skylakex
linux-tkg-cfs-steamroller
linux-tkg-cfs-tigerlake
linux-tkg-cfs-westmere
linux-tkg-cfs-zen
linux-tkg-cfs-zen2
linux-tkg-muqss-atom
linux-tkg-muqss-barcelona
linux-tkg-muqss-bobcat
linux-tkg-muqss-broadwell
linux-tkg-muqss-bulldozer
linux-tkg-muqss-cannonlake
linux-tkg-muqss-cascadelake
linux-tkg-muqss-cooperlake
linux-tkg-muqss-core2
linux-tkg-muqss-excavator
linux-tkg-muqss-goldmont
linux-tkg-muqss-goldmontplus
linux-tkg-muqss-haswell
linux-tkg-muqss
linux-tkg-muqss-icelake
linux-tkg-muqss-ivybridge
linux-tkg-muqss-jaguar
linux-tkg-muqss-k10
linux-tkg-muqss-k8
linux-tkg-muqss-k8sse3
linux-tkg-muqss-mpsc
linux-tkg-muqss-nehalem
linux-tkg-muqss-piledriver
linux-tkg-muqss-sandybridge
linux-tkg-muqss-silvermont
linux-tkg-muqss-skylake
linux-tkg-muqss-skylakex
linux-tkg-muqss-steamroller
linux-tkg-muqss-tigerlake
linux-tkg-muqss-westmere
linux-tkg-muqss-zen
linux-tkg-muqss-zen2
linux-tkg-pds-atom
linux-tkg-pds-barcelona
linux-tkg-pds-bobcat
linux-tkg-pds-broadwell
linux-tkg-pds-bulldozer
linux-tkg-pds-cannonlake
linux-tkg-pds-cascadelake
linux-tkg-pds-cooperlake
linux-tkg-pds-core2
linux-tkg-pds-excavator
linux-tkg-pds-goldmont
linux-tkg-pds-goldmontplus
linux-tkg-pds-haswell
linux-tkg-pds
linux-tkg-pds-icelake
linux-tkg-pds-ivybridge
linux-tkg-pds-jaguar
linux-tkg-pds-k10
linux-tkg-pds-k8
linux-tkg-pds-k8sse3
linux-tkg-pds-mpsc
linux-tkg-pds-nehalem
linux-tkg-pds-piledriver
linux-tkg-pds-sandybridge
linux-tkg-pds-silvermont
linux-tkg-pds-skylake
linux-tkg-pds-skylakex
linux-tkg-pds-steamroller
linux-tkg-pds-tigerlake
linux-tkg-pds-westmere
linux-tkg-pds-zen
linux-tkg-pds-zen2
linux-xanmod-anbox
linux-xanmod
linux-xanmod-lts

┌11:57:48 WD= [~]
└───freebird@nest ─▶$ 

Looks like it picks up most of the possibilities that I know of :grin:

1 Like

Thanks!
That’s useful. :smile:

I hope they all are kernels… :wink: :rofl:

At least it gives you an idea if the command behaves - and of how many it might have to deal with! Garuda was just a reboot away - and the repo in question runs on one of my older boxes…

I think they all are kernels - special builds for different Intel procs, looks like. The effort some go through to game :grin:

1 Like

I definitely think that is much better. I think it is worth trying to see if anyone has any issues with it.

1 Like

Thanks. I’ll just release the package (akm version 2.7.7-1) that uses this by default. I know it works with Arch official kernels, so most users should see no difference.

And if anyone notices problems with the new AKM, please report as soon as possible!
:sweat_smile:

Now it is released, and will be at the mirror near you soon!

4 Likes

Hi @manuel, @dalto and everybody!

Wow, there has been a whole lot of activities since I was logged in last. And a working solution! Congratulations! You are amazing guys!

I ran akm (2.7.7-1) in a terminal. It outputs some complaints first apparently for not having gathered enough information and then when the gathered information reaches 100% the akm’s window opens with all the available kernels, both from official and @jonathon's repo! Just one minor thing: the window is not resizable in height only in width as you can see from the picture below.

But again, thanks to you all who have taken your time and made this work.

EDIT

There seems to be something not quite right. Choosing to install kernels from the extra repo and clicking on the execute button, closes the window

EDIT2

Nevermind. It all works great. I had another repo in the pacman.conf with linux-lts54. I guess that caused the abortion of the installation process. After disabling the other repo everything works great!

1 Like