Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Using prebuilt kernel binaries from other distro
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Kresp
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2016
Posts: 77

PostPosted: Mon Sep 19, 2022 12:41 pm    Post subject: [SOLVED] Using prebuilt kernel binaries from other distro Reply with quote

I need advice on how to use prebuilt kernel binaries on Gentoo.

I'm troubleshooting VFIO issue and want to try Ubuntu kernel. (I'm having issues with new GPU, and it supposedly works on Ubuntu out of the box, so I want to trying it without installing the distro.)

Process I use for installing new gentoo-sources kernel is something like this:
# emerge gentoo-sources:5.X.X
# eselect ..
# cd /usr/src/linux
# make oldconfig
# make -j X
# make install
# make modules_install
# genkernel --install initramfs && grub-mkconfig -o /boot/grub/grub.cfg

After downloading and extracting linux-image-unsigned and linux-modules .deb packages, how do I install it to boot into it?
As simple as move the kernel to /boot, modules to /lib/modules, and regenerate initframfs and update grub config?

----------------

Tried that. Kernel panics on boot with "not syncing: VFS: Unable to mount root fs on unknown-block".
Initramfs is missing, so I generated one with
# cd /lib/modules/5.19.5-051905-generic/
# depmod -a 5.19.5-051905-generic
# cd boot
# dracut initramfs 5.19.5-051905-generic

Now it drops to motherboard UEFI splash screen after kernel boot, and nothing happens afterwards, PC seemingly just hangs.

[Moderator edit: Moved poster's self-response into main post, then deleted that self-response to return the thread to the unanswered list.

OP: Generally, if post length permits, you should edit extra information into your first post instead of replying to it. Some users run a canned search for threads with zero replies as a way of finding posts to answer. When you replied to yourself, you removed your thread from that list, even though you were not replying to announce that the thread was solved. Thus, they would no longer see your thread on the list of unanswered threads.
-Hu]


Last edited by Kresp on Wed Sep 21, 2022 12:54 am; edited 1 time in total
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1535

PostPosted: Mon Sep 19, 2022 3:09 pm    Post subject: Reply with quote

That might or might not work.
An option is to use Ubuntu's config to build your kernel, but have you tried gentoo-kernel-bin instead?

Regards,
Georgi
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Mon Sep 19, 2022 3:52 pm    Post subject: Reply with quote

Kresp,

Quote:
After downloading and extracting linux-image-unsigned and linux-modules .deb packages, how do I install it to boot into it?
As simple as move the kernel to /boot, modules to /lib/modules, and regenerate initframfs and update grub config?


You cannot regenerate the initrd, as it all needs to match the kernel and you don't have sources.
You need the initrd that matches the kernel *.deb.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3137

PostPosted: Mon Sep 19, 2022 10:28 pm    Post subject: Reply with quote

You can just copy ubuntu's kernel, initramfs and modules over. Ubuntu's initramfs are terribly bloated, so there is a good chance your system will accidentally boot just fine without any further changes required.
Hell, I'm about to do something similar here, just to test a few things.

You can also use ubuntu's config to build your own kernel too, just zcat /proc/config.gz > /usr/src/linux/.config
and then build it with oldconfig. Genkernel and "manual" make are both capable of accepting a config from a different version and using it as a template.
Fortunately, they do include config in kernel. I made the mistake of not doing it once and it haunts me to this day.
Back to top
View user's profile Send private message
Kresp
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2016
Posts: 77

PostPosted: Wed Sep 21, 2022 12:53 am    Post subject: Reply with quote

Turns out, dracut just named initramfs incorrectly by default, so grub-mkconfig didn't pick it up.
I just added the initrd line in grub.cfg with the right filepath, and Ubuntu kernel booted nicely.
There was some problem with it picking up the right modules, though. But I didn't need many drivers to test what I needed, so it's fine.


Thanks, everyone, you were very helpful.

Marking as solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum