Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Moving from Gen kernel to manual kernels
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Foszoe
n00b
n00b


Joined: 08 Mar 2016
Posts: 6

PostPosted: Tue Mar 08, 2016 8:23 pm    Post subject: Moving from Gen kernel to manual kernels Reply with quote

Until this install on my laptop, I had always used manual kernel builds. Because I wanted a quicker start up, I went with Genkernel. Then . I built a manual kernel to begin streamlining for my specific computer using the configuration file from the genkernel.

Is there a way to get my manual kernel to run without calling the initramfs?
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1156

PostPosted: Tue Mar 08, 2016 8:47 pm    Post subject: Reply with quote

Yes. There is even way to get genkernel to work without initramfs.
The fact that genkernel builds one for you doesn't mean you must use it. Just remove it from bootloader's config to skip that part. Well, actually you will likely have to change a few other options too, but the most important part it root=<device> and init=<init script>.

Of course, if you don't want to use initramfs, your actual root must contain all files needed for system init. And it must be understandable by bootloader. This means no encryption, no lvm, no raid, nothing but plain disk with plain partition table and at most the optional parts like /home, /opt, /var and swap split out to other drives. And all necessary things must be built in kernel directly, and not as loadable modules. Like disk drive controller driver for example.

Btw, the most funny part is you can copy .config from genkernel and use it to build another kernel manually. It will work just as fine, though it won't create initramfs for you in the process.
Back to top
View user's profile Send private message
Tony0945
Veteran
Veteran


Joined: 25 Jul 2006
Posts: 1361

PostPosted: Wed Mar 09, 2016 1:14 am    Post subject: Reply with quote

szatox wrote:
Btw, the most funny part is you can copy .config from genkernel and use it to build another kernel manually. It will work just as fine, though it won't create initramfs for you in the process.


Yes, that's what I did. As I recall, there is a kernel config item where you specify if there is an initramfs. Your video card driver should not be built in directly but remain as a module because X11 expects it to be a module. Just be sure there is framebuffer support built in directly. That's all that's needed before X.
Back to top
View user's profile Send private message
Foszoe
n00b
n00b


Joined: 08 Mar 2016
Posts: 6

PostPosted: Sun Mar 13, 2016 10:28 pm    Post subject: Reply with quote

When grub sees an initramfs, does it add it to every kernel it finds in the /boot directory when it writes grub.cfg?

If so is it a matter of commenting it out or is there a more elegant method to handle it?

I have a simple /ext4 with /swap install. Is there any advantage to having a initramfs for me?

can multiple kernels use the same initramfs when the .config for each kernel is different?

Thanks for any assistance in helping me understand these two items.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1156

PostPosted: Mon Mar 14, 2016 7:11 pm    Post subject: Reply with quote

Quote:
When grub sees an initramfs, does it add it to every kernel it finds in the /boot directory when it writes grub.cfg?
At my system every time I update kernel, grub legacy copies the current default and replaces name/label and paths to kernel and initramfs (leaving all other params the way they were)
It doesn't change any already existing entries.

Quote:
I have a simple /ext4 with /swap install. Is there any advantage to having a initramfs for me?
Never heard of those mountpoints. Neither swap nor root on a physical drive requires initramfs though.
Quote:
can multiple kernels use the same initramfs when the .config for each kernel is different?
Yes. Whether or not kernel can be used with initramfs depends on modules it needs. If you _need_ some kernel modules before root is accessible, you _must_ put them in your initramfs. Version of the modules must match kernel's version.
However, in most cases you can compile this code statically into the kernel instead of making them as modules. In this case kernel does not need modules from initramfs, so it will work whether the initramfs contains valid modules or not. And it would also work without initramfs at all, unless you need some userland tools (like lvm)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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