Merge branch 'issue-swaps'
This commit is contained in:
commit
a2d245ef92
@ -218,7 +218,6 @@ class FstabGenerator(object):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
dct = self.generate_fstab_line_info(partition)
|
dct = self.generate_fstab_line_info(partition)
|
||||||
|
|
||||||
if dct:
|
if dct:
|
||||||
self.print_fstab_line(dct, file=fstab_file)
|
self.print_fstab_line(dct, file=fstab_file)
|
||||||
|
|
||||||
@ -233,19 +232,30 @@ class FstabGenerator(object):
|
|||||||
self.print_fstab_line(dct, file=fstab_file)
|
self.print_fstab_line(dct, file=fstab_file)
|
||||||
|
|
||||||
def generate_fstab_line_info(self, partition):
|
def generate_fstab_line_info(self, partition):
|
||||||
""" Generates information for each fstab entry. """
|
"""
|
||||||
|
Generates information (a dictionary of fstab-fields)
|
||||||
|
for the given @p partition.
|
||||||
|
"""
|
||||||
|
# Some "fs" names need special handling in /etc/fstab, so remap them.
|
||||||
filesystem = partition["fs"].lower()
|
filesystem = partition["fs"].lower()
|
||||||
|
filesystem = FS_MAP.get(filesystem, filesystem)
|
||||||
has_luks = "luksMapperName" in partition
|
has_luks = "luksMapperName" in partition
|
||||||
mount_point = partition["mountPoint"]
|
mount_point = partition["mountPoint"]
|
||||||
disk_name = disk_name_for_partition(partition)
|
disk_name = disk_name_for_partition(partition)
|
||||||
is_ssd = disk_name in self.ssd_disks
|
is_ssd = disk_name in self.ssd_disks
|
||||||
filesystem = FS_MAP.get(filesystem, filesystem)
|
|
||||||
|
|
||||||
|
# Swap partitions are called "linuxswap" by parted.
|
||||||
|
# That "fs" is visible in GS, but that gets mapped
|
||||||
|
# to "swap", above, because that's the spelling needed in /etc/fstab
|
||||||
if not mount_point and not filesystem == "swap":
|
if not mount_point and not filesystem == "swap":
|
||||||
return None
|
return None
|
||||||
if not mount_point:
|
if not mount_point:
|
||||||
mount_point = "swap"
|
mount_point = "swap"
|
||||||
|
|
||||||
|
if filesystem == "swap" and not partition.get("claimed", None):
|
||||||
|
libcalamares.utils.debug("Ignoring foreign swap {!s} {!s}".format(disk_name, partition.get("uuid", None)))
|
||||||
|
return None
|
||||||
|
|
||||||
options = self.get_mount_options(filesystem, mount_point)
|
options = self.get_mount_options(filesystem, mount_point)
|
||||||
|
|
||||||
if is_ssd:
|
if is_ssd:
|
||||||
|
@ -80,6 +80,9 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
|
|
||||||
if have_dracut:
|
if have_dracut:
|
||||||
for partition in partitions:
|
for partition in partitions:
|
||||||
|
if partition["fs"] == "linuxswap" and not partition.get("claimed", None):
|
||||||
|
# Skip foreign swap
|
||||||
|
continue
|
||||||
has_luks = "luksMapperName" in partition
|
has_luks = "luksMapperName" in partition
|
||||||
if partition["fs"] == "linuxswap" and not has_luks:
|
if partition["fs"] == "linuxswap" and not has_luks:
|
||||||
swap_uuid = partition["uuid"]
|
swap_uuid = partition["uuid"]
|
||||||
@ -94,6 +97,9 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
for partition in partitions:
|
for partition in partitions:
|
||||||
|
if partition["fs"] == "linuxswap" and not partition.get("claimed", None):
|
||||||
|
# Skip foreign swap
|
||||||
|
continue
|
||||||
has_luks = "luksMapperName" in partition
|
has_luks = "luksMapperName" in partition
|
||||||
if partition["fs"] == "linuxswap" and not has_luks:
|
if partition["fs"] == "linuxswap" and not has_luks:
|
||||||
swap_uuid = partition["uuid"]
|
swap_uuid = partition["uuid"]
|
||||||
|
@ -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,14 +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[ "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 ) )
|
||||||
{
|
{
|
||||||
@ -213,6 +217,7 @@ FillGlobalStorageJob::exec()
|
|||||||
{
|
{
|
||||||
Calamares::GlobalStorage* storage = Calamares::JobQueue::instance()->globalStorage();
|
Calamares::GlobalStorage* storage = Calamares::JobQueue::instance()->globalStorage();
|
||||||
storage->insert( "partitions", createPartitionList() );
|
storage->insert( "partitions", createPartitionList() );
|
||||||
|
cDebug() << "Saving partition information map to GlobalStorage[\"partitions\"]";
|
||||||
if ( !m_bootLoaderPath.isEmpty() )
|
if ( !m_bootLoaderPath.isEmpty() )
|
||||||
{
|
{
|
||||||
QVariant var = createBootLoaderMap();
|
QVariant var = createBootLoaderMap();
|
||||||
@ -236,7 +241,7 @@ FillGlobalStorageJob::createPartitionList() const
|
|||||||
{
|
{
|
||||||
UuidForPartitionHash hash = findPartitionUuids( m_devices );
|
UuidForPartitionHash hash = findPartitionUuids( m_devices );
|
||||||
QVariantList lst;
|
QVariantList lst;
|
||||||
cDebug() << "Writing to GlobalStorage[\"partitions\"]";
|
cDebug() << "Building partition information map";
|
||||||
for ( auto device : m_devices )
|
for ( auto device : m_devices )
|
||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "partitions on" << device->deviceNode();
|
cDebug() << Logger::SubEntry << "partitions on" << device->deviceNode();
|
||||||
|
Loading…
Reference in New Issue
Block a user