From 7fd0ad57956f55176df610e91617eda1676f84e7 Mon Sep 17 00:00:00 2001 From: Caio Carvalho Date: Mon, 13 Aug 2018 09:51:35 -0300 Subject: [PATCH 01/14] [partition] Disabling partition buttons for inactive RAID. --- src/modules/partition/gui/PartitionPage.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index 994adc3e8..f23eecd6e 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -4,6 +4,7 @@ * Copyright 2015-2016, Teo Mrnjavac * Copyright 2018, Adriaan de Groot * Copyright 2018, Andrius Štikonas + * Copyright 2018, Caio Jordão Carvalho * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,6 +48,7 @@ // KPMcore #include #include +#include #include #include @@ -146,6 +148,7 @@ PartitionPage::updateButtons() bool isInVG = m_core->isInVG( partition ); create = isFree; + // Keep it simple for now: do not support editing extended partitions as // it does not work with our current edit implementation which is // actually remove + add. This would not work with extended partitions @@ -160,8 +163,17 @@ PartitionPage::updateButtons() if ( m_ui->deviceComboBox->currentIndex() >= 0 ) { QModelIndex deviceIndex = m_core->deviceModel()->index( m_ui->deviceComboBox->currentIndex(), 0 ); - if ( m_core->deviceModel()->deviceForIndex( deviceIndex )->type() != Device::Type::LVM_Device ) + auto device = m_core->deviceModel()->deviceForIndex( deviceIndex ); + if ( device->type() != Device::Type::LVM_Device ) + { createTable = true; + + if ( device->type() == Device::Type::SoftwareRAID_Device && + static_cast< SoftwareRAID* >(device)->status() == SoftwareRAID::Status::Inactive ) { + createTable = false; + create = false; + } + } else { currentDeviceIsVG = true; From b5a2a5bbdd8020fd4f9663c02a5382ea9d74a4ef Mon Sep 17 00:00:00 2001 From: Caio Carvalho Date: Mon, 13 Aug 2018 12:26:00 -0300 Subject: [PATCH 02/14] [partition] Don't show erase button for inactive RAID. --- src/modules/partition/gui/ChoicePage.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index bef6e4966..17f0a95ea 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -1182,6 +1183,11 @@ ChoicePage::setupActions() bool atLeastOneCanBeResized = false; bool atLeastOneCanBeReplaced = false; bool atLeastOneIsMounted = false; // Suppress 'erase' if so + bool isInactiveRAID = false; + + if ( currentDevice->type() == Device::Type::SoftwareRAID_Device && + static_cast< SoftwareRAID* >(currentDevice)->status() == SoftwareRAID::Status::Inactive ) + isInactiveRAID = true; for ( auto it = PartitionIterator::begin( currentDevice ); it != PartitionIterator::end( currentDevice ); ++it ) @@ -1305,7 +1311,7 @@ ChoicePage::setupActions() else force_uncheck( m_grp, m_alongsideButton ); - if ( !atLeastOneIsMounted ) + if ( !atLeastOneIsMounted && !isInactiveRAID ) m_eraseButton->show(); // None mounted else force_uncheck( m_grp, m_eraseButton ); From 01a972c6ea6704c1c2f0f252f7ff4c2296029e07 Mon Sep 17 00:00:00 2001 From: Caio Carvalho Date: Mon, 13 Aug 2018 13:05:41 -0300 Subject: [PATCH 03/14] [partition] Fixing LVM LV name line edit visibility. --- src/modules/partition/gui/CreatePartitionDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/partition/gui/CreatePartitionDialog.cpp b/src/modules/partition/gui/CreatePartitionDialog.cpp index 0e7602c08..7823d743d 100644 --- a/src/modules/partition/gui/CreatePartitionDialog.cpp +++ b/src/modules/partition/gui/CreatePartitionDialog.cpp @@ -72,7 +72,7 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par m_ui->encryptWidget->setText( tr( "En&crypt" ) ); m_ui->encryptWidget->hide(); - if (m_device->type() == Device::Type::Disk_Device) { + if (m_device->type() != Device::Type::LVM_Device) { m_ui->lvNameLabel->hide(); m_ui->lvNameLineEdit->hide(); } From f6aaa4b73a3eb74f454eb75ef4570f8631be8350 Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Thu, 13 Sep 2018 17:16:35 +0200 Subject: [PATCH 04/14] .gitattributes sorted and completed --- .gitattributes | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitattributes b/.gitattributes index d7a0364e1..772fc7ad3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,13 @@ -.tx/* export-ignore -hacking/* export-ignore -HACKING.md export-ignore -.editorconfig export-ignore -src/modules/testmodule.py export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.github export-ignore +.gitignore export-ignore +.gitmodules export-ignore +.travis.yml export-ignore +.tx export-ignore + +hacking export-ignore +HACKING.md export-ignore +src/modules/testmodule.py export-ignore src/modules/globalStorage.yaml export-ignore + From 4b87bb6f280507944dfc39f18e9ec1a21d7f9d82 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 14 Sep 2018 18:07:09 +0200 Subject: [PATCH 05/14] Git: drop non-existent files from .gitattributes --- .gitattributes | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 772fc7ad3..3b8a7f1e8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,8 +6,6 @@ .travis.yml export-ignore .tx export-ignore -hacking export-ignore -HACKING.md export-ignore src/modules/testmodule.py export-ignore src/modules/globalStorage.yaml export-ignore From e3bf9fc2204427b1a2060043d6919aa001f15326 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Sep 2018 16:19:05 -0400 Subject: [PATCH 06/14] [partition] Fix build with KPMCore <= 3.3.0 - Reported by Philip Mueller --- src/modules/partition/gui/ChoicePage.cpp | 4 ++++ src/modules/partition/gui/PartitionPage.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 17f0a95ea..abe7795c0 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -48,7 +48,9 @@ #include #include +#ifdef WITH_KPMCOREGT33 #include +#endif #include #include @@ -1185,9 +1187,11 @@ ChoicePage::setupActions() bool atLeastOneIsMounted = false; // Suppress 'erase' if so bool isInactiveRAID = false; +#ifdef WITH_KPMCOREGT33 if ( currentDevice->type() == Device::Type::SoftwareRAID_Device && static_cast< SoftwareRAID* >(currentDevice)->status() == SoftwareRAID::Status::Inactive ) isInactiveRAID = true; +#endif for ( auto it = PartitionIterator::begin( currentDevice ); it != PartitionIterator::end( currentDevice ); ++it ) diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index f23eecd6e..9d972c8fd 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -48,7 +48,9 @@ // KPMcore #include #include +#ifdef WITH_KPMCOREGT33 #include +#endif #include #include @@ -168,11 +170,14 @@ PartitionPage::updateButtons() { createTable = true; +#ifdef WITH_KPMCOREGT33 if ( device->type() == Device::Type::SoftwareRAID_Device && - static_cast< SoftwareRAID* >(device)->status() == SoftwareRAID::Status::Inactive ) { + static_cast< SoftwareRAID* >(device)->status() == SoftwareRAID::Status::Inactive ) + { createTable = false; create = false; } +#endif } else { From 8178c82d11b0aa52c9e8ec2aeae797dc2462361c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Sep 2018 16:21:30 -0400 Subject: [PATCH 07/14] Changelog: update with names & partition module --- CHANGES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 56526aad2..8c56b4023 100644 --- a/CHANGES +++ b/CHANGES @@ -6,11 +6,17 @@ website will have to do for older versions. # 3.2.3 (unreleased) # This release contains contributions from (alphabetically by first name): + - Alf Gaida + - Caio Carvalho + - Philip Mueller ## Core ## ## Modules ## + * The *partition* module supports RAID devices, but only when Calamares + is compiled with the newest KPMCore release. + # 3.2.2 (2018-09-04) # This release contains contributions from (alphabetically by first name): From 88c973f7cc09f891c56ea0c81558c414f6c53c83 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 13 Sep 2018 05:33:39 -0400 Subject: [PATCH 08/14] [partition] Simplify space calculations - Q_ASSERT doesn't work in constexpr functions because it's not - May as well calculate bytes at compile-time, no need to give the runaround via number-of-MiB --- src/modules/partition/core/PartitionActions.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/modules/partition/core/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index d35345424..677c3778d 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -104,10 +104,7 @@ swapSuggestion( const qint64 availableSpaceB ) constexpr qint64 alignBytesToBlockSize( qint64 bytes, qint64 blocksize ) { - Q_ASSERT( bytes >= 0 ); - Q_ASSERT( blocksize > 0 ); qint64 blocks = bytes / blocksize; - Q_ASSERT( blocks >= 0 ); if ( blocks * blocksize != bytes ) ++blocks; @@ -135,17 +132,17 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass // the logical sector size (usually 512B). EFI starts with 2MiB // empty and a 300MiB EFI boot partition, while BIOS starts at // the 1MiB boundary (usually sector 2048). - int uefisys_part_size = isEfi ? 300 : 0; - int empty_space_size = isEfi ? 2 : 1; + int uefisys_part_sizeB = isEfi ? 300_MiB : 0_MiB; + int empty_space_sizeB = isEfi ? 2_MiB : 1_MiB; // Since sectors count from 0, if the space is 2048 sectors in size, // the first free sector has number 2048 (and there are 2048 sectors // before that one, numbered 0..2047). - qint64 firstFreeSector = bytesToSectors( MiBtoBytes(empty_space_size), dev->logicalSize() ); + qint64 firstFreeSector = bytesToSectors( empty_space_sizeB, dev->logicalSize() ); if ( isEfi ) { - qint64 efiSectorCount = bytesToSectors( MiBtoBytes(uefisys_part_size), dev->logicalSize() ); + qint64 efiSectorCount = bytesToSectors( uefisys_part_sizeB, dev->logicalSize() ); Q_ASSERT( efiSectorCount > 0 ); // Since sectors count from 0, and this partition is created starting From 0396ed28b7c65325aafd67296ca2509175da0dbd Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 24 Sep 2018 17:05:36 +0200 Subject: [PATCH 09/14] [keyboard] Update some origin information for the keyboard map --- src/modules/keyboard/kbd-model-map | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/keyboard/kbd-model-map b/src/modules/keyboard/kbd-model-map index 8555adfdf..68c8baf72 100644 --- a/src/modules/keyboard/kbd-model-map +++ b/src/modules/keyboard/kbd-model-map @@ -1,6 +1,11 @@ # Copied from systemd-localed -# http://cgit.freedesktop.org/systemd/systemd/log/src/locale/kbd-model-map +# +# https://cgit.freedesktop.org/systemd/systemd/log/src/locale/kbd-model-map # (originally under LGPLv2.1+, used under the LGPL to GPL conversion clause) +# +# This is the version from 534644b7be7b240eb0fbbe06e20cbecbe8206767, +# committed 2015-01-22 01:07:24 . +# # Generated from system-config-keyboard's model list # consolelayout xlayout xmodel xvariant xoptions sg ch pc105 de_nodeadkeys terminate:ctrl_alt_bksp From d752223d0bc72adcce8f1db8473570253bb91651 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 24 Sep 2018 17:58:22 +0200 Subject: [PATCH 10/14] [libcalamaresui] When reporting failure, use full product name. --- src/libcalamaresui/ViewManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 2b9f87db8..4d1f3591e 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -191,7 +191,7 @@ ViewManager::onInitFailed( const QStringList& modules) detailString = details.join( QString() ); } - insertViewStep( 0, new BlankViewStep( title, description.arg( *Calamares::Branding::ShortProductName ), detailString ) ); + insertViewStep( 0, new BlankViewStep( title, description.arg( *Calamares::Branding::ProductName ), detailString ) ); } ViewStepList From 3ab891793a87fddf38a96286b4913c73a22c9da6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 26 Sep 2018 16:54:39 +0200 Subject: [PATCH 11/14] [keyboard] Add Austrian keyboard layout - Map xkb 'at' to 'de' on the text console - Thanks Philip Mueller, Kevin Kofler FIXES #1035 --- src/modules/keyboard/kbd-model-map | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/keyboard/kbd-model-map b/src/modules/keyboard/kbd-model-map index 68c8baf72..49ec4ad75 100644 --- a/src/modules/keyboard/kbd-model-map +++ b/src/modules/keyboard/kbd-model-map @@ -6,6 +6,9 @@ # This is the version from 534644b7be7b240eb0fbbe06e20cbecbe8206767, # committed 2015-01-22 01:07:24 . # +# Updates: +# - 2018-09-26 Added "Austrian" keyboard (de at). Issue #1035 +# # Generated from system-config-keyboard's model list # consolelayout xlayout xmodel xvariant xoptions sg ch pc105 de_nodeadkeys terminate:ctrl_alt_bksp @@ -15,6 +18,7 @@ trq tr pc105 - terminate:ctrl_alt_bksp uk gb pc105 - terminate:ctrl_alt_bksp is-latin1 is pc105 - terminate:ctrl_alt_bksp de de pc105 - terminate:ctrl_alt_bksp +de at pc105 - terminate:ctrl_alt_bksp la-latin1 latam pc105 - terminate:ctrl_alt_bksp us us pc105+inet - terminate:ctrl_alt_bksp ko kr pc105 - terminate:ctrl_alt_bksp From 427c142182de90a9b47b92c6e092e872e98ffd26 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Sep 2018 12:51:32 +0200 Subject: [PATCH 12/14] Changelog: credits and mark fixed --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 8c56b4023..e6a16fac8 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ website will have to do for older versions. This release contains contributions from (alphabetically by first name): - Alf Gaida - Caio Carvalho + - Kevin Kofler - Philip Mueller ## Core ## @@ -16,6 +17,8 @@ This release contains contributions from (alphabetically by first name): * The *partition* module supports RAID devices, but only when Calamares is compiled with the newest KPMCore release. + * The *keyboard* module now handles the (bogus) Austrian keymap for + the system console properly. # 3.2.2 (2018-09-04) # From e7c62c114f9e88aeca32fc719fa7478421144075 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Sep 2018 13:35:33 +0200 Subject: [PATCH 13/14] [keyboard] Improve debugging output --- src/modules/keyboard/SetKeyboardLayoutJob.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/keyboard/SetKeyboardLayoutJob.cpp b/src/modules/keyboard/SetKeyboardLayoutJob.cpp index 02d807045..75c52bb51 100644 --- a/src/modules/keyboard/SetKeyboardLayoutJob.cpp +++ b/src/modules/keyboard/SetKeyboardLayoutJob.cpp @@ -65,6 +65,8 @@ SetKeyboardLayoutJob::prettyName() const QString SetKeyboardLayoutJob::findConvertedKeymap( const QString& convertedKeymapPath ) const { + cDebug() << "Looking for converted keymap in" << convertedKeymapPath; + // No search path supplied, assume the distribution does not provide // converted keymaps if ( convertedKeymapPath.isEmpty() ) @@ -76,8 +78,7 @@ SetKeyboardLayoutJob::findConvertedKeymap( const QString& convertedKeymapPath ) if ( convertedKeymapDir.exists( name + ".map" ) || convertedKeymapDir.exists( name + ".map.gz" ) ) { - cDebug() << "Found converted keymap" << name; - + cDebug() << ".. Found converted keymap" << name; return name; } @@ -88,6 +89,8 @@ SetKeyboardLayoutJob::findConvertedKeymap( const QString& convertedKeymapPath ) QString SetKeyboardLayoutJob::findLegacyKeymap() const { + cDebug() << "Looking for legacy keymap in QRC"; + int bestMatching = 0; QString name; @@ -137,7 +140,7 @@ SetKeyboardLayoutJob::findLegacyKeymap() const // The best matching entry so far, then let's save that if ( matching >= qMax( bestMatching, 1 ) ) { - cDebug() << "Found legacy keymap" << mapping[0] + cDebug() << ".. Found legacy keymap" << mapping[0] << "with score" << matching; if ( matching > bestMatching ) From a749f041f016b9386a32cf72b183d48fb7b15c2b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Sep 2018 20:45:13 +0200 Subject: [PATCH 14/14] [calamares] More verbose failure in test-loader --- src/calamares/testmain.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calamares/testmain.cpp b/src/calamares/testmain.cpp index c22342f9a..e1d934b54 100644 --- a/src/calamares/testmain.cpp +++ b/src/calamares/testmain.cpp @@ -184,7 +184,12 @@ main( int argc, char* argv[] ) cDebug() << count << p->prettyName(); Calamares::JobResult r = p->exec(); if ( !r ) - cDebug() << count << ".. failed" << r; + { + using TR = Logger::DebugRow; + cDebug() << count << ".. failed" + << TR( "summary", r.message() ) + << TR( "details", r.details() ); + } ++count; }