1 |
On Monday, August 15, 2016 04:32:29 AM Rich Freeman wrote: |
2 |
> On Mon, Aug 15, 2016 at 4:10 AM, J. Roeleveld <joost@××××××××.org> wrote: |
3 |
> > The ones created by genkernel or dracut always need a few iterations |
4 |
> > before |
5 |
> > they work semi-reliably and are not flexible enough. |
6 |
> > I have 2 disks in my laptop. Both are encrypted using LUKS and the same |
7 |
> > passphrase. Neither genkernel nor dracut have the intelligence to ask me |
8 |
> > once and try the key on both, only asking for a 2nd key when the provided |
9 |
> > one doesn't work for both. |
10 |
> > |
11 |
> > I ended up writing my own, which has proven more reliable and stable. The |
12 |
> > reduced size also makes maintenance less of an issue. |
13 |
> |
14 |
> Nothing wrong with this if you know what you're doing. Dracut is |
15 |
> designed to be one-size-fits-all with a lot of logic to figure out |
16 |
> what your system needs to boot. |
17 |
> |
18 |
> It is also somewhat dependent on a correct fstab. Don't take that for |
19 |
> granted: the kernel doesn't look at fstab at all when mounting root, |
20 |
> and neither do most of the other tools, so if your root partition |
21 |
> isn't correctly defined in fstab you might never know it and dracut |
22 |
> will get confused. If nothing else once it does have it correctly |
23 |
> mounted it will read fstab and then mess it up when it re-mounts root |
24 |
> per "your" instructions. |
25 |
|
26 |
I understand what you're saying. Except in my case, that wasn't the cause. |
27 |
|
28 |
> If you just need to tweak dracut behavior you may be better off with a |
29 |
> dracut module. They're just shell scripts and pretty simple to write. |
30 |
> That lets you tweak something at some point during boot without having |
31 |
> to build the entire thing yourself. |
32 |
|
33 |
This actually had (or has, not bothered to check current status) a distinct |
34 |
lack of usable documentation. Looking for clear howto's on creating my own |
35 |
(embedded into the kernel) initramfs was a lot quicker. |
36 |
|
37 |
> And since it uses udev it is fairly robust against things like adding |
38 |
> a drive and now the kernel re-letters everything. |
39 |
|
40 |
If I were using normal partitioning, I wouldn't need an initramfs. |
41 |
|
42 |
> If you tweak it to use the same password for all drives I wouldn't be |
43 |
> surprised if upstream accepts the patch... |
44 |
|
45 |
If it were properly documented where it does this, I would be willing to try. |
46 |
Right now, my init-script is 45 lines (including white-space) |
47 |
|
48 |
My laptop has 2 disks. Both are fully encrypted (apart from a small /boot). |
49 |
On top of the encrypted parts I have LVM, which contains my partitions. |
50 |
|
51 |
It asks for a password, decrypts both drives, enables LVM, checks if it needs |
52 |
to resume from "suspend to disk", if not, mounts the partitions and boots. If |
53 |
it does need to resume, it simply resumes. |
54 |
If it fails anywhere, it drops me into a busybox shell. |
55 |
|
56 |
I can then simply "cat" the init script to see what commands I need to run to |
57 |
boot, replacing anything that is no longer valid. |
58 |
|
59 |
With dracut and genkernel, the init-script is too convoluted to simply follow. |
60 |
Which means it is not allowed to fail. |
61 |
|
62 |
-- |
63 |
Joost |