The dmcrypt init script has the device-mapper service set as needed (baselayout-2), and device-mapper is set to start only after lvm. Thus, dmcrypt can only be started after lvm, which is inappropriate for LVM on top of dmcrypt; setting rc_before="lvm" in /etc/conf.d/dmcrypt fails to due the created circular dependency. The problem can be cured by removing the dm dependency (rc_need="! device-mapper" in /etc/conf.d/dmcrypt) which is not clear to me in the first place: Shouldn't the dm kernel support be sufficient for dmcrypt to start? Of course, depending on the kernel this may require to load dm_mod but that can be done without starting the device-mapper service (s. lvm). Can the following lines be removed from depend() in /etc/init.d/dmcrypt if [ -e /lib/librc.so ]; then need device-mapper fi Or are they needed for something else? If yes, how can LVM on top of dmcrypt be realized upon system start.
i cant think of a reason for hard requiring it for everyone. it's supposed to be designed for people to opt into their requirements via conf.d rc_need. http://sources.gentoo.org/sys-fs/cryptsetup/files/1.0.5-dmcrypt.rc?r1=1.3&r2=1.4