1
0
mirror of https://github.com/gryf/mkinitramfs.git synced 2025-12-18 20:10:24 +01:00

Fixed condition expression

This commit is contained in:
2022-03-23 11:36:34 +01:00
parent 20866797b5
commit 54e24b89c9

View File

@@ -165,7 +165,7 @@ if [ -z "${DEVICE}" ]; then
fi
ret=1
if [ -n ${KEYDEV} -eq 1 ]; then
if [ -n ${KEYDEV} ]; then
for i in 0 1 2 ; do
dd if=${KEYDEV} skip=31337 count=8 2>/dev/null | \
cryptsetup open --allow-discards $DEVICE root
@@ -174,6 +174,12 @@ if [ -n ${KEYDEV} -eq 1 ]; then
done
fi
if [[ ${ret} -ne 0 && ! -f ${KEY} ]]; then
echo "Failed to open boot system fs. Giving up."
sleep 3
reboot -f
fi
if [[ -z "${KEYDEV}" || ${ret} -ne 0 ]]; then
for i in 0 1 2 ; do
ccrypt -c $KEY | cryptsetup open --allow-discards $DEVICE root