1 |
Am Samstag 27 Juni 2009 10:25:11 schrieb David Shen: |
2 |
|
3 |
> yep, i'd like to learn from your script. |
4 |
|
5 |
OK, here you are. |
6 |
|
7 |
> BTW, I also put my initramfs into a separate partition /boot. |
8 |
|
9 |
Seems you misunderstood. I don't use an initramfs anymore, /boot _is_ my |
10 |
initramfs replacement. Whatever you put into an initramfs can as well be put |
11 |
into /boot. |
12 |
|
13 |
I've attached both set of scripts, just choose the one you like more. |
14 |
|
15 |
mkinitfs_script.tar.bz2 contains the script to put stuff to /boot, while |
16 |
mkinitramfs_script.tar.bz2 contains the script to create an initramfs for use |
17 |
inside the kernel (kernel+initramfs will be one file). |
18 |
|
19 |
In both cases, you should adapt the /etc/mkinit*fs/config file to your needs, |
20 |
just adapt the list of executables you need/want in your init*fs and run the |
21 |
desired script. |
22 |
|
23 |
The mkinitramfs.sh script will put everything into /usr/src/initramfs. You |
24 |
should configure this in your kernel config so that the kernel build system can |
25 |
create the image for you. |
26 |
|
27 |
The other one will put everything into /boot. |
28 |
|
29 |
Out of the box, the resulting fs will be suited for accessing / from a logical |
30 |
volume which may optionally be encrypted using LUKS. The init script will find |
31 |
out at boot time wether the LV is encrypted and will run cryptsetup to prompt |
32 |
for a password. |
33 |
|
34 |
Finally, you need to adapt your bootloader, depending on which approach you |
35 |
choose: |
36 |
|
37 |
initramfs: realroot=/dev/vg/root (* NO root=, because that's the initramfs). |
38 |
|
39 |
initfs: You'll need both root=/dev/sda1, which should be your /boot, realroot= |
40 |
as above and rw (this is important). |
41 |
|
42 |
BTW: Newer kernels also have a configuration option for this: CONFIG_CMDLINE. |
43 |
|
44 |
In case of further questions, just send a mail. |
45 |
|
46 |
Bye... |
47 |
|
48 |
Dirk |