r = dm_create_device(cd, name, CRYPT_LOOPAES, &dmd, 0);
- if (!r && !(dm_flags() & req_flags)) {
+ if (r < 0 && !(dm_flags() & req_flags)) {
log_err(cd, _("Kernel doesn't support loop-AES compatible mapping.\n"));
r = -ENOTSUP;
}
break;
}
- if (!r && !(dm_flags() & DM_PLAIN64_SUPPORTED)) {
+ if (r < 0 && !(dm_flags() & DM_PLAIN64_SUPPORTED)) {
log_err(cd, _("Kernel doesn't support plain64 IV.\n"));
r = -ENOTSUP;
}
return r;
r = dm_create_device(cd, name, CRYPT_VERITY, &dmd, 0);
- if (!r && !(dm_flags() & DM_VERITY_SUPPORTED)) {
+ if (r < 0 && !(dm_flags() & DM_VERITY_SUPPORTED)) {
log_err(cd, _("Kernel doesn't support dm-verity mapping.\n"));
return -ENOTSUP;
}
[ -n "$VALG" ] && valgrind_setup && VERITYSETUP=valgrind_run
modprobe dm-verity >/dev/null 2>&1
+dmsetup targets | grep verity >/dev/null 2>&1 || skip "Cannot find dm-verity target, test skipped."
# VERITYSETUP tests