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