From 1d812f88cea8c645e36e52a6479cf13a8a302e7e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 21 Sep 2021 12:10:21 +0200 Subject: [PATCH] [luksbootkeyfile] Bump timeout for adding LUKS keyfile --- src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp b/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp index 3cd98d3ae..43da3971a 100644 --- a/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp +++ b/src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp @@ -123,8 +123,10 @@ generateTargetKeyfile() return false; } - // Give ample time to check that the file was created correctly - auto r = CalamaresUtils::System::instance()->targetEnvCommand( { "ls", "-la", "/" } ); + // Give ample time to check that the file was created correctly; + // we actually expect ls to return pretty-much-instantly. + auto r = CalamaresUtils::System::instance()->targetEnvCommand( + { "ls", "-la", "/" }, QString(), QString(), std::chrono::seconds( 5 ) ); cDebug() << "In target system after creating LUKS file" << r.getOutput(); return true; } @@ -132,8 +134,10 @@ generateTargetKeyfile() static bool setupLuks( const LuksDevice& d ) { + // Adding the key can take some times, measured around 15 seconds with + // a HDD (spinning rust) and a slow-ish computer. Give it a minute. auto r = CalamaresUtils::System::instance()->targetEnvCommand( - { "cryptsetup", "luksAddKey", d.device, keyfile }, QString(), d.passphrase, std::chrono::seconds( 15 ) ); + { "cryptsetup", "luksAddKey", d.device, keyfile }, QString(), d.passphrase, std::chrono::seconds( 60 ) ); if ( r.getExitCode() != 0 ) { cWarning() << "Could not configure LUKS keyfile on" << d.device << ':' << r.getOutput() << "(exit code"