Compare commits

..

10 Commits

Author SHA1 Message Date
Adriaan de Groot
5f06b321b2 CMake: correct copy-paste-o for destination of config files 2023-11-16 23:23:58 +01:00
Adriaan de Groot
146f549552 [libcalamares] Return None for empty GS keys
All unknown-variants return None, but this only
happens in practice with an empty variant (e.g.
a configuration key that is empty in the YAML).

FIXES #2237
2023-11-16 23:17:33 +01:00
Adriaan de Groot
8305b6cb1a [dummypython] Demonstrator for #2237 2023-11-16 23:10:53 +01:00
Adriaan de Groot
51a1d06c51 Changes: pre-release housekeeping 2023-11-16 22:54:17 +01:00
Adriaan de Groot
63211c86de Merge pull request #2236 from demmm/calamares
[partition] make the tests also build with Qt6
2023-11-16 22:51:13 +01:00
demmm
de85a02f74 [partition] make the tests also build with Qt6 2023-11-15 14:19:15 +01:00
Adriaan de Groot
8868ae956a [partition] Repair comparison 2023-11-14 13:50:08 +01:00
Adriaan de Groot
65e0740c49 Changes: post-release housekeeping 2023-11-13 21:57:45 +01:00
Adriaan de Groot
12413ad9e8 [partition] Add test demonstrating size edge-case 2023-11-13 21:32:05 +01:00
Adriaan de Groot
5c0b20d06a [partition] Enforce minimum <= recommended. 2023-11-13 21:28:10 +01:00
10 changed files with 84 additions and 6 deletions

View File

@@ -8,6 +8,26 @@ changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for
the history of the 3.2 series (2018-05 - 2022-08).
# 3.3.0 (unreleased)
This release contains contributions from (alphabetically by first name):
- Nobody, yet
## Core ##
## Modules ##
# 3.3.0-alpha6 (2023-11-16)
This release contains contributions from (alphabetically by first name):
- Adriaan de Groot
- Anke Boersma
This is a hotfix release because -alpha5 didn't compile,
and Anke repaired the partition unit-tests when building with Qt6.
# 3.3.0-alpha5 (2023-11-13)
This release contains contributions from (alphabetically by first name):

View File

@@ -47,7 +47,7 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(CALAMARES_VERSION 3.3.0-alpha5)
set(CALAMARES_VERSION 3.3.0-alpha6)
set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release
if(CMAKE_SCRIPT_MODE_FILE)

View File

@@ -170,7 +170,7 @@ function( _calamares_add_module_subdirectory_impl )
if (INSTALL_CONFIG)
message(" ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory and ${MODULE_DATA_DESTINATION}]")
foreach(_cf ${MODULE_CONFIG_FILES})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${_cf} DESTINATION ${MODULE_DESTINATION})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${_cf} DESTINATION ${MODULE_DATA_DESTINATION})
endforeach()
else()
message(" ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory only]")

View File

@@ -95,7 +95,7 @@ variantToPyObject( const QVariant& variant )
case QVariant::Invalid:
#endif
default:
return py::object();
return py::none();
}
#ifdef __clang__
#pragma clang diagnostic pop

View File

@@ -58,6 +58,19 @@ def run():
for k in libcalamares.globalstorage.keys():
libcalamares.utils.debug(f" {k}={libcalamares.globalstorage.value(k)}")
libcalamares.utils.debug("*** GLOBAL STORAGE BOGUS KEYS ***")
#
# This is a demonstration of issue #2237, load this module
# with the dummypython/tests/1.global configuration, e.g.
# ./loadmodule -g ../src/modules/dummypython/tests/1.global dummypython
# in the build directory.
#
for k in ("nonexistent", "empty", "numeric", "boolvalue"):
if libcalamares.globalstorage.value(k) is None:
libcalamares.utils.debug(f"NONE {k}={libcalamares.globalstorage.value(k)}")
else:
libcalamares.utils.debug(f" {k}={libcalamares.globalstorage.value(k)}")
libcalamares.utils.debug("*** GLOBAL STORAGE MODIFICATION ***")
libcalamares.globalstorage.insert("item2", "value2")
libcalamares.globalstorage.insert("item3", 3)

View File

@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: no
# SPDX-License-Identifier: CC0-1.0
---
firmwareType: bios
bootLoader: grub
empty:

View File

@@ -320,7 +320,15 @@ fillGSConfigurationEFI( Calamares::GlobalStorage* gs, const QVariantMap& configu
Calamares::Partition::PartitionSize part_size = Calamares::Partition::PartitionSize( efiMinimumSize );
if ( part_size.isValid() )
{
gs->insert( PartUtils::efiFilesystemMinimumSizeGSKey(), part_size.toBytes() );
if ( part_size.toBytes() > PartUtils::efiFilesystemRecommendedSize() )
{
cWarning() << "EFI minimum size" << efiMinimumSize << "is larger than the recommended size"
<< efiRecommendedSize << ", ignored.";
}
else
{
gs->insert( PartUtils::efiFilesystemMinimumSizeGSKey(), part_size.toBytes() );
}
}
}
}

View File

@@ -0,0 +1,5 @@
---
efi:
recommendedSize: 133MiB
minimumSize: 200MiB
label: "bigmin"

View File

@@ -3,12 +3,12 @@
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
#
find_package(Qt5 COMPONENTS Gui REQUIRED)
find_package(${qtname} COMPONENTS Gui REQUIRED)
set(PartitionModule_SOURCE_DIR ..)
include_directories(
${Qt5Gui_INCLUDE_DIRS}
${${qtname}Gui_INCLUDE_DIRS}
${PartitionModule_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}

View File

@@ -34,6 +34,7 @@ private Q_SLOTS:
void testEmptyConfig();
void testLegacySize();
void testAll();
void testWeirdConfig();
};
ConfigTests::ConfigTests() = default;
@@ -195,6 +196,31 @@ ConfigTests::testAll()
}
}
void
ConfigTests::testWeirdConfig()
{
Config c( nullptr );
auto* gs = Calamares::JobQueue::instanceGlobalStorage();
QVERIFY( gs );
// Config with an invalid minimum size
{
const auto file = QStringLiteral( BUILD_AS_TEST "/3a-min-too-large.conf" );
bool ok = false;
c.setConfigurationMap( Calamares::YAML::load( file, &ok ) );
cDebug() << "Tried to load" << file << "success?" << ok;
QVERIFY( ok );
QCOMPARE( PartUtils::efiFilesystemRecommendedSize(), 133_MiB );
QCOMPARE( PartUtils::efiFilesystemMinimumSize(), 133_MiB ); // Config setting was ignored
QCOMPARE( gs->value( "efiSystemPartitionName" ).toString(), QStringLiteral( "bigmin" ) );
}
}
QTEST_GUILESS_MAIN( ConfigTests )