Mr. Root wrote:
> Venkat Venkataraju wrote:
>
>> I used to compile my kernels manually. But genkernel creates initrd
>> which i dont know how to make one manually.
>
>
> I had the same problem until someone explained to me that for the most
> part you don't need an initrd. initrd "is a RAM disk that is initialized
> (e.g. loaded) by the boot loader before the kernel is started." Unless
> you're booting to a scsi drive then initrd isn't needed.
Not quite for that last sentence... more in a bit. (initrd is the main
topic for my post here, just a little background.)
> Genkernel 3.x is still new and has some problems. Once you manually
> build a kernel (which is very simple) you'll never look back again.
Oh so true. Manually configuring your kernel gives you that extra bit of
control (and optimisation) of your system(s). You also learn more than
(just) 'genkernel'.
> Here's a simplified step by step guide:
>
> Make sure /boot is mounted. running 'mount /boot' if it isn't.
>
> cd /usr/src/linux
> This of course drops you into your source directory.
>
> make menuconfig
> This will open the kernel configuration utility and select whatever
> options you had selected previously. Go through the menus and see if you
> want to make some changes. When done hit esc until you're asked if you
> want to save your changes. Say yes.
>
> make dep && make bzImage modules modules_install
This is just an aside but I usually
make dep && make clean bzImage modules modules_install
just for that extra clean feeling (okay, rogue modules get cleaned from
/lib/modules/, helps sometimes with modules-update errors).
> The build begins.
>
> cp arch/i386/boot/bzImage /boot/kernel-2.4.22-test
> Insert your kernel version.
>
> cp System.map /boot/System.map-2.4.22-test
> Again, insert your kernel version.
>
> cp .config /boot/config-2.4.22-test
> Once again, your kernel version. This just backs up you kernel
> configuration file (/usr/src/linux/.config).
>
> modules-update
> Updates /etc/modules.conf.
>
> nano -w /boot/grub/grub.conf
> Add the following:
>
> title=Gentoo Linux 2.4.22-test
> # Partition where the kernel image (or operating system) is located
> root (hd0,0)
> kernel (hd0,0)/kernel-2.4.22-test root=/dev/hda3
>
> Notice the lack of an initrd? Unless you need a driver loaded _before_
> the kernel, initrd isn't needed. Save and exit.
Here we are, about initrd. initrd is an initial ramdisk (compressed
image) that gets passed to the kernel before its boot-up sequence.
initrd decomresses the image and the kernel then loads it as the
(initial) root partition.
It is useful for storage/loading modules before the root partition (or
more precisely /lib/modules/) is available. So for example it is useful
for loading lvm or reiserfs if your root partition needs that. Or a raid
or scsi driver if it needs that.
Now I hear you ask, why not just compile those modules into the kernel?
Well, here is where initrd comes into its own. You can compile one
kernel for many machines with different hardware and just customise the
initial ramdisk image. This means that only the specific modules that a
machine needs to boot will be saved onto the /boot/ partition (most
useful when space is limited).
So in short, there isn't much advantage to an initrd *unless* you're
building a kernel for multiple computers. So as Mr Root wrote, you don't
really need to know how to make an initrd (just yet

).
> That's it. Reboot and enjoy. If your new kernel fails (because of the
> options selected) just reboot, go back to the last working one and
> change some options. The first one is the toughest but after a little
> while you'll be building custom kernels for different things (like
> gaming or video compression).
>
> Good luck and please post your results to the tread.
And GL from me. Enjoy!
--
Ben M.
----------------
What are Software Patents for?
To protect the small enterprise from bigger companies.
What do Software Patents do?
In its current form, they protect only companies with
big legal departments as they:
a.) Patent everything no matter how general
b.) Sue everybody. Even if the patent can be argued
invalid, small companies can ill-afford the
typical $500k cost of a law-suit (not to mention
years of harassment).
Don't let them take away your right to program
whatever you like. Make a stand on Software Patents
before its too late.
Read about the ongoing battle at
http://swpat.ffii.org/
----------------