Gentoo Archives: gentoo-user

From: Michael Mair-Keimberger <m.mairkeimberger@×××××.com>
To: gentoo user mailing list <gentoo-user@l.g.o>
Subject: [gentoo-user] difficulties with lvm2+systemd+grub2
Date: Tue, 11 Nov 2014 20:56:31
Message-Id: 20141111205608.GA7473@asterix
1 Hi List,
2
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 My configuration:
8 rootfs is on lvm2 (no encryption or raid). I just use it for being able
9 creating snapshot/backups of the running system.
10 Grub is on /dev/sda2 which is a simple ext2 partition with a custom
11 grub.cfg. A Grub entry looks like that:
12
13 ###
14 menuentry 'gentoo amd64 gnome' {
15 linux /gentoo-3.16.5-n lvm=gentoo_amd64_gnome
16 initrd /initrd.cpio.gz
17 }
18 ###
19
20 Don't get confused about the "lvm" flag. This just get passed to my very
21 simple custom initramfs which looks like this:
22
23 ###
24 #!/bin/busybox sh
25
26 cmdline() {
27 local value
28 value=" $(cat /proc/cmdline) "
29 value="${value##* $1=}"
30 value="${value%% *}"
31 [ "$value" != "" ] && echo "$value"
32 }
33 # Mount the /proc and /sys filesystems.
34 mount -t proc none /proc
35 mount -t sysfs none /sys
36 mount -t devtmpfs none /dev
37
38 lvm vgscan
39 lvm vgchange -ay vg0
40 lvm vgscan --mknodes
41
42 # Mount the root filesystem.
43 mount -o ro /dev/mapper/vg0-$(cmdline lvm) /mnt/root
44
45 # Clean up.
46 umount /proc
47 umount /sys
48 umount /dev
49
50 # Boot the real thing.
51 exec switch_root /mnt/root /sbin/init
52 ###
53
54 So far this works great for me. However, with systemd I had some
55 difficulties how to correctly configure the system and grub2 in order to
56 boot with systemd.
57
58 This is what i did so far:
59
60 For systemd i've created a new initramfs with genkernel and changed the
61 grub config like the following entry:
62
63 ###
64 menuentry 'gentoo amd64 gnome systemd' {
65 linux /gentoo-3.16.5-n root=UUID=1eb94a2b-40d7-4556-9102-0320efd04adc init=/usr/lib/systemd/systemd
66 initrd /initramfs-genkernel-x86_64-3.16.5-gentoo
67 }
68 ###
69
70 Systemd installation went without problems (it's a base system without
71 any wm's installed atm), but even though the grub2 changes were quite
72 easy and I've used the genkernel initramfs instead of mine I still get a
73 kernel panic on boot (have a look at the attached picture).
74 I've also checked the kernel config for having the required systemd
75 configurations enabled.
76
77 Anyone has some ideas what might be wrong?
78
79 Furthermore I've also have some questions about lvm2+systemd. Hope
80 someone can give me some answers :)
81
82 First of all, with systemd installed I can't install lvm2 with the
83 static use flag anymore, which is mandatory for being able using it for
84 a initramfs. Why isn't that possible? How can I use the lvm binaries for
85 my initramfs?
86
87 This lead me to my second question. At the wiki, the only way to create
88 an initramfs for systemd was with genkernel (genkernel --udev --lvm).
89 While the command itself is pretty useless (it's `genkernel --udev --lvm
90 initramfs` if you want to create the initramfs -> is this a bug??) i
91 also would like to use my own initramfs.
92 What changes do i have to make in my own initramfs for being able
93 booting systemd from it?
94
95 Thx :)
96
97 [1] http://wiki.gentoo.org/wiki/Systemd
98
99 --
100 greetings
101 Michael Mair-Keimberger

Attachments

File name MIME type
systemd.jpg image/jpeg
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] difficulties with lvm2+systemd+grub2 "Stefan G. Weichinger" <lists@×××××.at>
Re: [gentoo-user] difficulties with lvm2+systemd+grub2 "Jc García" <jyo.garcia@×××××.com>
Re: [gentoo-user] difficulties with lvm2+systemd+grub2 covici@××××××××××.com
Re: [gentoo-user] difficulties with lvm2+systemd+grub2 wraeth@×××××××××.au