Gentoo Archives: gentoo-user

From: David Shen <davidshen84@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Self created initramfs cannot work
Date: Mon, 29 Jun 2009 12:08:57
Message-Id: 53e35fd50906290508k5825c387vfce44c789937a45b@mail.gmail.com
In Reply to: Re: [gentoo-user] Self created initramfs cannot work by David Shen
1 my /init script is running now, but I got '/bin/sh: can't access tty;
2 job control turned off' error. I google a lot, and I think it would
3 relate with my HD. When this error occurs, I got a simple shell. I
4 tried 'lvm vgscan' in that shell, and it cannot find my lvm. I copied
5 my block devices with:
6 cp -a /dev/hda /usr/src/initramfs/dev
7 cp -a /dev/hda1 /usr/src/initramfs/dev
8 cp -a /dev/hda2 /usr/src/initramfs/dev
9
10 what I missed?
11
12
13 On Sat, Jun 27, 2009 at 8:55 PM, David Shen<davidshen84@××××××××××.com> wrote:
14 > thanks a lot
15 >
16 >
17 > On Sat, Jun 27, 2009 at 7:49 PM, Dirk Heinrichs<dirk.heinrichs@××××××.de> wrote:
18 >> Am Samstag 27 Juni 2009 10:25:11 schrieb David Shen:
19 >>
20 >>> yep, i'd like to learn from your script.
21 >>
22 >> OK, here you are.
23 >>
24 >>> BTW, I also put my initramfs into a separate partition /boot.
25 >>
26 >> Seems you misunderstood. I don't use an initramfs anymore, /boot _is_ my
27 >> initramfs replacement. Whatever you put into an initramfs can as well be put
28 >> into /boot.
29 >>
30 >> I've attached both set of scripts, just choose the one you like more.
31 >>
32 >> mkinitfs_script.tar.bz2 contains the script to put stuff to /boot, while
33 >> mkinitramfs_script.tar.bz2 contains the script to create an initramfs for use
34 >> inside the kernel (kernel+initramfs will be one file).
35 >>
36 >> In both cases, you should adapt the /etc/mkinit*fs/config file to your needs,
37 >> just adapt the list of executables you need/want in your init*fs and run the
38 >> desired script.
39 >>
40 >> The mkinitramfs.sh script will put everything into /usr/src/initramfs. You
41 >> should configure this in your kernel config so that the kernel build system can
42 >> create the image for you.
43 >>
44 >> The other one will put everything into /boot.
45 >>
46 >> Out of the box, the resulting fs will be suited for accessing / from a logical
47 >> volume which may optionally be encrypted using LUKS. The init script will find
48 >> out at boot time wether the LV is encrypted and will run cryptsetup to prompt
49 >> for a password.
50 >>
51 >> Finally, you need to adapt your bootloader, depending on which approach you
52 >> choose:
53 >>
54 >> initramfs: realroot=/dev/vg/root  (* NO root=, because that's the initramfs).
55 >>
56 >> initfs: You'll need both root=/dev/sda1, which should be your /boot, realroot=
57 >> as above and rw (this is important).
58 >>
59 >> BTW: Newer kernels also have a configuration option for this: CONFIG_CMDLINE.
60 >>
61 >> In case of further questions, just send a mail.
62 >>
63 >> Bye...
64 >>
65 >>        Dirk
66 >>
67 >
68 >
69 >
70 > --
71 > Best Regards,
72 > David Shen
73 >
74 > http://twitter.com/davidshen84
75 >
76
77
78
79 --
80 Best Regards,
81 David Shen
82
83 http://twitter.com/davidshen84

Replies

Subject Author
Re: [gentoo-user] Self created initramfs cannot work Dirk Heinrichs <dirk.heinrichs@××××××.de>