Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
68dcbf95f3 | ||
![]() |
a672a4fdb9 | ||
![]() |
13507e81ad | ||
![]() |
f2fe7a83c6 | ||
![]() |
effc8b4496 | ||
![]() |
c0c51ad51d | ||
![]() |
9460e53233 | ||
![]() |
114bd6ae63 | ||
![]() |
77fb264129 | ||
![]() |
0c29233062 |
@@ -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
|
### Bump version here
|
||||||
set( CALAMARES_VERSION_MAJOR 2 )
|
set( CALAMARES_VERSION_MAJOR 2 )
|
||||||
set( CALAMARES_VERSION_MINOR 4 )
|
set( CALAMARES_VERSION_MINOR 4 )
|
||||||
set( CALAMARES_VERSION_PATCH 1 )
|
set( CALAMARES_VERSION_PATCH 2 )
|
||||||
set( CALAMARES_VERSION_RC 0 )
|
set( CALAMARES_VERSION_RC 0 )
|
||||||
|
|
||||||
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
|
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
|
||||||
|
@@ -220,15 +220,14 @@ def install_grub(efi_directory, fw_type):
|
|||||||
"--force"])
|
"--force"])
|
||||||
|
|
||||||
# VFAT is weird, see issue CAL-385
|
# VFAT is weird, see issue CAL-385
|
||||||
efi_directory_firmware = case_insensitive_subdir(efi_directory,
|
|
||||||
["EFI", "Efi", "efi"])
|
|
||||||
if not efi_directory_firmware:
|
|
||||||
efi_directory_firmware = os.path.join(efi_directory, "EFI")
|
efi_directory_firmware = os.path.join(efi_directory, "EFI")
|
||||||
|
if os.path.exists(efi_directory_firmware):
|
||||||
|
efi_directory_firmware = vfat_correct_case(efi_directory, "EFI")
|
||||||
|
|
||||||
efi_boot_directory = case_insensitive_subdir(efi_directory_firmware,
|
|
||||||
["Boot", "boot", "BOOT"])
|
|
||||||
if not efi_boot_directory:
|
|
||||||
efi_boot_directory = os.path.join(efi_directory_firmware, "boot")
|
efi_boot_directory = os.path.join(efi_directory_firmware, "boot")
|
||||||
|
if os.path.exists(efi_boot_directory):
|
||||||
|
efi_boot_directory = vfat_correct_case(efi_directory_firmware, "boot")
|
||||||
|
else:
|
||||||
check_target_env_call(["mkdir", "-p", efi_boot_directory])
|
check_target_env_call(["mkdir", "-p", efi_boot_directory])
|
||||||
|
|
||||||
# Workaround for some UEFI firmwares
|
# Workaround for some UEFI firmwares
|
||||||
@@ -251,11 +250,11 @@ def install_grub(efi_directory, fw_type):
|
|||||||
libcalamares.job.configuration["grubCfg"]])
|
libcalamares.job.configuration["grubCfg"]])
|
||||||
|
|
||||||
|
|
||||||
def case_insensitive_subdir(parent, candidate_dirnames):
|
def vfat_correct_case(parent, name):
|
||||||
for dirname in candidate_dirnames:
|
for candidate in os.listdir(parent):
|
||||||
if os.path.isdir(os.path.join(parent, dirname)):
|
if name.lower() == candidate.lower():
|
||||||
return os.path.join(parent, dirname)
|
return candidate
|
||||||
return ""
|
return os.path.join(parent, name)
|
||||||
|
|
||||||
|
|
||||||
def prepare_bootloader(fw_type):
|
def prepare_bootloader(fw_type):
|
||||||
|
@@ -202,7 +202,8 @@ KeyboardPage::prettyStatus() const
|
|||||||
|
|
||||||
QList< Calamares::job_ptr >
|
QList< Calamares::job_ptr >
|
||||||
KeyboardPage::createJobs( const QString& xOrgConfFileName,
|
KeyboardPage::createJobs( const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath )
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard )
|
||||||
{
|
{
|
||||||
QList< Calamares::job_ptr > list;
|
QList< Calamares::job_ptr > list;
|
||||||
QString selectedModel = m_models.value( ui->comboBoxModel->currentText(),
|
QString selectedModel = m_models.value( ui->comboBoxModel->currentText(),
|
||||||
@@ -212,7 +213,8 @@ KeyboardPage::createJobs( const QString& xOrgConfFileName,
|
|||||||
m_selectedLayout,
|
m_selectedLayout,
|
||||||
m_selectedVariant,
|
m_selectedVariant,
|
||||||
xOrgConfFileName,
|
xOrgConfFileName,
|
||||||
convertedKeymapPath );
|
convertedKeymapPath,
|
||||||
|
writeEtcDefaultKeyboard );
|
||||||
list.append( Calamares::job_ptr( j ) );
|
list.append( Calamares::job_ptr( j ) );
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
@@ -50,7 +50,8 @@ public:
|
|||||||
QString prettyStatus() const;
|
QString prettyStatus() const;
|
||||||
|
|
||||||
QList< Calamares::job_ptr > createJobs( const QString& xOrgConfFileName,
|
QList< Calamares::job_ptr > createJobs( const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath );
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard );
|
||||||
|
|
||||||
void onActivate();
|
void onActivate();
|
||||||
void finalize();
|
void finalize();
|
||||||
|
@@ -123,7 +123,9 @@ void
|
|||||||
KeyboardViewStep::onLeave()
|
KeyboardViewStep::onLeave()
|
||||||
{
|
{
|
||||||
m_widget->finalize();
|
m_widget->finalize();
|
||||||
m_jobs = m_widget->createJobs( m_xOrgConfFileName, m_convertedKeymapPath );
|
m_jobs = m_widget->createJobs( m_xOrgConfFileName,
|
||||||
|
m_convertedKeymapPath,
|
||||||
|
m_writeEtcDefaultKeyboard );
|
||||||
m_prettyStatus = m_widget->prettyStatus();
|
m_prettyStatus = m_widget->prettyStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,4 +159,14 @@ KeyboardViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
{
|
{
|
||||||
m_convertedKeymapPath = QString();
|
m_convertedKeymapPath = QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( configurationMap.contains( "writeEtcDefaultKeyboard" ) &&
|
||||||
|
configurationMap.value( "writeEtcDefaultKeyboard" ).type() == QVariant::Bool )
|
||||||
|
{
|
||||||
|
m_writeEtcDefaultKeyboard = configurationMap.value( "writeEtcDefaultKeyboard" ).toBool();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_writeEtcDefaultKeyboard = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -64,6 +64,7 @@ private:
|
|||||||
|
|
||||||
QString m_xOrgConfFileName;
|
QString m_xOrgConfFileName;
|
||||||
QString m_convertedKeymapPath;
|
QString m_convertedKeymapPath;
|
||||||
|
bool m_writeEtcDefaultKeyboard;
|
||||||
|
|
||||||
QList< Calamares::job_ptr > m_jobs;
|
QList< Calamares::job_ptr > m_jobs;
|
||||||
};
|
};
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||||
*
|
*
|
||||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
|
* Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
|
||||||
*
|
*
|
||||||
* Portions from systemd (localed.c):
|
* Portions from systemd (localed.c):
|
||||||
@@ -40,13 +40,15 @@ SetKeyboardLayoutJob::SetKeyboardLayoutJob( const QString& model,
|
|||||||
const QString& layout,
|
const QString& layout,
|
||||||
const QString& variant,
|
const QString& variant,
|
||||||
const QString& xOrgConfFileName,
|
const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath )
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard)
|
||||||
: Calamares::Job()
|
: Calamares::Job()
|
||||||
, m_model( model )
|
, m_model( model )
|
||||||
, m_layout( layout )
|
, m_layout( layout )
|
||||||
, m_variant( variant )
|
, m_variant( variant )
|
||||||
, m_xOrgConfFileName( xOrgConfFileName )
|
, m_xOrgConfFileName( xOrgConfFileName )
|
||||||
, m_convertedKeymapPath( convertedKeymapPath )
|
, m_convertedKeymapPath( convertedKeymapPath )
|
||||||
|
, m_writeEtcDefaultKeyboard( writeEtcDefaultKeyboard )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,6 +242,34 @@ SetKeyboardLayoutJob::writeX11Data( const QString& keyboardConfPath ) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
SetKeyboardLayoutJob::writeDefaultKeyboardData( const QString& defaultKeyboardPath ) const
|
||||||
|
{
|
||||||
|
QFile file( defaultKeyboardPath );
|
||||||
|
file.open( QIODevice::WriteOnly | QIODevice::Text );
|
||||||
|
QTextStream stream( &file );
|
||||||
|
|
||||||
|
stream << "# KEYBOARD CONFIGURATION FILE\n\n"
|
||||||
|
"# Consult the keyboard(5) manual page.\n\n";
|
||||||
|
|
||||||
|
stream << "XKBMODEL=\"" << m_model << "\"\n";
|
||||||
|
stream << "XKBLAYOUT=\"" << m_layout << "\"\n";
|
||||||
|
stream << "XKBVARIANT=\"" << m_variant << "\"\n";
|
||||||
|
stream << "XKBOPTIONS=\"\"\n\n";
|
||||||
|
stream << "BACKSPACE=\"guess\"\n";
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
|
||||||
|
cDebug() << "Written XKBMODEL" << m_model <<
|
||||||
|
"; XKBLAYOUT" << m_layout <<
|
||||||
|
"; XKBVARIANT" << m_variant <<
|
||||||
|
"to /etc/default/keyboard file" << defaultKeyboardPath;
|
||||||
|
|
||||||
|
return ( stream.status() == QTextStream::Ok );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Calamares::JobResult
|
Calamares::JobResult
|
||||||
SetKeyboardLayoutJob::exec()
|
SetKeyboardLayoutJob::exec()
|
||||||
{
|
{
|
||||||
@@ -271,6 +301,12 @@ SetKeyboardLayoutJob::exec()
|
|||||||
}
|
}
|
||||||
destDir.mkpath( xorgConfDPath );
|
destDir.mkpath( xorgConfDPath );
|
||||||
|
|
||||||
|
QString defaultKeyboardPath;
|
||||||
|
if ( QDir( destDir.absoluteFilePath( "etc/default" ) ).exists() )
|
||||||
|
{
|
||||||
|
defaultKeyboardPath = destDir.absoluteFilePath( "etc/default/keyboard" );
|
||||||
|
}
|
||||||
|
|
||||||
// Get the path to the destination's path to the converted key mappings
|
// Get the path to the destination's path to the converted key mappings
|
||||||
QString convertedKeymapPath = m_convertedKeymapPath;
|
QString convertedKeymapPath = m_convertedKeymapPath;
|
||||||
if ( !convertedKeymapPath.isEmpty() )
|
if ( !convertedKeymapPath.isEmpty() )
|
||||||
@@ -288,5 +324,12 @@ SetKeyboardLayoutJob::exec()
|
|||||||
return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for X11." ),
|
return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for X11." ),
|
||||||
tr( "Failed to write to %1" ).arg( keyboardConfPath ) );
|
tr( "Failed to write to %1" ).arg( keyboardConfPath ) );
|
||||||
|
|
||||||
|
if ( !defaultKeyboardPath.isEmpty() && m_writeEtcDefaultKeyboard )
|
||||||
|
{
|
||||||
|
if ( !writeDefaultKeyboardData( defaultKeyboardPath ) )
|
||||||
|
return Calamares::JobResult::error( tr( "Failed to write keyboard configuration to existing /etc/default directory." ),
|
||||||
|
tr( "Failed to write to %1" ).arg( keyboardConfPath ) );
|
||||||
|
}
|
||||||
|
|
||||||
return Calamares::JobResult::ok();
|
return Calamares::JobResult::ok();
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||||
*
|
*
|
||||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
|
||||||
* Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
|
* Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
@@ -31,7 +31,8 @@ public:
|
|||||||
const QString& layout,
|
const QString& layout,
|
||||||
const QString& variant,
|
const QString& variant,
|
||||||
const QString& xOrgConfFileName,
|
const QString& xOrgConfFileName,
|
||||||
const QString& convertedKeymapPath );
|
const QString& convertedKeymapPath,
|
||||||
|
bool writeEtcDefaultKeyboard );
|
||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
Calamares::JobResult exec() override;
|
Calamares::JobResult exec() override;
|
||||||
@@ -42,12 +43,14 @@ private:
|
|||||||
bool writeVConsoleData( const QString& vconsoleConfPath,
|
bool writeVConsoleData( const QString& vconsoleConfPath,
|
||||||
const QString& convertedKeymapPath ) const;
|
const QString& convertedKeymapPath ) const;
|
||||||
bool writeX11Data( const QString& keyboardConfPath ) const;
|
bool writeX11Data( const QString& keyboardConfPath ) const;
|
||||||
|
bool writeDefaultKeyboardData( const QString& defaultKeyboardPath ) const;
|
||||||
|
|
||||||
QString m_model;
|
QString m_model;
|
||||||
QString m_layout;
|
QString m_layout;
|
||||||
QString m_variant;
|
QString m_variant;
|
||||||
QString m_xOrgConfFileName;
|
QString m_xOrgConfFileName;
|
||||||
QString m_convertedKeymapPath;
|
QString m_convertedKeymapPath;
|
||||||
|
const bool m_writeEtcDefaultKeyboard;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SETKEYBOARDLAYOUTJOB_H */
|
#endif /* SETKEYBOARDLAYOUTJOB_H */
|
||||||
|
@@ -3,6 +3,12 @@
|
|||||||
# The default value is the name used by upstream systemd-localed.
|
# The default value is the name used by upstream systemd-localed.
|
||||||
# Relative paths are assumed to be relative to /etc/X11/xorg.conf.d
|
# Relative paths are assumed to be relative to /etc/X11/xorg.conf.d
|
||||||
xOrgConfFileName: "/etc/X11/xorg.conf.d/00-keyboard.conf"
|
xOrgConfFileName: "/etc/X11/xorg.conf.d/00-keyboard.conf"
|
||||||
|
|
||||||
# The path to search for keymaps converted from X11 to kbd format
|
# The path to search for keymaps converted from X11 to kbd format
|
||||||
# Leave this empty if the setting does not make sense on your distribution.
|
# Leave this empty if the setting does not make sense on your distribution.
|
||||||
convertedKeymapPath: "/lib/kbd/keymaps/xkb"
|
convertedKeymapPath: "/lib/kbd/keymaps/xkb"
|
||||||
|
|
||||||
|
# Write keymap configuration to /etc/default/keyboard, usually
|
||||||
|
# found on Debian-related systems.
|
||||||
|
# Defaults to true if nothing is set.
|
||||||
|
#writeEtcDefaultKeyboard: true
|
||||||
|
@@ -60,7 +60,8 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
|
|||||||
// FIXME: this might be useless if we already filter out non-UTF8 locales
|
// FIXME: this might be useless if we already filter out non-UTF8 locales
|
||||||
foreach ( QString line, linesForLanguage )
|
foreach ( QString line, linesForLanguage )
|
||||||
{
|
{
|
||||||
if ( line.contains( "UTF-8" ) )
|
if ( line.contains( "UTF-8", Qt::CaseInsensitive ) ||
|
||||||
|
line.contains( "utf8", Qt::CaseInsensitive ) )
|
||||||
linesForLanguageUtf.append( line );
|
linesForLanguageUtf.append( line );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -365,7 +365,8 @@ LocalePage::init( const QString& initialRegion,
|
|||||||
// because it's not 1995.
|
// because it's not 1995.
|
||||||
for ( auto it = m_localeGenLines.begin(); it != m_localeGenLines.end(); )
|
for ( auto it = m_localeGenLines.begin(); it != m_localeGenLines.end(); )
|
||||||
{
|
{
|
||||||
if ( !it->contains( "UTF-8", Qt::CaseInsensitive ) )
|
if ( !it->contains( "UTF-8", Qt::CaseInsensitive ) &&
|
||||||
|
!it->contains( "utf8", Qt::CaseInsensitive ) )
|
||||||
it = m_localeGenLines.erase( it );
|
it = m_localeGenLines.erase( it );
|
||||||
else
|
else
|
||||||
++it;
|
++it;
|
||||||
|
@@ -57,6 +57,10 @@ def run():
|
|||||||
source_resolv = "/etc/resolv.conf"
|
source_resolv = "/etc/resolv.conf"
|
||||||
target_resolv = os.path.join(root_mount_point, "etc/resolv.conf")
|
target_resolv = os.path.join(root_mount_point, "etc/resolv.conf")
|
||||||
if source_resolv != target_resolv and os.path.exists(source_resolv):
|
if source_resolv != target_resolv and os.path.exists(source_resolv):
|
||||||
|
try:
|
||||||
|
os.remove(target_resolv)
|
||||||
|
except FileNotFoundError:
|
||||||
|
libcalamares.utils.debug("Couldn't remove {}".format(target_resolv))
|
||||||
try:
|
try:
|
||||||
shutil.copy(source_resolv, target_resolv)
|
shutil.copy(source_resolv, target_resolv)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
@@ -82,12 +82,16 @@ ChoicePage::ChoicePage( QWidget* parent )
|
|||||||
, m_beforePartitionLabelsView( nullptr )
|
, m_beforePartitionLabelsView( nullptr )
|
||||||
, m_bootloaderComboBox( nullptr )
|
, m_bootloaderComboBox( nullptr )
|
||||||
, m_lastSelectedDeviceIndex( -1 )
|
, m_lastSelectedDeviceIndex( -1 )
|
||||||
|
, m_enableEncryptionWidget( true )
|
||||||
{
|
{
|
||||||
setupUi( this );
|
setupUi( this );
|
||||||
|
|
||||||
m_defaultFsType = Calamares::JobQueue::instance()->
|
m_defaultFsType = Calamares::JobQueue::instance()->
|
||||||
globalStorage()->
|
globalStorage()->
|
||||||
value( "defaultFileSystemType" ).toString();
|
value( "defaultFileSystemType" ).toString();
|
||||||
|
m_enableEncryptionWidget = Calamares::JobQueue::instance()->
|
||||||
|
globalStorage()->
|
||||||
|
value( "enableLuksAutomatedPartitioning" ).toBool();
|
||||||
if ( FileSystem::typeForName( m_defaultFsType ) == FileSystem::Unknown )
|
if ( FileSystem::typeForName( m_defaultFsType ) == FileSystem::Unknown )
|
||||||
m_defaultFsType = "ext4";
|
m_defaultFsType = "ext4";
|
||||||
|
|
||||||
@@ -884,6 +888,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
|
|||||||
{
|
{
|
||||||
case Alongside:
|
case Alongside:
|
||||||
{
|
{
|
||||||
|
if ( m_enableEncryptionWidget )
|
||||||
m_encryptWidget->show();
|
m_encryptWidget->show();
|
||||||
m_previewBeforeLabel->setText( tr( "Current:" ) );
|
m_previewBeforeLabel->setText( tr( "Current:" ) );
|
||||||
m_selectLabel->setText( tr( "<strong>Select a partition to shrink, "
|
m_selectLabel->setText( tr( "<strong>Select a partition to shrink, "
|
||||||
@@ -930,6 +935,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
|
|||||||
case Erase:
|
case Erase:
|
||||||
case Replace:
|
case Replace:
|
||||||
{
|
{
|
||||||
|
if ( m_enableEncryptionWidget )
|
||||||
m_encryptWidget->show();
|
m_encryptWidget->show();
|
||||||
m_previewBeforeLabel->setText( tr( "Current:" ) );
|
m_previewBeforeLabel->setText( tr( "Current:" ) );
|
||||||
m_afterPartitionBarsView = new PartitionBarsView( m_previewAfterFrame );
|
m_afterPartitionBarsView = new PartitionBarsView( m_previewAfterFrame );
|
||||||
|
@@ -123,6 +123,7 @@ private:
|
|||||||
int m_lastSelectedDeviceIndex;
|
int m_lastSelectedDeviceIndex;
|
||||||
|
|
||||||
QString m_defaultFsType;
|
QString m_defaultFsType;
|
||||||
|
bool m_enableEncryptionWidget;
|
||||||
|
|
||||||
QMutex m_coreMutex;
|
QMutex m_coreMutex;
|
||||||
};
|
};
|
||||||
|
@@ -250,6 +250,8 @@ PartitionViewStep::createSummaryWidget() const
|
|||||||
previewLabels->setModel( info.partitionModelAfter );
|
previewLabels->setModel( info.partitionModelAfter );
|
||||||
preview->setSelectionMode( QAbstractItemView::NoSelection );
|
preview->setSelectionMode( QAbstractItemView::NoSelection );
|
||||||
previewLabels->setSelectionMode( QAbstractItemView::NoSelection );
|
previewLabels->setSelectionMode( QAbstractItemView::NoSelection );
|
||||||
|
previewLabels->setCustomNewRootLabel( Calamares::Branding::instance()->
|
||||||
|
string( Calamares::Branding::BootloaderEntryName ) );
|
||||||
info.partitionModelAfter->setParent( widget );
|
info.partitionModelAfter->setParent( widget );
|
||||||
field = new QVBoxLayout;
|
field = new QVBoxLayout;
|
||||||
CalamaresUtils::unmarginLayout( field );
|
CalamaresUtils::unmarginLayout( field );
|
||||||
@@ -508,6 +510,17 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
gs->insert( "defaultFileSystemType", QStringLiteral( "ext4" ) );
|
gs->insert( "defaultFileSystemType", QStringLiteral( "ext4" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( configurationMap.contains( "enableLuksAutomatedPartitioning" ) &&
|
||||||
|
configurationMap.value( "enableLuksAutomatedPartitioning" ).type() == QVariant::Bool )
|
||||||
|
{
|
||||||
|
gs->insert( "enableLuksAutomatedPartitioning",
|
||||||
|
configurationMap.value( "enableLuksAutomatedPartitioning" ).toBool() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gs->insert( "enableLuksAutomatedPartitioning", true );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Now that we have the config, we load the PartitionCoreModule in the background
|
// Now that we have the config, we load the PartitionCoreModule in the background
|
||||||
// because it could take a while. Then when it's done, we can set up the widgets
|
// because it could take a while. Then when it's done, we can set up the widgets
|
||||||
|
@@ -18,3 +18,23 @@ alwaysShowPartitionLabels: true
|
|||||||
# Suggested values: ext2, ext3, ext4, reiser, xfs, jfs, btrfs
|
# Suggested values: ext2, ext3, ext4, reiser, xfs, jfs, btrfs
|
||||||
# If nothing is specified, Calamares defaults to "ext4".
|
# If nothing is specified, Calamares defaults to "ext4".
|
||||||
defaultFileSystemType: "ext4"
|
defaultFileSystemType: "ext4"
|
||||||
|
|
||||||
|
# Show/hide LUKS related functionality in automated partitioning modes.
|
||||||
|
# Disable this if you choose not to deploy early unlocking support in GRUB2
|
||||||
|
# and/or your distribution's initramfs solution.
|
||||||
|
#
|
||||||
|
# BIG FAT WARNING:
|
||||||
|
# This option is unsupported, as it cuts out a crucial security feature.
|
||||||
|
# Disabling LUKS and shipping Calamares without a correctly configured GRUB2
|
||||||
|
# and initramfs is considered suboptimal use of the Calamares software. The
|
||||||
|
# Calamares team will not provide user support for any potential issue that
|
||||||
|
# may arise as a consequence of setting this option to false.
|
||||||
|
# It is strongly recommended that system integrators put in the work to support
|
||||||
|
# LUKS unlocking support in GRUB2 and initramfs/dracut/mkinitcpio/etc.
|
||||||
|
# Support is offered to system integrators that wish to do so, through the
|
||||||
|
# Calamares bug tracker, as well as in #calamares on Freenode.
|
||||||
|
# For more information on setting up GRUB2 for Calamares with LUKS, see
|
||||||
|
# https://github.com/calamares/calamares/wiki/LUKS-Deployment
|
||||||
|
#
|
||||||
|
# If nothing is specified, LUKS is enabled in automated modes.
|
||||||
|
#enableLuksAutomatedPartitioning: true
|
||||||
|
@@ -155,6 +155,8 @@ CreateUserJob::exec()
|
|||||||
"-U",
|
"-U",
|
||||||
"-G",
|
"-G",
|
||||||
defaultGroups,
|
defaultGroups,
|
||||||
|
"-c",
|
||||||
|
m_fullName,
|
||||||
m_userName } );
|
m_userName } );
|
||||||
if ( ec )
|
if ( ec )
|
||||||
return Calamares::JobResult::error( tr( "Cannot create user %1." )
|
return Calamares::JobResult::error( tr( "Cannot create user %1." )
|
||||||
@@ -162,13 +164,6 @@ CreateUserJob::exec()
|
|||||||
tr( "useradd terminated with error code %1." )
|
tr( "useradd terminated with error code %1." )
|
||||||
.arg( ec ) );
|
.arg( ec ) );
|
||||||
|
|
||||||
ec = CalamaresUtils::System::instance()->targetEnvCall( { "chfn", "-f", m_fullName, m_userName } );
|
|
||||||
if ( ec )
|
|
||||||
return Calamares::JobResult::error( tr( "Cannot set full name for user %1." )
|
|
||||||
.arg( m_userName ),
|
|
||||||
tr( "chfn terminated with error code %1." )
|
|
||||||
.arg( ec ) );
|
|
||||||
|
|
||||||
ec = CalamaresUtils::System::instance()->
|
ec = CalamaresUtils::System::instance()->
|
||||||
targetEnvCall( { "chown",
|
targetEnvCall( { "chown",
|
||||||
"-R",
|
"-R",
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "WelcomePage.h"
|
#include "WelcomePage.h"
|
||||||
#include "checker/RequirementsChecker.h"
|
#include "checker/RequirementsChecker.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
@@ -128,5 +129,8 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
if ( configurationMap.contains( "requirements" ) &&
|
if ( configurationMap.contains( "requirements" ) &&
|
||||||
configurationMap.value( "requirements" ).type() == QVariant::Map )
|
configurationMap.value( "requirements" ).type() == QVariant::Map )
|
||||||
m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() );
|
m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() );
|
||||||
|
else
|
||||||
|
cDebug() << "WARNING: no valid requirements map found in welcome "
|
||||||
|
"module configuration.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -185,6 +185,7 @@ RequirementsChecker::widget() const
|
|||||||
void
|
void
|
||||||
RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{
|
{
|
||||||
|
bool incompleteConfiguration = false;
|
||||||
if ( configurationMap.contains( "requiredStorage" ) &&
|
if ( configurationMap.contains( "requiredStorage" ) &&
|
||||||
( configurationMap.value( "requiredStorage" ).type() == QVariant::Double ||
|
( configurationMap.value( "requiredStorage" ).type() == QVariant::Double ||
|
||||||
configurationMap.value( "requiredStorage" ).type() == QVariant::Int ) )
|
configurationMap.value( "requiredStorage" ).type() == QVariant::Int ) )
|
||||||
@@ -199,6 +200,7 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_requiredStorageGB = 3.;
|
m_requiredStorageGB = 3.;
|
||||||
|
incompleteConfiguration = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( configurationMap.contains( "requiredRam" ) &&
|
if ( configurationMap.contains( "requiredRam" ) &&
|
||||||
@@ -208,11 +210,15 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
m_requiredRamGB = configurationMap.value( "requiredRam" ).toDouble( &ok );
|
m_requiredRamGB = configurationMap.value( "requiredRam" ).toDouble( &ok );
|
||||||
if ( !ok )
|
if ( !ok )
|
||||||
|
{
|
||||||
m_requiredRamGB = 1.;
|
m_requiredRamGB = 1.;
|
||||||
|
incompleteConfiguration = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_requiredRamGB = 1.;
|
m_requiredRamGB = 1.;
|
||||||
|
incompleteConfiguration = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( configurationMap.contains( "check" ) &&
|
if ( configurationMap.contains( "check" ) &&
|
||||||
@@ -221,6 +227,8 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
m_entriesToCheck.clear();
|
m_entriesToCheck.clear();
|
||||||
m_entriesToCheck.append( configurationMap.value( "check" ).toStringList() );
|
m_entriesToCheck.append( configurationMap.value( "check" ).toStringList() );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
incompleteConfiguration = true;
|
||||||
|
|
||||||
if ( configurationMap.contains( "required" ) &&
|
if ( configurationMap.contains( "required" ) &&
|
||||||
configurationMap.value( "required" ).type() == QVariant::List )
|
configurationMap.value( "required" ).type() == QVariant::List )
|
||||||
@@ -228,6 +236,19 @@ RequirementsChecker::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
m_entriesToRequire.clear();
|
m_entriesToRequire.clear();
|
||||||
m_entriesToRequire.append( configurationMap.value( "required" ).toStringList() );
|
m_entriesToRequire.append( configurationMap.value( "required" ).toStringList() );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
incompleteConfiguration = true;
|
||||||
|
|
||||||
|
if ( incompleteConfiguration )
|
||||||
|
{
|
||||||
|
cDebug() << "WARNING: The RequirementsChecker configuration map provided by "
|
||||||
|
"the welcome module configuration file is incomplete or "
|
||||||
|
"incorrect.\n"
|
||||||
|
"Startup will continue for debugging purposes, but one or "
|
||||||
|
"more checks might not function correctly.\n"
|
||||||
|
"RequirementsChecker configuration map:\n"
|
||||||
|
<< configurationMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user