mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Detect dm-verity in kernel.
This commit is contained in:
@@ -127,6 +127,16 @@ static void _dm_set_crypt_compat(const char *dm_version, unsigned crypt_maj,
|
||||
_dm_crypt_checked = 1;
|
||||
}
|
||||
|
||||
static void _dm_set_verity_compat(const char *dm_version, unsigned verity_maj,
|
||||
unsigned verity_min, unsigned verity_patch)
|
||||
{
|
||||
if (verity_maj > 0)
|
||||
_dm_crypt_flags |= DM_VERITY_SUPPORTED;
|
||||
|
||||
log_dbg("Detected dm-verity version %i.%i.%i.",
|
||||
verity_maj, verity_min, verity_patch);
|
||||
}
|
||||
|
||||
static int _dm_check_versions(void)
|
||||
{
|
||||
struct dm_task *dmt;
|
||||
@@ -158,6 +168,11 @@ static int _dm_check_versions(void)
|
||||
(unsigned)target->version[0],
|
||||
(unsigned)target->version[1],
|
||||
(unsigned)target->version[2]);
|
||||
} else if (!strcmp(DM_VERITY_TARGET, target->name)) {
|
||||
_dm_set_verity_compat(dm_version,
|
||||
(unsigned)target->version[0],
|
||||
(unsigned)target->version[1],
|
||||
(unsigned)target->version[2]);
|
||||
}
|
||||
target = (struct dm_versions *)((char *) target + target->next);
|
||||
} while (last_target != target);
|
||||
|
||||
Reference in New Issue
Block a user