diff --git a/src/modules/machineid/MachineIdJob.cpp b/src/modules/machineid/MachineIdJob.cpp index 2feff6aea..8a33288b9 100644 --- a/src/modules/machineid/MachineIdJob.cpp +++ b/src/modules/machineid/MachineIdJob.cpp @@ -77,6 +77,12 @@ MachineIdJob::exec() //Create new files for ( const auto& entropy_file : m_entropy_files ) { + if ( !CalamaresUtils::System::instance()->createTargetParentDirs( entropy_file ) ) + { + return Calamares::JobResult::error( + QObject::tr( "Directory not found" ), + QObject::tr( "Could not create new random file
%1
." ).arg( entropy_file ) ); + } auto r = MachineId::createEntropy( m_entropy_copy ? MachineId::EntropyGeneration::CopyFromHost : MachineId::EntropyGeneration::New, root, diff --git a/src/modules/machineid/Tests.cpp b/src/modules/machineid/Tests.cpp index af6965a1f..13cce3de7 100644 --- a/src/modules/machineid/Tests.cpp +++ b/src/modules/machineid/Tests.cpp @@ -235,7 +235,8 @@ MachineIdTests::testJob() QVERIFY( r ); for ( const auto& fileName : j.entropyFileNames() ) { - QVERIFY( QFile::exists( tempRoot.filePath( fileName ) ) ); + cDebug() << "Verifying existence of" << fileName; + QVERIFY( QFile::exists( tempRoot.filePath( fileName.mid( 1 ) ) ) ); } }