diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
commit | 203af7302854f453fa4a05ecefd4403b6c8a4f8d (patch) | |
tree | 967fdacafe332baabd12b57725505c138d0f3bbf /modules.d/90crypt | |
parent | Adding upstream version 102. (diff) | |
download | dracut-upstream.tar.xz dracut-upstream.zip |
Adding upstream version 103.upstream/103upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules.d/90crypt')
-rwxr-xr-x | modules.d/90crypt/crypt-lib.sh | 6 | ||||
-rwxr-xr-x | modules.d/90crypt/cryptroot-ask.sh | 8 | ||||
-rwxr-xr-x | modules.d/90crypt/module-setup.sh | 2 | ||||
-rwxr-xr-x | modules.d/90crypt/parse-crypt.sh | 2 | ||||
-rwxr-xr-x | modules.d/90crypt/probe-keydev.sh | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh index f3ba20d..7669828 100755 --- a/modules.d/90crypt/crypt-lib.sh +++ b/modules.d/90crypt/crypt-lib.sh @@ -148,7 +148,7 @@ test_dev() { local mount_point mount_point=$(mkuniqdir /mnt testdev) - [ -n "$dev" -a -n "$*" ] || return 1 + [ -n "$dev" ] && [ -n "$*" ] || return 1 [ -d "$mount_point" ] || die 'Mount point does not exist!' if mount -r "$dev" "$mount_point" > /dev/null 2>&1; then @@ -175,7 +175,7 @@ test_dev() { # match_dev UUID=123 /dev/dm-1 # Returns true if /dev/dm-1 UUID starts with "123". match_dev() { - [ -z "$1" -o "$1" = '*' ] && return 0 + [ -z "$1" ] || [ "$1" = '*' ] && return 0 local devlist local dev @@ -206,7 +206,7 @@ getkey() { local key_dev local key_path - [ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!' + [ -z "$keys_file" ] || [ -z "$for_dev" ] && die 'getkey: wrong usage!' [ -f "$keys_file" ] || return 1 while IFS=: read -r luks_dev key_dev key_path _ || [ -n "$luks_dev" ]; do diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh index b1f8df8..901c9a3 100755 --- a/modules.d/90crypt/cryptroot-ask.sh +++ b/modules.d/90crypt/cryptroot-ask.sh @@ -30,7 +30,7 @@ numtries=${4:-10} if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then while read -r name dev luksfile luksoptions || [ -n "$name" ]; do # ignore blank lines and comments - if [ -z "$name" -o "${name#\#}" != "$name" ]; then + if [ -z "$name" ] || [ "${name#\#}" != "$name" ]; then continue fi @@ -137,7 +137,7 @@ unset allowdiscards # fallback to passphrase ask_passphrase=1 -if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then +if [ -n "$luksfile" ] && [ "$luksfile" != "none" ] && [ -e "$luksfile" ]; then # shellcheck disable=SC2086 if readkey "$luksfile" / "$device" \ | cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname"; then @@ -176,7 +176,7 @@ fi if [ $ask_passphrase -ne 0 ]; then luks_open="$(command -v cryptsetup) $cryptsetupopts luksOpen" - _timeout=$(getargs "rd.luks.timeout") + _timeout=$(getarg "rd.luks.timeout") _timeout=${_timeout:-0} ask_for_password --ply-tries 5 \ --ply-cmd "$luks_open -T1 $device $luksname" \ @@ -187,7 +187,7 @@ if [ $ask_passphrase -ne 0 ]; then unset _timeout fi -if [ "$is_keysource" -ne 0 -a "${luksname##luks-}" != "$luksname" ]; then +if [ "$is_keysource" -ne 0 ] && [ "${luksname##luks-}" != "$luksname" ]; then luks_close="$(command -v cryptsetup) close" { printf -- '[ -e /dev/mapper/%s ] && ' "$luksname" diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh index 8d24825..cc74077 100755 --- a/modules.d/90crypt/module-setup.sh +++ b/modules.d/90crypt/module-setup.sh @@ -118,7 +118,7 @@ install() { forceentry="" while [ $# -gt 0 ]; do case $1 in - force) + force | x-initrd.attach) forceentry="yes" break ;; diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh index 39fc6d2..9567a4a 100755 --- a/modules.d/90crypt/parse-crypt.sh +++ b/modules.d/90crypt/parse-crypt.sh @@ -174,7 +174,7 @@ else } >> "$hookdir/emergency/90-crypt.sh" fi done - elif getargbool 1 rd.auto; then + elif getargbool 1 rd.auto && [ -z "$(getargs rd.luks.name)" ]; then if [ -z "$DRACUT_SYSTEMD" ]; then { printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" diff --git a/modules.d/90crypt/probe-keydev.sh b/modules.d/90crypt/probe-keydev.sh index e5a3f36..bb86b8f 100755 --- a/modules.d/90crypt/probe-keydev.sh +++ b/modules.d/90crypt/probe-keydev.sh @@ -6,7 +6,7 @@ real_keydev="$1" keypath="$2" luksdev="$3" -[ -z "$real_keydev" -o -z "$keypath" ] && die 'probe-keydev: wrong usage!' +[ -z "$real_keydev" ] || [ -z "$keypath" ] && die 'probe-keydev: wrong usage!' [ -z "$luksdev" ] && luksdev='*' info "Probing $real_keydev for $keypath..." |