[partition] Follow 'claimed' settings for claiming swap
- By the time the GS is actually written, new (for partition state) is always false. So "new" is the wrong thing to track. It should have had a better name anyway, - We store custom properties on the partition objects to indicate what happens to them; use those properties (instead of state, as done originally), call it "claimed" to indicate that the partition is part of this installation. For now, only new (as in, formatted, created-by-us) partitions are claimed. - The effect here is that only "new" swap will be added to the system, so in erase-disk installations, or manual partitioning. - Install-alongside and replace will now **not** claim the swap already on the disk; I think we'll need another UI knob for that one. FIXES #1316
This commit is contained in:
parent
35a2db064b
commit
5247c13f98
@ -251,9 +251,9 @@ class FstabGenerator(object):
|
|||||||
return None
|
return None
|
||||||
if not mount_point:
|
if not mount_point:
|
||||||
mount_point = "swap"
|
mount_point = "swap"
|
||||||
# Existing swap partitins should not be used
|
|
||||||
if filesystem == "swap" and not partition["new"]:
|
if filesystem == "swap" and not partition.get("claimed", None):
|
||||||
libcalamares.utils.debug("fstab ignoring old swap {}".format(disk_name))
|
libcalamares.utils.debug("Ignoring foreign swap {!s} {!s}".format(disk_name, partition.get("uuid", None)))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
options = self.get_mount_options(filesystem, mount_point)
|
options = self.get_mount_options(filesystem, mount_point)
|
||||||
|
@ -224,10 +224,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
QList< SummaryInfo > createSummaryInfo() const;
|
QList< SummaryInfo > createSummaryInfo() const;
|
||||||
|
|
||||||
void dumpQueue() const; // debug output
|
|
||||||
|
|
||||||
const OsproberEntryList osproberEntries() const; // os-prober data structure, cached
|
const OsproberEntryList osproberEntries() const; // os-prober data structure, cached
|
||||||
|
|
||||||
|
void dumpQueue() const; // debug output
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void hasRootMountPointChanged( bool value );
|
void hasRootMountPointChanged( bool value );
|
||||||
void isDirtyChanged( bool value );
|
void isDirtyChanged( bool value );
|
||||||
|
@ -100,15 +100,18 @@ mapForPartition( Partition* partition, const QString& uuid )
|
|||||||
map[ "fs" ] = untranslatedFS( dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() );
|
map[ "fs" ] = untranslatedFS( dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() );
|
||||||
}
|
}
|
||||||
map[ "uuid" ] = uuid;
|
map[ "uuid" ] = uuid;
|
||||||
map[ "new" ] = partition->state() == Partition::StateNew;
|
map[ "claimed" ] = PartitionInfo::format( partition ); // If we formatted it, it's ours
|
||||||
|
|
||||||
// Debugging for inside the loop in createPartitionList(),
|
// Debugging for inside the loop in createPartitionList(),
|
||||||
// so indent a bit
|
// so indent a bit
|
||||||
Logger::CDebug deb;
|
Logger::CDebug deb;
|
||||||
using TR = Logger::DebugRow< const char* const, const QString& >;
|
using TR = Logger::DebugRow< const char* const, const QString& >;
|
||||||
deb << Logger::SubEntry << "mapping for" << partition->partitionPath() << partition->deviceNode()
|
deb << Logger::SubEntry << "mapping for" << partition->partitionPath() << partition->deviceNode()
|
||||||
<< TR( "mtpoint:", PartitionInfo::mountPoint( partition ) ) << TR( "fs:", map[ "fs" ].toString() )
|
<< TR( "mtpoint:", PartitionInfo::mountPoint( partition ) )
|
||||||
<< TR( "fsName", map[ "fsName" ].toString() ) << TR( "uuid", uuid );
|
<< TR( "fs:", map[ "fs" ].toString() )
|
||||||
|
<< TR( "fsName", map[ "fsName" ].toString() )
|
||||||
|
<< TR( "uuid", uuid )
|
||||||
|
<< TR( "claimed", map[ "claimed" ].toString() );
|
||||||
|
|
||||||
if ( partition->roles().has( PartitionRole::Luks ) )
|
if ( partition->roles().has( PartitionRole::Luks ) )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user