Am Samstag 27 Juni 2009 10:25:11 schrieb David Shen:

> yep, i'd like to learn from your script.

OK, here you are.

> BTW, I also put my initramfs into a separate partition /boot.

Seems you misunderstood. I don't use an initramfs anymore, /boot _is_ my 
initramfs replacement. Whatever you put into an initramfs can as well be put 
into /boot.

I've attached both set of scripts, just choose the one you like more.

mkinitfs_script.tar.bz2 contains the script to put stuff to /boot, while 
mkinitramfs_script.tar.bz2 contains the script to create an initramfs for use 
inside the kernel (kernel+initramfs will be one file).

In both cases, you should adapt the /etc/mkinit*fs/config file to your needs, 
just adapt the list of executables you need/want in your init*fs and run the 
desired script.

The mkinitramfs.sh script will put everything into /usr/src/initramfs. You 
should configure this in your kernel config so that the kernel build system can 
create the image for you.

The other one will put everything into /boot.

Out of the box, the resulting fs will be suited for accessing / from a logical 
volume which may optionally be encrypted using LUKS. The init script will find 
out at boot time wether the LV is encrypted and will run cryptsetup to prompt 
for a password.

Finally, you need to adapt your bootloader, depending on which approach you 
choose:

initramfs: realroot=/dev/vg/root  (* NO root=, because that's the initramfs). 

initfs: You'll need both root=/dev/sda1, which should be your /boot, realroot= 
as above and rw (this is important).

BTW: Newer kernels also have a configuration option for this: CONFIG_CMDLINE.

In case of further questions, just send a mail.

Bye...

        Dirk

Attachment: initfs_script.tar.bz2
Description: application/bzip-compressed-tar

Attachment: initramfs_script.tar.bz2
Description: application/bzip-compressed-tar

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to