Merge pull request #1348 from gportay/partition-type
[partition] Add support for partition type
This commit is contained in:
commit
8c92768f66
@ -883,6 +883,7 @@ PartitionCoreModule::initLayout( const QVariantList& config )
|
||||
}
|
||||
|
||||
if ( !m_partLayout->addEntry( CalamaresUtils::getString( pentry, "name" ),
|
||||
CalamaresUtils::getString( pentry, "type" ),
|
||||
CalamaresUtils::getString( pentry, "mountPoint" ),
|
||||
CalamaresUtils::getString( pentry, "filesystem" ),
|
||||
CalamaresUtils::getSubMap( pentry, "features", ok ),
|
||||
|
@ -118,6 +118,7 @@ PartitionLayout::addEntry( const QString& mountPoint, const QString& size, const
|
||||
|
||||
bool
|
||||
PartitionLayout::addEntry( const QString& label,
|
||||
const QString& type,
|
||||
const QString& mountPoint,
|
||||
const QString& fs,
|
||||
const QVariantMap& features,
|
||||
@ -139,6 +140,7 @@ PartitionLayout::addEntry( const QString& label,
|
||||
}
|
||||
|
||||
entry.partLabel = label;
|
||||
entry.partType = type;
|
||||
entry.partMountPoint = mountPoint;
|
||||
PartUtils::findFS( fs, &entry.partFileSystem );
|
||||
if ( entry.partFileSystem == FileSystem::Unknown )
|
||||
@ -242,11 +244,21 @@ PartitionLayout::execute( Device* dev,
|
||||
currentPartition->setLabel( part.partLabel );
|
||||
currentPartition->fileSystem().setLabel( part.partLabel );
|
||||
}
|
||||
if ( !part.partType.isEmpty() )
|
||||
{
|
||||
#if defined( WITH_KPMCORE42API )
|
||||
currentPartition->setType( part.partType );
|
||||
#else
|
||||
cWarning() << "Ignoring type; requires KPMcore >= 4.2.0.";
|
||||
#endif
|
||||
}
|
||||
if ( !part.partFeatures.isEmpty() )
|
||||
{
|
||||
#if defined( WITH_KPMCORE42API )
|
||||
for ( const auto& k : part.partFeatures.keys() )
|
||||
{
|
||||
currentPartition->fileSystem().addFeature( k, part.partFeatures.value(k) );
|
||||
}
|
||||
#else
|
||||
cWarning() << "Ignoring features; requires KPMcore >= 4.2.0.";
|
||||
#endif
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
struct PartitionEntry
|
||||
{
|
||||
QString partLabel;
|
||||
QString partType;
|
||||
QString partMountPoint;
|
||||
FileSystem::Type partFileSystem = FileSystem::Unknown;
|
||||
QVariantMap partFeatures;
|
||||
@ -75,6 +76,7 @@ public:
|
||||
const QString& min = QString(),
|
||||
const QString& max = QString() );
|
||||
bool addEntry( const QString& label,
|
||||
const QString& type,
|
||||
const QString& mountPoint,
|
||||
const QString& fs,
|
||||
const QVariantMap& features,
|
||||
|
@ -96,12 +96,14 @@ defaultFileSystemType: "ext4"
|
||||
#
|
||||
# partitionLayout:
|
||||
# - name: "rootfs"
|
||||
# type: "4f68bce3-e8cd-4db1-96e7-fbcaf984b709"
|
||||
# filesystem: "ext4"
|
||||
# mountPoint: "/"
|
||||
# size: 20%
|
||||
# minSize: 500M
|
||||
# maxSize: 10G
|
||||
# - name: "home"
|
||||
# type = "933ac7e1-2eb4-4f13-b844-0e14e2aef915"
|
||||
# filesystem: "ext4"
|
||||
# mountPoint: "/home"
|
||||
# size: 3G
|
||||
@ -121,6 +123,7 @@ defaultFileSystemType: "ext4"
|
||||
# - name: filesystem label
|
||||
# and
|
||||
# partition name (gpt only; since KPMCore 4.2.0)
|
||||
# - type: partition type (optional parameter; gpt only; requires KPMCore >= 4.2.0)
|
||||
# - filesystem: filesystem type
|
||||
# - mountPoint: partition mount point
|
||||
# - size: partition size in bytes (append 'K', 'M' or 'G' for KiB, MiB or GiB)
|
||||
|
Loading…
Reference in New Issue
Block a user