You are not logged in.

#1 2014-03-19 10:42:36

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

[WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

Hey everyone,

with the latest release, systemd gained the ability to autodetect neccessary partitions to be mounted at boot time without the need for an fstab or root= kernel commandline. This all depends on DiscoverablePartitionsSpec and systemd-gpt-auto-generator.

Did anyone try setting this up on Arch? I fiddled around a bit, but couldn't really manage to get it working. Here's what I did:

  • Use gdisk to change the partition type of my / partition to 4f68bce3-e8cd-4db1-96e7-fbcaf984b709. (gdisk /dev/sda t 2 $GUID w q)

  • Manually remove fstab from my initramfs, as mkinitcpio always includes one or throws an error if it doesn't exist on the host

  • Remove all kernel commandline arguments except for initrd=

What else would I need to do? Include /usr/lib/systemd/system-generators/systemd-gpt-auto-generators in the initrd? What .service files would I need?

If anyone's wondering: I do have a systemd initramfs, i.e. no base hook.

Cheers,
gegenschall

Last edited by gegenschall (2014-04-01 12:33:15)

Offline

#2 2014-03-19 10:46:54

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

There's https://bugs.archlinux.org/task/39379 but I don't understand what is it about.

Edit: OK, now I get it: http://cgit.freedesktop.org/systemd/sys … ed5f1247c5
(the url to the commit posted in the bug report has two spaces you need to remove ;P)

Last edited by karol (2014-03-19 10:50:59)

Offline

#3 2014-03-19 10:56:23

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

You don't need to remove fstab, this will work with an empty fstab just the same. mkinitcpio does not add your fstab to the image by the way, it simply creates an empty one (this shouldn't be necessary anymore I think).

I think all should work once you add systemd-gpt-auto-generator to the initramfs.

Offline

#4 2014-03-19 11:15:07

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

Okay, I'll try and apply the patch, see if that works.

In the meantime, after using this patch on /usr/lib/initcpio/install/systemd

109,111d108
<     # generate alls mounts from GPT
<     add_file "/usr/lib/systemd/system-generators/systemd-gpt-auto-generator"
< 

systemd at least uses the gpt-auto-generator to try and mount the disks but seems stuck in some weird loop while asking for the cryptsetup password, see this image. The password prompt gets repeated every 5 or so seconds. If I manage to type my password within the five seconds the prompt stops but nothing else happens.

edit: brain0 - I did remove my fstab from the initrd.
edit2: No, the patch didn't really help much.

Last edited by gegenschall (2014-03-19 11:57:54)

Offline

#5 2014-03-19 15:12:38

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

First of all, it should be add_binary, not add_file. Second, the generator should work (at least in systemd 211) for luks devices, too.

Offline

#6 2014-03-19 15:32:09

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

brain0 wrote:

First of all, it should be add_binary, not add_file.

The Arch systemd hook uses add_file for systemd-fstab-generator. This should be fixed then...


brain0 wrote:

Second, the generator should work (at least in systemd 211) for luks devices, too.

So do I need the sd-encrypt hook then?

Offline

#7 2014-03-19 15:41:28

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

How would I know what you need? Your screenshot suggests that you are using a LUKS device, so you'll need the sd-encrypt hook.

Offline

#8 2014-03-20 14:31:09

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

brain0 wrote:

How would I know what you need? Your screenshot suggests that you are using a LUKS device, so you'll need the sd-encrypt hook.

Absolutely. I'm not sure why I asked that, I meant something else. Never mind. :-)

I did some more testing and I'm pretty sure there's a bug somewhere. I added the base hook to my initcpio to get an emergency shell and have a look at the logs but that didn't work. It tells me, that a shell is being opened but I don't see a prompt (that message is repeated for about 6-7 times). Well, I think I'm gonna put this to rest, seems too borked at the moment to be usable.

Offline

#9 2014-03-22 08:59:03

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

Did you take into account that it only detects the root partition when you use EFI and only on the same disk that your ESP is on?

Offline

#10 2014-03-28 13:39:07

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

brain0 wrote:

Did you take into account that it only detects the root partition when you use EFI and only on the same disk that your ESP is on?

Yes, I did. Booting using gummiboot (the recommended way, I think) and using only one disk.

Offline

#11 2014-03-28 15:52:58

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

It's been a few days since I looked at the code, and from what I remember LUKS on the root partition cannot possibly work the way it is written. I'd need another close look to be sure.

I tested this without LUKS and it works.

Offline

#12 2014-03-29 14:02:47

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

The discoverable partition spec tells me it should be possible, or am I getting it wrong?

On a sidenote: Because I'm not able to drop to an emergency shell even with the base hook enabled (I don't know why...) it would be nice to have systemd log to the console instead of the journal. Any way to accomplish that?

Offline

#13 2014-03-29 22:45:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

gegenschall wrote:

it would be nice to have systemd log to the console instead of the journal. Any way to accomplish that?

https://wiki.archlinux.org/index.php/Sy … ev.2Ftty12 ?

Offline

#14 2014-04-01 12:32:52

gegenschall
Member
From: Munich, Germany
Registered: 2013-10-09
Posts: 33

Re: [WONTSOLVE] Systemd-gpt-auto-generator a.k.a. no more UUIDs on boot

karol wrote:
gegenschall wrote:

it would be nice to have systemd log to the console instead of the journal. Any way to accomplish that?

https://wiki.archlinux.org/index.php/Sy … ev.2Ftty12 ?

Couldn't get that to work inside the initrd. But anyways, I just read the current systemd TODO, which states:

TODO wrote:

* gpt-auto-generator:
  - Support LUKS for root devices

So, sorry brain0 for doubting you. I'm marking this as WONTSOLVE. ;-)

Last edited by gegenschall (2014-04-01 12:38:03)

Offline

Board footer

Powered by FluxBB