Browse Source

crypt/module-setup.sh: filter /etc/crypttab in host-only mode

only take those /etc/crypttab entries, which we need to boot the system
master
Harald Hoyer 12 years ago
parent
commit
96efbc51ac
  1. 17
      modules.d/90crypt/module-setup.sh

17
modules.d/90crypt/module-setup.sh

@ -56,7 +56,22 @@ install() { @@ -56,7 +56,22 @@ install() {
if ! dracut_module_included "systemd"; then
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
fi
[[ $hostonly ]] && inst_simple /etc/crypttab

if [[ $hostonly ]]; then
# filter /etc/crypttab for the devices we need
while read _mapper _dev _rest; do
[[ $_mapper = \#* ]] && continue
[[ $_dev ]] || continue
for _hdev in "${!host_fs_types[@]}"; do
[[ ${host_fs_types[$_hdev]} == "crypto_LUKS" ]] || continue
if [[ $_hdev -ef $_dev ]] || [[ /dev/block/$_hdev -ef $_dev ]]; then
echo "$_mapper $_dev $_rest"
break
fi
done
done < /etc/crypttab > $initdir/etc/crypttab
fi

inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"

dracut_install -o \

Loading…
Cancel
Save