[partition] Simplify logic for checking for unencrypted /boot
This commit is contained in:
parent
f0c2295606
commit
36485c8571
@ -497,11 +497,12 @@ shouldWarnForNotEncryptedBoot( const Config* config, const PartitionCoreModule*
|
|||||||
Partition* root_p = core->findPartitionByMountPoint( "/" );
|
Partition* root_p = core->findPartitionByMountPoint( "/" );
|
||||||
Partition* boot_p = core->findPartitionByMountPoint( "/boot" );
|
Partition* boot_p = core->findPartitionByMountPoint( "/boot" );
|
||||||
|
|
||||||
if ( root_p and boot_p )
|
if ( root_p && boot_p )
|
||||||
{
|
{
|
||||||
if ( ( root_p->fileSystem().type() == FileSystem::Luks && boot_p->fileSystem().type() != FileSystem::Luks )
|
const auto encryptionMismatch
|
||||||
|| ( root_p->fileSystem().type() == FileSystem::Luks2
|
= [ root_t = root_p->fileSystem().type(), boot_t = boot_p->fileSystem().type() ]( FileSystem::Type t )
|
||||||
&& boot_p->fileSystem().type() != FileSystem::Luks2 ) )
|
{ return root_t == t && boot_t != t; };
|
||||||
|
if ( encryptionMismatch( FileSystem::Luks ) || encryptionMismatch( FileSystem::Luks2 ) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user