crypt/parse-crypt.sh: hide encrypted devices from systemd timeout warnings.dracut-mailing/20150326044148.10121.15286.stgit@notabene.brown
commit4d9d767da2e5928552a9603d91382f8dc34cc26d
authorNeilBrown <neilb@suse.de>
Tue, 31 Mar 2015 21:57:41 +0000 (1 08:57 +1100)
committerHarald Hoyer <harald@redhat.com>
Tue, 2 Jun 2015 10:03:43 +0000 (2 12:03 +0200)
tree2122a9b3228d7b153c9c135dda7e17b5b715de57
parentf53ede36fb26716301d57706f889124ca20f3397
crypt/parse-crypt.sh: hide encrypted devices from systemd timeout warnings.

When systemd's crypttab generator parsed crypttab, it tells
systemd about several devices which may not appear until later
in the boot sequence, and which are not needed while dract is running.

This can particularly happen when an md array is encrypted,
and the array is newly degraded so that it doesn't appear until
dracut runs mdraid_start.sh.

This can result in systemd printing warning messages which are
inappropriate.

So tell systemd that the timeout for each of these is zero.

This is involves splitting some functionality out of wait_for_dev()

That function does two things:
 - creates 'finished' hooks so that dracut will wait for the device,
   and
 - sets the systemd timeout for the device to zero, so systemd doesn't
   wait.

We only want the second of these for most encrypted devices.
So split that out into a new function set_systemd_timeout_for_dev(),
and call it from parse-crypt.sh

Signed-off-by: NeilBrown <neilb@suse.de>
--
This version fixes the missing redirect from /etc/crypttab
NeilBrown
modules.d/90crypt/parse-crypt.sh
modules.d/99base/dracut-lib.sh