2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
6 type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
11 crypttab_contains "$luks" && exit 0
15 # parse for allow-discards
16 if strstr "$(cryptsetup --help)" "allow-discards"; then
17 if discarduuids=$(getargs "rd.luks.allow-discards"); then
18 discarduuids=$(str_replace "$discarduuids" 'luks-' '')
19 if strstr " $discarduuids " " ${luks##luks-}"; then
20 allowdiscards="allow-discards"
22 elif getargbool 0 rd.luks.allow-discards; then
23 allowdiscards="allow-discards"
27 echo "$luks $dev - timeout=0,$allowdiscards" >> /etc/crypttab
29 if command -v systemctl >/dev/null; then
30 systemctl daemon-reload
31 systemctl start cryptsetup.target