Merge pull request #2187 from bkmo/bkmo

Update LuksBootKeyFileJob.cpp to check for unencrypted boot with encrypted root
This commit is contained in:
dalto8 2023-08-26 19:40:45 +00:00 committed by GitHub
commit 0ddffad57c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View File

@ -242,13 +242,6 @@ hasUnencryptedSeparateBoot()
{ return hasMountPoint( partition, QStringLiteral( "/boot" ) ) && !isEncrypted( partition ); } );
}
STATICTEST bool
hasEncryptedRoot()
{
return anyPartition( []( const QVariantMap& partition )
{ return hasMountPoint( partition, QStringLiteral( "/" ) ) && isEncrypted( partition ); } );
}
Calamares::JobResult
LuksBootKeyFileJob::exec()
{
@ -294,10 +287,9 @@ LuksBootKeyFileJob::exec()
return Calamares::JobResult::ok();
}
if ( hasUnencryptedSeparateBoot() && !hasEncryptedRoot() )
if ( hasUnencryptedSeparateBoot() )
{
// /boot partition is not encrypted, keyfile must not be used
// But only if root partition is not encrypted
// /boot partition is not encrypted, keyfile must not be used.
cDebug() << Logger::SubEntry << "/boot partition is not encrypted, skipping keyfile creation.";
return Calamares::JobResult::ok();
}

View File

@ -158,7 +158,6 @@ LuksBootKeyFileTests::testAnyPartition()
{ return hasMountPoint( partdata, QStringLiteral( "/" ) ); } ) );
QVERIFY( !anyPartition( []( const QVariantMap& partdata ) { return hasMountPoint( partdata, QString() ); } ) );
QVERIFY( !hasEncryptedRoot() );
QVERIFY( hasUnencryptedSeparateBoot() );
}