From 66fb4c557644ba2c37951a7568c06c47a6c718a7 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 9 May 2020 14:52:07 -0700 Subject: filesystem: improve errors Introduce filesystem.ErrEncryptionNotEnabled and filesystem.ErrEncryptionNotSupported which include the Mount as context, and translate the corresponding metadata/ errors into them. Then make these errors show much better suggestions. Also replace lots of other filesystem/ errors with either custom types or with unnamed one-off errors that include more context. Fix backwards wrapping in lots of cases. Finally, don't include the mountpoint in places where it's not useful, like OS-level errors that already include the path. --- cli-tests/t_not_enabled.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cli-tests/t_not_enabled.sh') diff --git a/cli-tests/t_not_enabled.sh b/cli-tests/t_not_enabled.sh index 3c7d22c..fae1094 100755 --- a/cli-tests/t_not_enabled.sh +++ b/cli-tests/t_not_enabled.sh @@ -26,6 +26,11 @@ _expect_failure "fscrypt unlock '$dir'" _print_header "Try to lock a directory when encryption is disabled" _expect_failure "fscrypt lock '$dir'" +_print_header "Check for additional message when GRUB appears to be installed" +mkdir -p "$MNT/boot/grub" +_expect_failure "fscrypt encrypt '$dir'" +rm -r "${MNT:?}/boot" + _print_header "Enable encryption on $DEV" _run_noisy_command "tune2fs -O encrypt '$DEV'" -- cgit v1.2.3