Using dmcrypt with openrc 0.2.2 isn't working as expected. The system: - Baselayout 2.0.0 - OpenRC 0.2.2 - /etc/init.d/dmcrypt from sys-fs/cryptsetup-1.0.5-r1 What's wrong: - partitions get mounted before dmcrypt could "luksOpen" them - the keymap is not loaded before dmcrypt asks for the password -> if you are not running "us" keyboard but for example "de" you have to guess where the correct extra chars like ; or { are. Current boot order: 1. mount partitions 2. run dmcrypt 3. set keymap Expected boot order: 1. set keymap 2. run dmcrypt 3. mount partitions The attached picture shows that the partitions get mounted before dmcrypt runs. The picture is a few days old and does not use openrc 0.2.2 but an older version. As you can see the keymaps were loaded before dmcrypt. This changed in recent versions! (Yea, I wanted to open this bug for a few weeks now...)
Created attachment 150628 [details] picture showing that partitions get mounted before dmcrypt is run
Created attachment 150634 [details] better picture this picture comes from openrc 0.2.2 and shows that the keymap is not being set before dmcrypt is called.
Could someone modify the title because the keymaps issue was not clear from that description and I think that that one is as serious. I don't wanna open a new bug for this similar issue.
(In reply to comment #3) > Could someone modify the title because the keymaps issue was not clear from > that description. good point. done
set your custom depend string in conf.d/dmcrypt ... the order of init scripts for you may not be appropriate for other people (in fact, i can guarantee it)
I think it's not just that easy. I could of course put "/etc/init.d/keymaps start" into /etc/conf.d/dmcrypt, the problem is, that the keymaps script itself depends on localmount which cannot have run because the dmcrypt container is not unlocked. So if that is the way it would either mean rewriting the keymaps script, probably hardwiring the "mount /" which would rip out a lot of what the init system is about. Correct me if I'm wrong please.
i didnt mean put '/etc/init.d/keymaps start' into the conf.d ... that is of course wrong. openrc has extended syntax so you can declare dependencies in conf.d files. keymaps needs localmount because all of the keymaps live on /usr and localmount is what makes sure that gets mounted. i'm not sure if openrc's syntax allows you to delete things from the init.d ... that would be useful. that way you could delete the localmount depend in the conf.d file. Roy: ?
Depends on the syntax need localmount in /etc/init.d/foo can be cancelled with rc_need="!localmount" in /etc/conf.d/foo or rc_foo_need="!localmount" in /etc/rc.conf where this is all documented, along with the runscript man page.
then i dont see there needing to be anything else here for openrc/dmcrypt may be good to have a dmcrypt doc somewhere the documents the common scenarios and the cookie cutter recipes for how to address them
So just to sort it out: My /home is encrypted. I want the keymaps to be loaded in order to enter the key. For this I need / (or /usr) mounted. Localmount mounts it, but fails at mounting /home because dmcrypt has not yet created /dev/mapper/crypt-home (cause it has not been unlocked). I run dmcrypt after the failed localmount (which just mounted /) and enter my key. Now I run localmount again to finish up?
having /usr on a sep partition as well as random encrypted partitions are exactly the sort of thing that can not be magically solved. i dont think localmount allows customization, so you would need to create an init.d script that only mounts /usr in start() and then have dmcrypt depend on that and before localmount (which can be done via conf.d/dmcrypt).
I don't have /usr/ on a separate partition, but still thanks for clearing the issue up. If something like this would end up in the docs for dmcrypt I think it would be really useful.