Gentoo Archives: gentoo-user

From: Michael Mair-Keimberger <m.mairkeimberger@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] difficulties with lvm2+systemd+grub2
Date: Wed, 12 Nov 2014 09:48:25
Message-Id: 20141112094228.GD25089@getafix
In Reply to: Re: [gentoo-user] difficulties with lvm2+systemd+grub2 by wraeth@wraeth.id.au
1 On Wed, Nov 12, 2014 at 12:03:04PM +1100, wraeth@×××××××××.au wrote:
2 > On Tue, Nov 11, 2014 at 09:56:09PM +0100, Michael Mair-Keimberger wrote:
3 > > Today I've started to play around with systemd but so far I couldn't get
4 > > it to boot. I've followed the how to from the gentoo wiki [1], but I
5 > > stuck somehow.
6 >
7 > I found systemd to be rather tricky to implement on some of my systems,
8 > but this was a while ago and was in a more complex configuration that
9 > you're using (though as most people are suggesting, I used dracut to
10 > generate my initrd).
11 >
12 > I would also suggest to use either dracut or genkernel-next to generate
13 > an initramfs if you wanted to go down that path. Note that
14 > sys-kernel/genkernel (as opposed to sys-kernel/genkernel-next) can have
15 > issues with systemd (the last time I tried it it complained about
16 > systemd and suggested using genkernel-next).
17 >
18 > If you would prefer a hand-rolled one, I can't offer much, but as I
19 > think has already been suggested, one key point is to call the correct
20 > binary.
21 >
22 > The systemd binary itself is /usr/lib/systemd/systemd, though calling
23 > /sbin/init may work if that's configured in such a way as to launch
24 > systemd.
25 >
26 Thanks for the detailed explanation.
27 I wasn't specific enough on the genkernel part. I already used
28 genkernel-next for generating the initramfs (which doesn't boot).
29 However i'll give dracut a try, I guess if it works i still can extract
30 dracut's initramfs and see what exaclty it does in order to boot with
31 systemd. Maybe i could adopt that to my custom one as well.
32
33
34 > The other point I might add is that my system, which uses dracut, has
35 > systemd launched with some specific arguments:
36 >
37 > ps -fp 1
38 > UID PID PPID C STIME TTY TIME CMD
39 > root 1 0 0 11:31 ? 00:00:00
40 > /usr/lib/systemd/systemd --switched-root --system --deserialize 18
41 >
42 > This may be relevant when creating your own initramfs.
43
44 Thanks, thats something i could try as well :)
45
46 >
47 > > First of all, with systemd installed I can't install lvm2 with the
48 > > static use flag anymore, which is mandatory for being able using it for
49 > > a initramfs. Why isn't that possible? How can I use the lvm binaries for
50 > > my initramfs?
51 >
52 > Again, as I think has been mentioned, the 'static' use flag is typically
53 > a shortcut for easily building an initrd. Provided you include all the
54 > dependencies of a given binary (as seen with `ldd /path/to/binary`) you
55 > don't need static binaries.
56
57 Yeah, now i was digging a bit further into static binaries. If I insert the
58 relevant libaries it should work too. :)
59 However i was wondering why lvm2 shouldn't be able to build with the
60 static flag on systemd. However that's not important any more, i'm just
61 curious :)
62 >
63 > > This lead me to my second question. At the wiki, the only way to create
64 > > an initramfs for systemd was with genkernel (genkernel --udev --lvm).
65 > > While the command itself is pretty useless (it's `genkernel --udev --lvm
66 > > initramfs` if you want to create the initramfs -> is this a bug??) i
67 > > also would like to use my own initramfs.
68 >
69 > I'm not sure what you mean by the command is useless and is a bug.
70 > Genkernel has multiple potential targets - 'all' for building the kernel
71 > and initrams, 'kernel' for the kernel binary and modules, 'initramfs'
72 > for just the initramfs image, etc. This command should generate an
73 > initramfs with the required components for systemd, udev and lvm.
74
75 Well, at the wiki it's written you should run:
76 genkernel --udev --lvm
77 in order to generate the initramfs. But, you already mentioned it, you
78 need a target in order generate anything, but it isn't mentioned at the
79 wiki.
80 As i'm not familar with genkernel i was a bit confused about the
81 command. I would suggest following for example:
82 genkernel --udev --lvm [target]
83 >
84 > Hopefully some of this will help clear things up a little.
85
86 Yes, of course. Many thanks :)
87 >
88 > Cheers.
89 > --
90 > wraeth <wraeth@×××××××××.au>
91 > GnuPG Key: B2D9F759
92
93 --
94 greetings
95 Michael Mair-Keimberger

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] difficulties with lvm2+systemd+grub2 Sam Jorna <wraeth@×××××××××.au>