1 |
Dale wrote: |
2 |
|
3 |
> Jack Byer wrote: |
4 |
>> Dale wrote: |
5 |
>> |
6 |
>>> Did you use a howto for Dracut? If so, have a link you could post? I |
7 |
>>> tried making a init thingy and after about 20 failed reboots, I scraped |
8 |
>>> the idea. I was trying to follow the howto on the Gentoo wiki I think. |
9 |
>>> The unofficial wiki. |
10 |
>>> |
11 |
>> I had some difficulties because the way I was doing things before with my |
12 |
>> homebrew solution was... non-standard. |
13 |
>> |
14 |
>> The problem areas that I remember from the transition were: setting the |
15 |
>> USE flags correctly to build the modules I needed, initially confusing |
16 |
>> dracutmodules and add_dracutmodules in dracut.conf (actually you probably |
17 |
>> don't even need to edit that file at all), making sure to have a sane |
18 |
>> /etc/fstab line for the root file system and passing the right root= |
19 |
>> kernel command line. root=UUID=... works the best in my experience. |
20 |
>> |
21 |
>> |
22 |
>> |
23 |
> |
24 |
> |
25 |
> I did change the USE flags for the packages it said to. I think some |
26 |
> things have changed or something, maybe openrc?, and the script I was |
27 |
> copying and working with just didn't work. Maybe it needs updating or |
28 |
> something. I'm hoping to see a up-to-date howto or someone will post a |
29 |
> good up-to-date howto for dracut. Something even a idiot could follow. |
30 |
> I think it will work for me then. lol |
31 |
> |
32 |
> Dale |
33 |
> |
34 |
> :-) :-) |
35 |
|
36 |
> |
37 |
I can tell you how mine is set up. |
38 |
|
39 |
emerge -v dracut |
40 |
|
41 |
These are the packages that would be merged, in order: |
42 |
|
43 |
[ebuild R ~] sys-kernel/dracut-013-r2 USE="-debug (-selinux)" |
44 |
DRACUT_MODULES="btrfs crypt lvm -biosdevname -caps -crypt-gpg -dmraid - |
45 |
dmsquash-live -gensplash -iscsi -livenet -mdraid -multipath -nbd -nfs - |
46 |
plymouth -syslog -xen" 0 kB |
47 |
|
48 |
I don't use any of the other modules so all I enable are btrfs, crypt and |
49 |
lvm. |
50 |
|
51 |
/etc/dracut.conf has no changes from the default except for the line: |
52 |
|
53 |
add_dracutmodules+="crypt dm lvm" |
54 |
|
55 |
but I'm about 80% sure even that isn't necessary and you could just leave |
56 |
the default values alone. One of these days I'll get around to testing that. |
57 |
|
58 |
I make an initramfs with the following command: |
59 |
|
60 |
dracut --lzma <hostname>.dracut.lzma <kernel version> |
61 |
|
62 |
(obviously change --lzma to whatever type of compression your kernel |
63 |
expects |
64 |
to use and name the file whatever you want. Make sure to include the kernel |
65 |
version just like it appears in your /lib/modules/ directory so that dracut |
66 |
includes the correct kernel modules) |
67 |
|
68 |
Then I make grub.conf look something like this: |
69 |
|
70 |
root (hd0,0) |
71 |
kernel /<hostname> root=UUID=08b00d7f-b633-4c03-98fe-dd5942a8fb7e |
72 |
initrd /<hostname>.dracut.lzma |
73 |
|
74 |
I like to name my kernels and initramfs files by the hostname of the |
75 |
computer since I have three that I manage but use whatever you want and |
76 |
just |
77 |
make sure you put the right filenames in grub.conf. |
78 |
|
79 |
You can obtain the UUID of your root filesystem by a number of methods, but |
80 |
the easiest is to use ls -l /dev/disks/by-uuid/ |
81 |
|
82 |
That's really all there is to it. Dracut will boot up and load the modules |
83 |
it is compiled with and search through the disks, logical volumes, and |
84 |
dmcrypt containers until it finds a filesystem with the UUID you specify. |
85 |
Once it finds the root filesystem it mounts it with whatever options you've |
86 |
specified in /etc/fstab and then hands control over to OpenRC. |
87 |
|
88 |
If it has the necessary modules (kernel and dracut) and you pass the right |
89 |
root= option then it Just Works. |