Gentoo Archives: gentoo-user

From: wraeth@×××××××××.au
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] difficulties with lvm2+systemd+grub2
Date: Wed, 12 Nov 2014 01:03:20
Message-Id: 20141112010303.GA14293@nemesis
In Reply to: [gentoo-user] difficulties with lvm2+systemd+grub2 by Michael Mair-Keimberger
1 On Tue, Nov 11, 2014 at 09:56:09PM +0100, Michael Mair-Keimberger wrote:
2 > Today I've started to play around with systemd but so far I couldn't get
3 > it to boot. I've followed the how to from the gentoo wiki [1], but I
4 > stuck somehow.
5
6 I found systemd to be rather tricky to implement on some of my systems,
7 but this was a while ago and was in a more complex configuration that
8 you're using (though as most people are suggesting, I used dracut to
9 generate my initrd).
10
11 I would also suggest to use either dracut or genkernel-next to generate
12 an initramfs if you wanted to go down that path. Note that
13 sys-kernel/genkernel (as opposed to sys-kernel/genkernel-next) can have
14 issues with systemd (the last time I tried it it complained about
15 systemd and suggested using genkernel-next).
16
17 If you would prefer a hand-rolled one, I can't offer much, but as I
18 think has already been suggested, one key point is to call the correct
19 binary.
20
21 The systemd binary itself is /usr/lib/systemd/systemd, though calling
22 /sbin/init may work if that's configured in such a way as to launch
23 systemd.
24
25 The other point I might add is that my system, which uses dracut, has
26 systemd launched with some specific arguments:
27
28 ps -fp 1
29 UID PID PPID C STIME TTY TIME CMD
30 root 1 0 0 11:31 ? 00:00:00
31 /usr/lib/systemd/systemd --switched-root --system --deserialize 18
32
33 This may be relevant when creating your own initramfs.
34
35 > First of all, with systemd installed I can't install lvm2 with the
36 > static use flag anymore, which is mandatory for being able using it for
37 > a initramfs. Why isn't that possible? How can I use the lvm binaries for
38 > my initramfs?
39
40 Again, as I think has been mentioned, the 'static' use flag is typically
41 a shortcut for easily building an initrd. Provided you include all the
42 dependencies of a given binary (as seen with `ldd /path/to/binary`) you
43 don't need static binaries.
44
45 > This lead me to my second question. At the wiki, the only way to create
46 > an initramfs for systemd was with genkernel (genkernel --udev --lvm).
47 > While the command itself is pretty useless (it's `genkernel --udev --lvm
48 > initramfs` if you want to create the initramfs -> is this a bug??) i
49 > also would like to use my own initramfs.
50
51 I'm not sure what you mean by the command is useless and is a bug.
52 Genkernel has multiple potential targets - 'all' for building the kernel
53 and initrams, 'kernel' for the kernel binary and modules, 'initramfs'
54 for just the initramfs image, etc. This command should generate an
55 initramfs with the required components for systemd, udev and lvm.
56
57 Hopefully some of this will help clear things up a little.
58
59 Cheers.
60 --
61 wraeth <wraeth@×××××××××.au>
62 GnuPG Key: B2D9F759

Attachments

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

Replies

Subject Author
Re: [gentoo-user] difficulties with lvm2+systemd+grub2 Michael Mair-Keimberger <m.mairkeimberger@×××××.com>