dracut/modules.d
Colin Guthrie e3469d76c7 crypt: Prevent asking for password multiple times if non-default crypt name is used.
If a non-default device mapper name is used for an encrypted partion is
used, (i.e. not luks-$UUID) due to parsing of /etc/crypttab, then the
short-circuits put in place to prevent asking the password twice do not
work.

This would not normally be an issue as the settled job itself should be
removed after it has run and thus cannot be run again. Sadly, due to
the corresponding udev rule using ACTION="add|changed", and the fact
that trying to unlock the device (whether successful or not) seems to
trigger a changed event, it means the settled job is recreated with
each itteration thus causing the whole loop to run again.

It is this situation that the short-circuit exits would normally come
into play but sadly do not work when non-standard names are used.

By the time the /tmp/cryptroot-asked-$2 file is written near the end of
the script, the value of $2 has already been lost due to the argument
parsing code's use of 'shift'. So while on systems where the default
name is used are protected by checking /dev/mapper/xxxx, the
/tmp/cryptroot-asked-$2 file didn't help on systems where this was not
used due to this bug.

So this commit shuffles things around somewhat such that:

 1. The /dev/mapper/xxxx device is checked *after* resolving $2 (which
    contains the default name) to whatever /etc/crypttab specifies.
 2. The cryptroot-asked-xxxx file also uses the translated name both
    for the initial check and to flag when it's written.

As a separate fix, it might make sense to change the udev rule to only
act on add events rather than add|change events, but I'm not sure of the
ramifications of such a change and there may be cases where the add
event is missed and thus the change event needs to be included.
2014-01-24 12:49:17 +01:00
..
00bash */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
00bootchart */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
00dash */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
00systemd-bootchart */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
01fips fips: fix RHEV vmlinuz check 2013-12-03 16:21:04 +01:00
02caps */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
02fips-aesni */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
03modsign Fixup script permissions 2013-12-05 15:13:29 +01:00
03rescue */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
04watchdog */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
05busybox */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
10i18n i18n: introduce i18n_install_all, to install everything 2013-12-05 16:42:05 +01:00
30convertfs */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
40network network: add rd.bootif=0 to ignore BOOTIF 2014-01-17 14:52:01 +01:00
45ifcfg */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
45url-lib */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
50drm Fixup script permissions 2013-12-05 15:13:29 +01:00
50gensplash */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
50plymouth */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
80cms */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90btrfs */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90crypt crypt: Prevent asking for password multiple times if non-default crypt name is used. 2014-01-24 12:49:17 +01:00
90dm */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90dmraid */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90dmsquash-live dmsquash-live: add /dev/mapper/live-base 2013-10-08 15:13:44 +02:00
90kernel-modules kernel-modules: add more block driver 2013-12-19 12:37:47 +01:00
90livenet */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90lvm lvm: fixed lvm thin check 2013-12-13 11:13:40 +01:00
90mdraid */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90multipath */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90qemu */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
90qemu-net */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
91crypt-gpg */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
91crypt-loop Fixup script permissions 2013-12-05 15:13:29 +01:00
95cifs */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95dasd 95dasd: Only install module if normalize_dasd_arg is present 2013-12-05 15:13:29 +01:00
95dasd_mod 95dasd_mod: make dasd_cio_free optional 2013-12-05 15:13:29 +01:00
95dasd_rules Add DASD configuration for SuSE 2013-12-05 15:13:29 +01:00
95debug */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95fcoe move uefi-lib to a seperate module 2013-12-12 09:49:06 +01:00
95fcoe-uefi fcoe-uefi: do not include, if fcoe utils not installed 2014-01-13 09:51:04 +01:00
95fstab-sys */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95iscsi iscsi: more iscsiroot fixes 2014-01-22 17:40:10 +01:00
95nbd iscsi,nbd: do not fail in hostonly mode 2013-11-11 16:57:09 +01:00
95nfs */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95resume resume/parse-resume.sh: fixed printf formatting 2014-01-13 09:51:03 +01:00
95rootfs-block */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95ssh-client */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95terminfo */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95udev-rules udev-rules: add eudev rules 2014-01-24 12:49:16 +01:00
95virtfs */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
95zfcp 95zfcp: Make installation optional 2013-12-05 15:13:29 +01:00
95zfcp_rules Add zfcp scripts for SUSE 2013-12-05 15:13:29 +01:00
95znet 95znet: Make installation optional 2013-12-05 15:13:29 +01:00
96securityfs */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
97biosdevname */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
97masterkey */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
98ecryptfs */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
98integrity */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
98pollcdrom Fixup script permissions 2013-12-05 15:13:29 +01:00
98selinux */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
98syslog */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
98systemd systemd: ensure autofs4 and ipv6 are included 2014-01-24 12:48:08 +01:00
98usrmount usrmount: always install 2013-12-11 14:38:28 +01:00
99base base/dracut-lib.sh: "halt" the machine in systemd mode for die() 2014-01-22 11:18:47 +01:00
99fs-lib */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
99img-lib */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
99shutdown */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
99uefi-lib move uefi-lib to a seperate module 2013-12-12 09:49:06 +01:00