| View previous topic :: View next topic |
| Author |
Message |
D-LINC Tux's lil' helper

Joined: 31 Jan 2011 Posts: 131 Location: Alaska
|
Posted: Sat Oct 06, 2012 11:09 pm Post subject: Including genkernel initramfs in a static kernel |
|
|
Hey guys, I have a somewhat unusual situation: One of my Gentoo systems does not have a boot directory, but instead boots off a kernel on a cdrom. (I won't bore you with the story of why I have to do this.) The kernel is built as a static kernel (no loadable module support) and I include the initramfs directly in the kernel, through the field in menuconfig that allows me to specify the path to the initramfs to include. In the past I have not used genkernel for any of this, but instead I hand crafted my own initramfs, and then used "make menuconfig" and "make isoimage", and this worked well enough.
However, my hand-crafted initramfs has some issues, and I was hoping instead to use a proper initramfs built by some other program. My thought was to use "genkernel initramfs" to produce the initramfs (with LVM, RAID, and other special support that I need) and then just include this in the kernel like I did the handcrafted one. However, the kernel doesn't seem to be work with the initramfs produced by genkernel -- like there is some kind of file formatting issue. When I first tried to build the kernel, the build process immediately croaked and spit out a bunch of mangled error data complaining about not being able to read the initramfs file or something like that. I thought maybe it needed to be gzipped, so I gzipped the initramfs and tried again. This time, the kernel iso image successfully built, but when I tried to boot into the new kernel, it died with a kernel panic, and gave some kind of error about the "initramfs magic".
So, do I need to process the genkernel-produced initramfs first in some special way? _________________ frigidcode.com |
|
| Back to top |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1277
|
Posted: Mon Oct 08, 2012 6:05 am Post subject: |
|
|
D-LINC ...
I the option is INITRAMFS_SOURCE and can be a .cpio (uncompressed) or a directory containing the files to be included, I think at some point I too had issues when providing a cpio image, though I can't remember the circumstances exactly.
If your needs are one or more of the following: LVM, dmcrypt/LUKS, software RAID, Tuxonice, swsusp/uswsusp, rescue shell, then you might want to take a look at better-initramfs, the build process is simple, transparent, and configurable. Simply edit bootstrap/bootstrap-all.conf and define the features (above) you require, then run 'bootstrap/bootstrap-all && make prepare', 'sourceroot' would then be the directory to provide to INITRAMFS_SOURCE.
HTH & best ... khay |
|
| Back to top |
|
 |
|
|
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
|
|