diff --git a/src/modules/partition/CMakeLists.txt b/src/modules/partition/CMakeLists.txt index 2a2ddf188..940aacdd8 100644 --- a/src/modules/partition/CMakeLists.txt +++ b/src/modules/partition/CMakeLists.txt @@ -11,8 +11,16 @@ # it will error out at runtime unless you **also** switch **off** # DEBUG_PARTITION_BAIL_OUT, at which point you are welcome to shoot # yourself in the foot. +# +# Independently, DEBUG_PARTITION_SKIP will not do the actual partitioning +# through KPMCore, but it **will** save the global storage setup as if +# it has done the partitioning. This is going to confuse subsequent +# modules since the partitions on disk won't match GS, but it can be +# useful for debugging simulated installations that don't need to +# mount the target filesystems. option( DEBUG_PARTITION_UNSAFE "Allow unsafe partitioning choices." OFF ) option( DEBUG_PARTITION_BAIL_OUT "Unsafe partitioning will error out on exec." ON ) +option( DEBUG_PARTITION_SKIP "Don't actually do any partitioning." OFF) # This is very chatty, useful mostly if you don't know what KPMCore offers. option( DEBUG_FILESYSTEMS "Log all available Filesystems from KPMCore." OFF ) @@ -29,6 +37,9 @@ endif() if ( DEBUG_FILESYSTEMS ) list( APPEND _partition_defs DEBUG_FILESYSTEMS ) endif() +if( DEBUG_PARTITION_SKIP ) + list( APPEND _partition_defs DEBUG_PARTITION_SKIP ) +endif() find_package(ECM ${ECM_VERSION} REQUIRED NO_MODULE) diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index 367672c75..79adf7686 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -639,6 +639,9 @@ PartitionCoreModule::jobs( const Config* config ) const lst << automountControl; lst << Calamares::job_ptr( new ClearTempMountsJob() ); +#ifdef DEBUG_PARTITION_SKIP + cWarning() << "Partitioning actions are skipped."; +#else const QStringList doNotClose = findEssentialLVs( m_deviceInfos ); for ( const auto* info : m_deviceInfos ) @@ -650,10 +653,15 @@ PartitionCoreModule::jobs( const Config* config ) const lst << Calamares::job_ptr( job ); } } +#endif for ( const auto* info : m_deviceInfos ) { +#ifdef DEBUG_PARTITION_SKIP + cWarning() << Logger::SubEntry << "Skipping jobs for" << info->device.data()->deviceNode(); +#else lst << info->jobs(); +#endif devices << info->device.data(); } lst << Calamares::job_ptr( new FillGlobalStorageJob( config, devices, m_bootLoaderInstallPath ) );