Merge pull request #1341 from gportay/filesystem-features
[partition] Add support for filesystem-specific features (KPMCore 4.2.0 required)
This commit is contained in:
commit
74aaccda15
@ -128,7 +128,12 @@ if ( KPMcore_FOUND )
|
|||||||
find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore
|
find_package( Qt5 REQUIRED DBus ) # Needed for KPMCore
|
||||||
find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore
|
find_package( KF5 REQUIRED I18n WidgetsAddons ) # Needed for KPMCore
|
||||||
|
|
||||||
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
|
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.2" )
|
||||||
|
add_definitions(
|
||||||
|
-DWITH_KPMCORE42API
|
||||||
|
-DWITH_KPMCORE4API
|
||||||
|
) # kpmcore 4.2 with new API
|
||||||
|
elseif( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
|
||||||
add_definitions( -DWITH_KPMCORE4API ) # kpmcore 4 with new API
|
add_definitions( -DWITH_KPMCORE4API ) # kpmcore 4 with new API
|
||||||
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
|
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
|
||||||
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} not supported" )
|
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} not supported" )
|
||||||
|
@ -8,7 +8,9 @@ set( _partition_defs "" )
|
|||||||
if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND )
|
if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND )
|
||||||
include_directories( ${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition )
|
include_directories( ${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition )
|
||||||
|
|
||||||
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
|
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.2" )
|
||||||
|
list( APPEND _partition_defs WITH_KPMCORE42API WITH_KPMCORE4API ) # kpmcore 4.2 with new API
|
||||||
|
elseif( KPMcore_VERSION VERSION_GREATER_EQUAL "4.0" )
|
||||||
list( APPEND _partition_defs WITH_KPMCORE4API ) # kpmcore 4 with new API
|
list( APPEND _partition_defs WITH_KPMCORE4API ) # kpmcore 4 with new API
|
||||||
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
|
elseif( KPMcore_VERSION VERSION_GREATER "3.3.70" )
|
||||||
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} are not supported" )
|
message( FATAL_ERROR "KPMCore beta versions ${KPMcore_VERSION} are not supported" )
|
||||||
|
@ -33,6 +33,9 @@ if ( KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND
|
|||||||
if ( KPMcore_VERSION VERSION_GREATER "3.90")
|
if ( KPMcore_VERSION VERSION_GREATER "3.90")
|
||||||
list( APPEND _partition_defs WITH_KPMCORE4API) # kpmcore 4 with new API
|
list( APPEND _partition_defs WITH_KPMCORE4API) # kpmcore 4 with new API
|
||||||
endif()
|
endif()
|
||||||
|
if( KPMcore_VERSION VERSION_GREATER_EQUAL "4.2" )
|
||||||
|
list( APPEND _partition_defs WITH_KPMCORE42API) # kpmcore 4.2 with new API
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories( ${KPMCORE_INCLUDE_DIR} )
|
include_directories( ${KPMCORE_INCLUDE_DIR} )
|
||||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||||
|
@ -834,6 +834,7 @@ PartitionCoreModule::initLayout()
|
|||||||
void
|
void
|
||||||
PartitionCoreModule::initLayout( const QVariantList& config )
|
PartitionCoreModule::initLayout( const QVariantList& config )
|
||||||
{
|
{
|
||||||
|
bool ok;
|
||||||
QString sizeString;
|
QString sizeString;
|
||||||
QString minSizeString;
|
QString minSizeString;
|
||||||
QString maxSizeString;
|
QString maxSizeString;
|
||||||
@ -884,6 +885,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, "mountPoint" ),
|
CalamaresUtils::getString( pentry, "mountPoint" ),
|
||||||
CalamaresUtils::getString( pentry, "filesystem" ),
|
CalamaresUtils::getString( pentry, "filesystem" ),
|
||||||
|
CalamaresUtils::getSubMap( pentry, "features", ok ),
|
||||||
sizeString,
|
sizeString,
|
||||||
minSizeString,
|
minSizeString,
|
||||||
maxSizeString ) )
|
maxSizeString ) )
|
||||||
|
@ -120,6 +120,7 @@ bool
|
|||||||
PartitionLayout::addEntry( const QString& label,
|
PartitionLayout::addEntry( const QString& label,
|
||||||
const QString& mountPoint,
|
const QString& mountPoint,
|
||||||
const QString& fs,
|
const QString& fs,
|
||||||
|
const QVariantMap& features,
|
||||||
const QString& size,
|
const QString& size,
|
||||||
const QString& min,
|
const QString& min,
|
||||||
const QString& max )
|
const QString& max )
|
||||||
@ -144,6 +145,7 @@ PartitionLayout::addEntry( const QString& label,
|
|||||||
{
|
{
|
||||||
entry.partFileSystem = m_defaultFsType;
|
entry.partFileSystem = m_defaultFsType;
|
||||||
}
|
}
|
||||||
|
entry.partFeatures = features;
|
||||||
|
|
||||||
m_partLayout.append( entry );
|
m_partLayout.append( entry );
|
||||||
|
|
||||||
@ -239,6 +241,15 @@ PartitionLayout::execute( Device* dev,
|
|||||||
{
|
{
|
||||||
currentPartition->fileSystem().setLabel( part.partLabel );
|
currentPartition->fileSystem().setLabel( part.partLabel );
|
||||||
}
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
// Some buggy (legacy) BIOSes test if the bootflag of at least one partition is set.
|
// Some buggy (legacy) BIOSes test if the bootflag of at least one partition is set.
|
||||||
// Otherwise they ignore the device in boot-order, so add it here.
|
// Otherwise they ignore the device in boot-order, so add it here.
|
||||||
partList.append( currentPartition );
|
partList.append( currentPartition );
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
// Qt
|
// Qt
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
class Partition;
|
class Partition;
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ public:
|
|||||||
QString partLabel;
|
QString partLabel;
|
||||||
QString partMountPoint;
|
QString partMountPoint;
|
||||||
FileSystem::Type partFileSystem = FileSystem::Unknown;
|
FileSystem::Type partFileSystem = FileSystem::Unknown;
|
||||||
|
QVariantMap partFeatures;
|
||||||
CalamaresUtils::Partition::PartitionSize partSize;
|
CalamaresUtils::Partition::PartitionSize partSize;
|
||||||
CalamaresUtils::Partition::PartitionSize partMinSize;
|
CalamaresUtils::Partition::PartitionSize partMinSize;
|
||||||
CalamaresUtils::Partition::PartitionSize partMaxSize;
|
CalamaresUtils::Partition::PartitionSize partMaxSize;
|
||||||
@ -75,6 +77,7 @@ public:
|
|||||||
bool addEntry( const QString& label,
|
bool addEntry( const QString& label,
|
||||||
const QString& mountPoint,
|
const QString& mountPoint,
|
||||||
const QString& fs,
|
const QString& fs,
|
||||||
|
const QVariantMap& features,
|
||||||
const QString& size,
|
const QString& size,
|
||||||
const QString& min = QString(),
|
const QString& min = QString(),
|
||||||
const QString& max = QString() );
|
const QString& max = QString() );
|
||||||
|
@ -106,9 +106,15 @@ defaultFileSystemType: "ext4"
|
|||||||
# mountPoint: "/home"
|
# mountPoint: "/home"
|
||||||
# size: 3G
|
# size: 3G
|
||||||
# minSize: 1.5G
|
# minSize: 1.5G
|
||||||
|
# features:
|
||||||
|
# 64bit: false
|
||||||
|
# casefold: true
|
||||||
# - name: "data"
|
# - name: "data"
|
||||||
# filesystem: "fat32"
|
# filesystem: "fat32"
|
||||||
# mountPoint: "/data"
|
# mountPoint: "/data"
|
||||||
|
# features:
|
||||||
|
# sector-size: 4096
|
||||||
|
# sectors-per-cluster: 128
|
||||||
# size: 100%
|
# size: 100%
|
||||||
#
|
#
|
||||||
# There can be any number of partitions, each entry having the following attributes:
|
# There can be any number of partitions, each entry having the following attributes:
|
||||||
@ -120,6 +126,8 @@ defaultFileSystemType: "ext4"
|
|||||||
# % of the available drive space if a '%' is appended to the value
|
# % of the available drive space if a '%' is appended to the value
|
||||||
# - minSize: minimum partition size (optional parameter)
|
# - minSize: minimum partition size (optional parameter)
|
||||||
# - maxSize: maximum partition size (optional parameter)
|
# - maxSize: maximum partition size (optional parameter)
|
||||||
|
# - features: filesystem features (optional parameter; requires KPMCore >= 4.2.0)
|
||||||
|
# name: boolean or integer or string
|
||||||
|
|
||||||
# Checking for available storage
|
# Checking for available storage
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user