Compare commits
18 Commits
v2.4.5
...
2.4.x-stab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
755a56914d | ||
|
|
ef04515011 | ||
|
|
8e842efd66 | ||
|
|
21a6459611 | ||
|
|
a81c8137b2 | ||
|
|
1c946bf365 | ||
|
|
67bd3306f8 | ||
|
|
89f078f8c5 | ||
|
|
6e2d445888 | ||
|
|
bdda452f66 | ||
|
|
50187261c3 | ||
|
|
1f37f3dda0 | ||
|
|
d7302ca024 | ||
|
|
92e1233279 | ||
|
|
4a50f5ae54 | ||
|
|
fe75e980f5 | ||
|
|
7a67eed918 | ||
|
|
b4fb2115dc |
@@ -102,7 +102,7 @@ set( CALAMARES_TRANSLATION_LANGUAGES ar ast bg ca cs_CZ da de el en en_GB es_MX
|
||||
### Bump version here
|
||||
set( CALAMARES_VERSION_MAJOR 2 )
|
||||
set( CALAMARES_VERSION_MINOR 4 )
|
||||
set( CALAMARES_VERSION_PATCH 5 )
|
||||
set( CALAMARES_VERSION_PATCH 6 )
|
||||
set( CALAMARES_VERSION_RC 0 )
|
||||
|
||||
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
|
||||
|
||||
@@ -6,7 +6,7 @@ function( calamares_add_plugin )
|
||||
set( NAME ${ARGV0} )
|
||||
set( options NO_INSTALL SHARED_LIB )
|
||||
set( oneValueArgs NAME TYPE EXPORT_MACRO RESOURCES )
|
||||
set( multiValueArgs SOURCES UI LINK_LIBRARIES COMPILE_DEFINITIONS )
|
||||
set( multiValueArgs SOURCES UI LINK_LIBRARIES LINK_PRIVATE_LIBRARIES COMPILE_DEFINITIONS )
|
||||
cmake_parse_arguments( PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
set( PLUGIN_NAME ${NAME} )
|
||||
set( PLUGIN_DESTINATION ${CMAKE_INSTALL_LIBDIR}/calamares/modules/${PLUGIN_NAME} )
|
||||
@@ -22,6 +22,7 @@ function( calamares_add_plugin )
|
||||
if( NOT CMAKE_BUILD_TYPE STREQUAL "Release" )
|
||||
message( " ${Green}TYPE:${ColorReset} ${PLUGIN_TYPE}" )
|
||||
message( " ${Green}LINK_LIBRARIES:${ColorReset} ${PLUGIN_LINK_LIBRARIES}" )
|
||||
message( " ${Green}LINK_PRIVATE_LIBRARIES:${ColorReset} ${PLUGIN_LINK_PRIVATE_LIBRARIES}" )
|
||||
# message( " ${Green}SOURCES:${ColorReset} ${PLUGIN_SOURCES}" )
|
||||
# message( " ${Green}UI:${ColorReset} ${PLUGIN_UI}" )
|
||||
# message( " ${Green}EXPORT_MACRO:${ColorReset} ${PLUGIN_EXPORT_MACRO}" )
|
||||
@@ -60,6 +61,10 @@ function( calamares_add_plugin )
|
||||
list( APPEND calamares_add_library_args "LINK_LIBRARIES" "${PLUGIN_LINK_LIBRARIES}" )
|
||||
endif()
|
||||
|
||||
if( PLUGIN_LINK_PRIVATE_LIBRARIES )
|
||||
list( APPEND calamares_add_library_args "LINK_PRIVATE_LIBRARIES" "${PLUGIN_LINK_PRIVATE_LIBRARIES}" )
|
||||
endif()
|
||||
|
||||
if( PLUGIN_COMPILE_DEFINITIONS )
|
||||
list( APPEND calamares_add_library_args "COMPILE_DEFINITIONS" ${PLUGIN_COMPILE_DEFINITIONS} )
|
||||
endif()
|
||||
|
||||
@@ -59,12 +59,12 @@ endif()
|
||||
|
||||
qt5_use_modules( calamares_bin Core Widgets )
|
||||
target_link_libraries( calamares_bin
|
||||
${CALAMARES_LIBRARIES}
|
||||
calamaresui
|
||||
Qt5::Core
|
||||
Qt5::Widgets
|
||||
yaml-cpp
|
||||
${LINK_LIBRARIES}
|
||||
PRIVATE
|
||||
${CALAMARES_LIBRARIES}
|
||||
calamaresui
|
||||
Qt5::Core
|
||||
Qt5::Widgets
|
||||
${LINK_LIBRARIES}
|
||||
)
|
||||
|
||||
install( TARGETS calamares_bin
|
||||
|
||||
@@ -43,10 +43,11 @@ calamares_add_library( ${CALAMARESUI_LIBRARY_TARGET}
|
||||
SOURCES ${${CALAMARESUI_LIBRARY_TARGET}_SOURCES}
|
||||
UI ${${CALAMARESUI_LIBRARY_TARGET}_UI}
|
||||
EXPORT_MACRO UIDLLEXPORT_PRO
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
yaml-cpp
|
||||
Qt5::Svg
|
||||
Qt5::QuickWidgets
|
||||
Qt5::QuickWidgets
|
||||
${OPTIONAL_PRIVATE_LIBRARIES}
|
||||
RESOURCES libcalamaresui.qrc
|
||||
EXPORT CalamaresLibraryDepends
|
||||
VERSION ${CALAMARES_VERSION_SHORT}
|
||||
|
||||
@@ -267,15 +267,13 @@ def set_autologin(username, displaymanagers, default_desktop_environment, root_m
|
||||
|
||||
if do_autologin:
|
||||
autologin_section['User'] = username
|
||||
elif 'User' in autologin_section:
|
||||
del autologin_section['User']
|
||||
|
||||
if default_desktop_environment is not None:
|
||||
autologin_section['Session'] = default_desktop_environment.desktop_file
|
||||
|
||||
if autologin_section:
|
||||
if 'Autologin' in sddm_config:
|
||||
sddm_config['Autologin'].update(autologin_section)
|
||||
else:
|
||||
sddm_config['Autologin'] = autologin_section
|
||||
sddm_config['Autologin'] = autologin_section
|
||||
|
||||
with open(sddm_conf_path, 'w') as sddm_config_file:
|
||||
sddm_config.write(sddm_config_file, space_around_delimiters=False)
|
||||
|
||||
@@ -3,7 +3,7 @@ calamares_add_plugin( dracutlukscfg
|
||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||
SOURCES
|
||||
DracutLuksCfgJob.cpp
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamares
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ calamares_add_plugin( dummycpp
|
||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||
SOURCES
|
||||
DummyCppJob.cpp
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamares
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ calamares_add_plugin( finished
|
||||
FinishedPage.cpp
|
||||
UI
|
||||
FinishedPage.ui
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ calamares_add_plugin( interactiveterminal
|
||||
SOURCES
|
||||
InteractiveTerminalViewStep.cpp
|
||||
InteractiveTerminalPage.cpp
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
KF5::Service
|
||||
KF5::Parts
|
||||
|
||||
@@ -14,7 +14,7 @@ calamares_add_plugin( keyboard
|
||||
KeyboardPage.ui
|
||||
RESOURCES
|
||||
keyboard.qrc
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -29,6 +29,7 @@ KeyboardViewStep::KeyboardViewStep( QObject* parent )
|
||||
: Calamares::ViewStep( parent )
|
||||
, m_widget( new KeyboardPage() )
|
||||
, m_nextEnabled( false )
|
||||
, m_writeEtcDefaultKeyboard( true )
|
||||
{
|
||||
m_widget->init();
|
||||
m_nextEnabled = true;
|
||||
|
||||
@@ -15,7 +15,7 @@ set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
||||
LicensePage.cpp
|
||||
UI
|
||||
LicensePage.ui
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -14,7 +14,9 @@ calamares_add_plugin( locale
|
||||
UI
|
||||
RESOURCES
|
||||
locale.qrc
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
Qt5::Network
|
||||
yaml-cpp
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -12,7 +12,9 @@ calamares_add_plugin( netinstall
|
||||
widgets/groupselectionwidget.ui
|
||||
RESOURCES
|
||||
netinstall.qrc
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
Qt5::Network
|
||||
yaml-cpp
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -11,6 +11,13 @@ find_package( KF5 REQUIRED CoreAddons )
|
||||
find_package( KF5 REQUIRED Config I18n IconThemes KIO Service )
|
||||
|
||||
find_package( KPMcore 2.2 REQUIRED )
|
||||
if(KPMcore_VERSION VERSION_LESS 3.0.0)
|
||||
set(WITH_KPMCORE3 OFF)
|
||||
else()
|
||||
set(WITH_KPMCORE3 ON)
|
||||
endif()
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/PartitionConfig.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PartitionConfig.h )
|
||||
|
||||
add_subdirectory( tests )
|
||||
|
||||
@@ -66,7 +73,7 @@ calamares_add_plugin( partition
|
||||
gui/EncryptWidget.ui
|
||||
gui/PartitionPage.ui
|
||||
gui/ReplaceWidget.ui
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
kpmcore
|
||||
calamaresui
|
||||
KF5::CoreAddons
|
||||
|
||||
6
src/modules/partition/PartitionConfig.h.in
Normal file
6
src/modules/partition/PartitionConfig.h.in
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef CALAMARESPARTITIONCONFIG_H
|
||||
#define CALAMARESPARTITIONCONFIG_H
|
||||
|
||||
#cmakedefine WITH_KPMCORE3
|
||||
|
||||
#endif // CALAMARESPARTITIONCONFIG_H
|
||||
@@ -151,6 +151,12 @@ createNewEncryptedPartition( PartitionNode* parent,
|
||||
FileSystemFactory::create( FileSystem::Luks,
|
||||
firstSector,
|
||||
lastSector ) );
|
||||
if ( !fs )
|
||||
{
|
||||
qDebug() << "ERROR: cannot create LUKS filesystem. Giving up.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
fs->createInnerFileSystem( fsType );
|
||||
fs->setPassphrase( passphrase );
|
||||
Partition* p = new Partition( parent,
|
||||
|
||||
@@ -51,8 +51,9 @@ canBeReplaced( Partition* candidate )
|
||||
qint64 requiredStorageB = ( requiredStorageGB + 0.5 ) * 1024 * 1024 * 1024;
|
||||
cDebug() << "Required storage B:" << requiredStorageB
|
||||
<< QString( "(%1GB)" ).arg( requiredStorageB / 1024 / 1024 / 1024 );
|
||||
cDebug() << "Available storage B:" << availableStorageB
|
||||
<< QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 );
|
||||
cDebug() << "Storage capacity B:" << availableStorageB
|
||||
<< QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 )
|
||||
<< "for" << candidate->partitionPath() << " length:" << candidate->length();
|
||||
|
||||
if ( ok &&
|
||||
availableStorageB > requiredStorageB )
|
||||
@@ -102,7 +103,9 @@ canBeResized( Partition* candidate )
|
||||
cDebug() << "Required storage B:" << requiredStorageB
|
||||
<< QString( "(%1GB)" ).arg( requiredStorageB / 1024 / 1024 / 1024 );
|
||||
cDebug() << "Available storage B:" << availableStorageB
|
||||
<< QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 );
|
||||
<< QString( "(%1GB)" ).arg( availableStorageB / 1024 / 1024 / 1024 )
|
||||
<< "for" << candidate->partitionPath() << " length:" << candidate->length()
|
||||
<< " sectorsUsed:" << candidate->sectorsUsed() << " fsType:" << candidate->fileSystem().name();
|
||||
|
||||
if ( ok &&
|
||||
availableStorageB > requiredStorageB )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "JobQueue.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "GlobalStorage.h"
|
||||
#include "PartitionConfig.h"
|
||||
|
||||
#include <kpmcore/core/device.h>
|
||||
#include <kpmcore/core/partition.h>
|
||||
@@ -128,11 +129,19 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
empty_space_size = 1;
|
||||
}
|
||||
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 firstFreeSector = empty_space_size MiB / dev->logicalSize() + 1;
|
||||
#else
|
||||
qint64 firstFreeSector = empty_space_size MiB / dev->logicalSectorSize() + 1;
|
||||
#endif
|
||||
|
||||
if ( isEfi )
|
||||
{
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 lastSector = firstFreeSector + ( uefisys_part_size MiB / dev->logicalSize() );
|
||||
#else
|
||||
qint64 lastSector = firstFreeSector + ( uefisys_part_size MiB / dev->logicalSectorSize() );
|
||||
#endif
|
||||
core->createPartitionTable( dev, PartitionTable::gpt );
|
||||
Partition* efiPartition = KPMHelpers::createNewPartition(
|
||||
dev->partitionTable(),
|
||||
@@ -148,7 +157,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
->globalStorage()
|
||||
->value( "efiSystemPartition" )
|
||||
.toString() );
|
||||
core->createPartition( dev, efiPartition );
|
||||
core->createPartition( dev, efiPartition, PartitionTable::FlagEsp | PartitionTable::FlagBoot );
|
||||
firstFreeSector = lastSector + 1;
|
||||
}
|
||||
else
|
||||
@@ -157,7 +166,11 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
}
|
||||
|
||||
bool shouldCreateSwap = false;
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 availableSpaceB = ( dev->totalLogical() - firstFreeSector ) * dev->logicalSize();
|
||||
#else
|
||||
qint64 availableSpaceB = ( dev->totalSectors() - firstFreeSector ) * dev->logicalSectorSize();
|
||||
#endif
|
||||
qint64 suggestedSwapSizeB = swapSuggestion( availableSpaceB );
|
||||
qint64 requiredSpaceB =
|
||||
( Calamares::JobQueue::instance()->
|
||||
@@ -168,11 +181,19 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
// If there is enough room for ESP + root + swap, create swap, otherwise don't.
|
||||
shouldCreateSwap = availableSpaceB > requiredSpaceB;
|
||||
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 lastSectorForRoot = dev->totalLogical() - 1; //last sector of the device
|
||||
if ( shouldCreateSwap )
|
||||
{
|
||||
lastSectorForRoot -= suggestedSwapSizeB / dev->logicalSize() + 1;
|
||||
}
|
||||
#else
|
||||
qint64 lastSectorForRoot = dev->totalSectors() - 1; //last sector of the device
|
||||
if ( shouldCreateSwap )
|
||||
{
|
||||
lastSectorForRoot -= suggestedSwapSizeB / dev->logicalSectorSize() + 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
Partition* rootPartition = nullptr;
|
||||
if ( luksPassphrase.isEmpty() )
|
||||
@@ -213,7 +234,11 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
PartitionRole( PartitionRole::Primary ),
|
||||
FileSystem::LinuxSwap,
|
||||
lastSectorForRoot + 1,
|
||||
#ifdef WITH_KPMCORE3
|
||||
dev->totalLogical() - 1
|
||||
#else
|
||||
dev->totalSectors() - 1
|
||||
#endif
|
||||
);
|
||||
}
|
||||
else
|
||||
@@ -224,7 +249,11 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||
PartitionRole( PartitionRole::Primary ),
|
||||
FileSystem::LinuxSwap,
|
||||
lastSectorForRoot + 1,
|
||||
#ifdef WITH_KPMCORE3
|
||||
dev->totalLogical() - 1,
|
||||
#else
|
||||
dev->totalSectors() - 1,
|
||||
#endif
|
||||
luksPassphrase
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "core/PartitionInfo.h"
|
||||
#include "core/KPMHelpers.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "PartitionConfig.h"
|
||||
|
||||
// CalaPM
|
||||
#include <kpmcore/core/device.h>
|
||||
@@ -148,7 +149,11 @@ PartitionModel::data( const QModelIndex& index, int role ) const
|
||||
return PartitionInfo::mountPoint( partition );
|
||||
if ( col == SizeColumn )
|
||||
{
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSize();
|
||||
#else
|
||||
qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
|
||||
#endif
|
||||
return KFormat().formatByteSize( size );
|
||||
}
|
||||
cDebug() << "Unknown column" << col;
|
||||
@@ -175,12 +180,20 @@ PartitionModel::data( const QModelIndex& index, int role ) const
|
||||
}
|
||||
}
|
||||
QString prettyFileSystem = KPMHelpers::prettyNameForFileSystemType( partition->fileSystem().type() );
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSize();
|
||||
#else
|
||||
qint64 size = ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
|
||||
#endif
|
||||
QString prettySize = KFormat().formatByteSize( size );
|
||||
return QVariant(name + " " + prettyFileSystem + " " + prettySize);
|
||||
}
|
||||
case SizeRole:
|
||||
#ifdef WITH_KPMCORE3
|
||||
return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSize();
|
||||
#else
|
||||
return ( partition->lastSector() - partition->firstSector() + 1 ) * m_device->logicalSectorSize();
|
||||
#endif
|
||||
case IsFreeSpaceRole:
|
||||
return KPMHelpers::isPartitionFreeSpace( partition );
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "BootInfoWidget.h"
|
||||
#include "DeviceInfoWidget.h"
|
||||
#include "ScanningDialog.h"
|
||||
#include "PartitionConfig.h"
|
||||
|
||||
#include "utils/CalamaresUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
@@ -594,7 +595,11 @@ ChoicePage::doAlongsideApply()
|
||||
qint64 oldLastSector = candidate->lastSector();
|
||||
qint64 newLastSector = firstSector +
|
||||
m_afterPartitionSplitterWidget->splitPartitionSize() /
|
||||
#ifdef WITH_KPMCORE3
|
||||
dev->logicalSize();
|
||||
#else
|
||||
dev->logicalSectorSize();
|
||||
#endif
|
||||
|
||||
m_core->resizePartition( dev, candidate, firstSector, newLastSector );
|
||||
Partition* newPartition = nullptr;
|
||||
@@ -1106,7 +1111,7 @@ ChoicePage::createBootloaderComboBox( QWidget* parent )
|
||||
|
||||
// When the chosen bootloader device changes, we update the choice in the PCM
|
||||
connect( bcb, static_cast< void (QComboBox::*)(int) >( &QComboBox::currentIndexChanged ),
|
||||
[this]( int newIndex )
|
||||
this, [this]( int newIndex )
|
||||
{
|
||||
QComboBox* bcb = qobject_cast< QComboBox* >( sender() );
|
||||
if ( bcb )
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <core/PartitionModel.h>
|
||||
#include <core/ColorUtils.h>
|
||||
#include "PartitionConfig.h"
|
||||
|
||||
#include <utils/CalamaresUtilsGui.h>
|
||||
#include <utils/Logger.h>
|
||||
@@ -47,7 +48,11 @@ QStringList
|
||||
buildUnknownDisklabelTexts( Device* dev )
|
||||
{
|
||||
QStringList texts = { QObject::tr( "Unpartitioned space or unknown partition table" ),
|
||||
#ifdef WITH_KPMCORE3
|
||||
KFormat().formatByteSize( dev->totalLogical() * dev->logicalSize() ) };
|
||||
#else
|
||||
KFormat().formatByteSize( dev->totalSectors() * dev->logicalSectorSize() ) };
|
||||
#endif
|
||||
return texts;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "core/ColorUtils.h"
|
||||
#include "core/KPMHelpers.h"
|
||||
#include "PartitionConfig.h"
|
||||
|
||||
// Qt
|
||||
#include <QSpinBox>
|
||||
@@ -135,7 +136,11 @@ PartitionSizeController::updatePartResizerWidget()
|
||||
return;
|
||||
|
||||
m_updating = true;
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 sectorSize = qint64( m_spinBox->value() ) * 1024 * 1024 / m_device->logicalSize();
|
||||
#else
|
||||
qint64 sectorSize = qint64( m_spinBox->value() ) * 1024 * 1024 / m_device->logicalSectorSize();
|
||||
#endif
|
||||
|
||||
qint64 firstSector = m_partition->firstSector();
|
||||
qint64 lastSector = firstSector + sectorSize - 1;
|
||||
@@ -185,7 +190,11 @@ PartitionSizeController::doUpdateSpinBox()
|
||||
{
|
||||
if ( !m_spinBox )
|
||||
return;
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 mbSize = m_partition->length() * m_device->logicalSize() / 1024 / 1024;
|
||||
#else
|
||||
qint64 mbSize = m_partition->length() * m_device->logicalSectorSize() / 1024 / 1024;
|
||||
#endif
|
||||
m_spinBox->setValue( mbSize );
|
||||
if ( m_currentSpinBoxValue != -1 && //if it's not the first time we're setting it
|
||||
m_currentSpinBoxValue != mbSize ) //and the operation changes the SB value
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "core/KPMHelpers.h"
|
||||
#include "Branding.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "PartitionConfig.h"
|
||||
|
||||
// CalaPM
|
||||
#include <kpmcore/core/device.h>
|
||||
@@ -98,7 +99,11 @@ mapForPartition( Partition* partition, const QString& uuid )
|
||||
const FS::luks* luksFs = dynamic_cast< const FS::luks* >( &fsRef );
|
||||
if ( luksFs )
|
||||
{
|
||||
#ifdef WITH_KPMCORE3
|
||||
map[ "luksMapperName" ] = luksFs->mapperName().split( "/" ).last();
|
||||
#else
|
||||
map[ "luksMapperName" ] = luksFs->mapperName( partition->partitionPath() ).split( "/" ).last();
|
||||
#endif
|
||||
map[ "luksUuid" ] = getLuksUuid( partition->partitionPath() );
|
||||
map[ "luksPassphrase" ] = luksFs->passphrase();
|
||||
cDebug() << "luksMapperName:" << map[ "luksMapperName" ];
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "jobs/CheckFileSystemJob.h"
|
||||
#include "jobs/MoveFileSystemJob.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "PartitionConfig.h"
|
||||
|
||||
// KPMcore
|
||||
#include <kpmcore/backend/corebackend.h>
|
||||
@@ -93,7 +94,11 @@ public:
|
||||
break;
|
||||
case FileSystem::cmdSupportFileSystem:
|
||||
{
|
||||
#ifdef WITH_KPMCORE3
|
||||
qint64 byteLength = m_device->logicalSize() * m_length;
|
||||
#else
|
||||
qint64 byteLength = m_device->logicalSectorSize() * m_length;
|
||||
#endif
|
||||
bool ok = fs.resize( report, m_partition->partitionPath(), byteLength );
|
||||
if ( !ok )
|
||||
return Calamares::JobResult::error(
|
||||
|
||||
@@ -15,3 +15,6 @@ targets:
|
||||
disable:
|
||||
- name: "pacman-init"
|
||||
mandatory: false
|
||||
|
||||
# Example to express an empty list:
|
||||
# disable: []
|
||||
|
||||
@@ -6,7 +6,7 @@ calamares_add_plugin( summary
|
||||
SummaryViewStep.cpp
|
||||
SummaryPage.cpp
|
||||
UI
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ calamares_add_plugin( users
|
||||
page_usersetup.ui
|
||||
RESOURCES
|
||||
users.qrc
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
${CRYPT_LIBRARIES}
|
||||
SHARED_LIB
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Calamares is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -59,6 +59,20 @@ SetPasswordJob::exec()
|
||||
return Calamares::JobResult::error( tr( "Bad destination system path." ),
|
||||
tr( "rootMountPoint is %1" ).arg( destDir.absolutePath() ) );
|
||||
|
||||
if ( m_userName == "root" &&
|
||||
m_newPassword.isEmpty() ) //special case for disabling root account
|
||||
{
|
||||
int ec = CalamaresUtils::System::instance()->
|
||||
targetEnvCall( { "passwd",
|
||||
"-dl",
|
||||
m_userName } );
|
||||
if ( ec )
|
||||
return Calamares::JobResult::error( tr( "Cannot disable root account." ),
|
||||
tr( "passwd terminated with error code %1." )
|
||||
.arg( ec ) );
|
||||
return Calamares::JobResult::ok();
|
||||
}
|
||||
|
||||
QString encrypted = QString::fromLatin1(
|
||||
crypt( m_newPassword.toLatin1(),
|
||||
QString( "$6$%1$" )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
|
||||
*
|
||||
* Portions from the Manjaro Installation Framework
|
||||
* by Roland Singer <roland@manjaro.org>
|
||||
@@ -138,6 +138,12 @@ UsersPage::createJobs( const QStringList& defaultGroupsList )
|
||||
ui->textBoxRootPassword->text() );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
j = new SetPasswordJob( "root",
|
||||
"" ); //explicitly disable root password
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
}
|
||||
|
||||
j = new SetHostNameJob( ui->textBoxHostname->text() );
|
||||
list.append( Calamares::job_ptr( j ) );
|
||||
|
||||
@@ -44,7 +44,7 @@ calamares_add_plugin( webview
|
||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||
SOURCES
|
||||
WebViewStep.cpp
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
${CALA_WEBVIEW_LINK_LIBRARIES}
|
||||
SHARED_LIB
|
||||
)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <QWebView>
|
||||
#else
|
||||
#include <QWebEngineView>
|
||||
#include <QtWebEngine>
|
||||
#endif
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( WebViewStepFactory, registerPlugin<WebViewStep>(); )
|
||||
@@ -33,6 +34,9 @@ WebViewStep::WebViewStep( QObject* parent )
|
||||
: Calamares::ViewStep( parent )
|
||||
{
|
||||
emit nextStatusChanged( true );
|
||||
#ifdef WEBVIEW_WITH_WEBENGINE
|
||||
QtWebEngine::initialize();
|
||||
#endif
|
||||
m_view = new C_QWEBVIEW();
|
||||
#ifdef WEBVIEW_WITH_WEBKIT
|
||||
m_view->settings()->setFontFamily( QWebSettings::StandardFont,
|
||||
|
||||
@@ -26,7 +26,7 @@ calamares_add_plugin( welcome
|
||||
WelcomePage.cpp
|
||||
UI
|
||||
WelcomePage.ui
|
||||
LINK_LIBRARIES
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
${CHECKER_LINK_LIBRARIES}
|
||||
SHARED_LIB
|
||||
|
||||
@@ -338,7 +338,9 @@ bool
|
||||
RequirementsChecker::checkHasInternet()
|
||||
{
|
||||
// default to true in the QNetworkAccessManager::UnknownAccessibility case
|
||||
return QNetworkAccessManager(this).networkAccessible() != QNetworkAccessManager::NotAccessible;
|
||||
bool hasInternet = QNetworkAccessManager(this).networkAccessible() != QNetworkAccessManager::NotAccessible;
|
||||
Calamares::JobQueue::instance()->globalStorage()->insert( "hasInternet", hasInternet );
|
||||
return hasInternet;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user