Compare commits

...

11 Commits

Author SHA1 Message Date
Adriaan de Groot
ff7ceb2e2b [fstab] Replace two-step attribute-setting with one step 2022-05-24 15:56:34 +02:00
Adriaan de Groot
cada0f2547 Changes: pre-release housekeeping 2022-05-24 15:25:31 +02:00
Adriaan de Groot
f4e5e08aa8 [fstab] Be more careful in setting up btrfs swap
- do not use subprocess module in Python bits,
- do +C (no-CoW) after turning compression off
2022-05-24 15:18:50 +02:00
Adriaan de Groot
72f25f24ef CI: allow no-testing on the release tarball 2022-05-21 13:27:22 +02:00
Adriaan de Groot
8466d1eb3e CI: remove Linuxisms from release script 2022-05-21 12:44:32 +02:00
Adriaan de Groot
cc7fe7fff7 [users] Adjust failure expectations (today, for an openSUSE development host) 2022-05-20 22:50:23 +02:00
Adriaan de Groot
0a4e6804c6 [partition] Move encryption state-calculation to state()
Previously, state() just returned a stored state, which changed
via updateState(). However, when updateState() started taking
visibility-of-the-widget into account, it became possible to
de-sync the *apparent* state of the encryption widget, from the
stored one:
- make an encryption widget, which is not visible
- show it.

Now the stored-state takes visibility into account that is
different (hidden, so we end up with a state of Unconfirmed)
from the apparent value (shown and unchecked).

Move the calculation to state() instead, so whenever queried,
it checks the current checks-and-visibility values. Restore
the previously-reverted bit for accepting LUKS partitions.

SEE #1935
SEE #1953
2022-05-20 18:10:24 +02:00
Adriaan de Groot
900700b9bc [partition] Partial revert reuse-luks merge
- a hidden checkbox should not be handled the same as a checkbox
  that is checked; if there is a setting that can be checked or
  unchecked, it can only be checked when visible.

FIXES #1953
2022-05-20 13:49:32 +02:00
Adriaan de Groot
12b62980cb Changes: pre-release housekeeping 2022-05-20 12:14:05 +02:00
Adriaan de Groot
e7f6ead038 [partition] When changing encryption-widget visibility, re-check next 2022-05-20 12:02:25 +02:00
Adriaan de Groot
51e3ac0ded [partition] Polish up debugging when checking for next-enabled
- Improve the messages a bit
- Remove useless variable (it is checking that the switch(choice)
  statement covers all the cases; let's leave that to the compiler)
2022-05-20 11:56:08 +02:00
7 changed files with 65 additions and 50 deletions

View File

@@ -8,6 +8,20 @@ contributors are listed. Note that Calamares does not have a historical
changelog -- this log starts with version 3.2.0. The release notes on the
website will have to do for older versions.
# 3.2.58.2 (2022-05-24)
This is a extra-quick release for an issue that shows up when using a
swap **file** on a btrfs filesystem; the installation would fail with
a Python error, raised from btrfs-progs. Reported by Evan James, Erik
Dubois, TechXero.
# 3.2.58.1 (2022-05-20)
This is a hot-fix release for a regression in the *partition* module where
it was impossible to proceed unless *Encrypt system* was checked.
# 3.2.58 (2022-05-18) #
This release contains contributions from (alphabetically by first name):

View File

@@ -41,7 +41,7 @@
# TODO:3.3: Require CMake 3.12
cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
project( CALAMARES
VERSION 3.2.58
VERSION 3.2.58.2
LANGUAGES C CXX
)

View File

@@ -7,8 +7,6 @@
#
# Release script for Calamares
#
# NOTE: this script contains Linuxisms (in particular, expects GNU mktemp(1))
#
# This attempts to perform the different steps of the RELEASE.md
# document automatically. It's not tested on other machines or
# setups other than [ade]'s development VM.
@@ -29,11 +27,13 @@
# * `-B` do not build (before tagging)
# * `-P` do not package (tag, sign, tarball)
# * `-T` do not respect string freeze
# * '-b' do not build-and-test tarball
#
# The build / package settings can be influenced via environment variables:
# * BUILD_DEFAULT set to `false` to avoid first build with gcc
# * BUILD_CLANG set to `false` to avoid second build with clang
# * BUILD_ONLY set to `true` to break after building
# * TEST_TARBALL set to 'false' to skip build-and-test phase after tarring
#
### END USAGE
@@ -45,9 +45,10 @@ which cmake > /dev/null 2>&1 || { echo "No cmake(1) available." ; exit 1 ; }
test -z "$BUILD_DEFAULT" && BUILD_DEFAULT=true
test -z "$BUILD_CLANG" && BUILD_CLANG=true
test -z "$BUILD_ONLY" && BUILD_ONLY=false
test -z "$TEST_TARBALL" && TEST_TARBALL=true
STRING_FREEZE=true
while getopts "hBPT" opt ; do
while getopts "hBbPT" opt ; do
case "$opt" in
h|\?)
sed -e '1,/USAGE/d' -e '/END.USAGE/,$d' < "$0"
@@ -57,6 +58,9 @@ while getopts "hBPT" opt ; do
BUILD_DEFAULT=false
BUILD_CLANG=false
;;
b)
TEST_TARBALL=false
;;
P)
BUILD_ONLY=true
;;
@@ -74,7 +78,7 @@ fi
### Setup
#
#
BUILDDIR=$(mktemp -d --suffix=-build --tmpdir=.)
BUILDDIR=$(mktemp -d ./cala-tmp-XXXXXX)
KEY_ID="328D742D8807A435"
# Try to make gpg cache the signing key, so we can leave the process
@@ -144,12 +148,14 @@ SHA256=$(sha256sum "$TAR_FILE" | cut -d" " -f1)
### Build the tarball
#
#
D=$(date +%Y%m%d-%H%M%S)
TMPDIR=$(mktemp -d --suffix="-calamares-$D")
test -d "$TMPDIR" || { echo "Could not create tarball-build directory." ; exit 1 ; }
tar xzf "$TAR_FILE" -C "$TMPDIR" || { echo "Could not unpack tarball." ; exit 1 ; }
test -d "$TMPDIR/$TAR_V" || { echo "Tarball did not contain source directory." ; exit 1 ; }
( cd "$TMPDIR/$TAR_V" && cmake . && make -j4 && make test ) || { echo "Tarball build failed in $TMPDIR ." ; exit 1 ; }
if test "x$TEST_TARBALL" = "xtrue" ; then
D=$(date +%Y%m%d-%H%M%S)
TMPDIR=$(mktemp -d ./cala-tar-XXXXXX)
test -d "$TMPDIR" || { echo "Could not create tarball-build directory." ; exit 1 ; }
tar xzf "$TAR_FILE" -C "$TMPDIR" || { echo "Could not unpack tarball." ; exit 1 ; }
test -d "$TMPDIR/$TAR_V" || { echo "Tarball did not contain source directory." ; exit 1 ; }
( cd "$TMPDIR/$TAR_V" && cmake . && make -j4 && make test ) || { echo "Tarball build failed in $TMPDIR ." ; exit 1 ; }
fi
gpg -s -u $KEY_ID --detach --armor $TAR_FILE # Sign the tarball
### Cleanup

View File

@@ -173,7 +173,6 @@ class FstabGenerator(object):
for p in self.partitions]):
password = "none"
crypttab_options = ""
return dict(
name=mapper_name,
@@ -342,10 +341,7 @@ def create_swapfile(root_mount_point, root_btrfs):
swapfile_path = os.path.join(root_mount_point, "swap/swapfile")
with open(swapfile_path, "wb") as f:
pass
o = subprocess.check_output(["chattr", "+C", swapfile_path])
libcalamares.utils.debug("swapfile attributes: {!s}".format(o))
o = subprocess.check_output(["btrfs", "property", "set", swapfile_path, "compression", "none"])
libcalamares.utils.debug("swapfile compression: {!s}".format(o))
libcalamares.utils.host_env_process_output(["chattr", "+C", "+m", swapfile_path]) # No Copy-on-Write, no compression
else:
swapfile_path = os.path.join(root_mount_point, "swapfile")
with open(swapfile_path, "wb") as f:
@@ -363,8 +359,7 @@ def create_swapfile(root_mount_point, root_btrfs):
libcalamares.job.setprogress(0.2 + 0.3 * ( total / desired_size ) )
total += chunk
os.chmod(swapfile_path, 0o600)
o = subprocess.check_output(["mkswap", swapfile_path])
libcalamares.utils.debug("swapfile mkswap: {!s}".format(o))
libcalamares.utils.host_env_process_output(["mkswap", swapfile_path])
libcalamares.job.setprogress(0.5)

View File

@@ -125,6 +125,8 @@ ChoicePage::ChoicePage( Config* config, QWidget* parent )
m_encryptWidget->hide();
m_reuseHomeCheckBox->hide();
gs->insert( "reuseHome", false );
updateNextEnabled();
}
@@ -478,6 +480,7 @@ ChoicePage::onActionChanged()
m_encryptWidget->show();
}
}
updateNextEnabled();
}
void
@@ -1205,6 +1208,8 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
m_beforePartitionBarsView->setSelectionMode( previewSelectionMode );
m_beforePartitionLabelsView->setSelectionMode( previewSelectionMode );
updateNextEnabled();
}
@@ -1610,35 +1615,27 @@ ChoicePage::isNextEnabled() const
bool
ChoicePage::calculateNextEnabled() const
{
bool enabled = false;
auto sm_p = m_beforePartitionBarsView ? m_beforePartitionBarsView->selectionModel() : nullptr;
switch ( m_config->installChoice() )
{
case InstallChoice::NoChoice:
cDebug() << "No partitioning choice";
cDebug() << "No partitioning choice has been made yet";
return false;
case InstallChoice::Replace:
case InstallChoice::Alongside:
if ( !( sm_p && sm_p->currentIndex().isValid() ) )
{
cDebug() << "No partition selected";
cDebug() << "No partition selected for alongside or replace";
return false;
}
enabled = true;
break;
case InstallChoice::Erase:
case InstallChoice::Manual:
enabled = true;
// Nothing to check for these
break;
}
if ( !enabled )
{
cDebug() << "No valid choice made";
return false;
}
if ( m_isEfi
&& ( m_config->installChoice() == InstallChoice::Alongside
|| m_config->installChoice() == InstallChoice::Replace ) )
@@ -1655,7 +1652,7 @@ ChoicePage::calculateNextEnabled() const
switch ( m_encryptWidget->state() )
{
case EncryptWidget::Encryption::Unconfirmed:
cDebug() << "No passphrase provided";
cDebug() << "No passphrase provided or passphrase mismatch.";
return false;
case EncryptWidget::Encryption::Disabled:
case EncryptWidget::Encryption::Confirmed:

View File

@@ -85,7 +85,26 @@ EncryptWidget::reset( bool checkVisible )
EncryptWidget::Encryption
EncryptWidget::state() const
{
return m_state;
Encryption newState = Encryption::Unconfirmed;
if ( m_ui->m_encryptCheckBox->isChecked() || !m_ui->m_encryptCheckBox->isVisible() )
{
if ( !m_ui->m_passphraseLineEdit->text().isEmpty()
&& m_ui->m_passphraseLineEdit->text() == m_ui->m_confirmLineEdit->text() )
{
newState = Encryption::Confirmed;
}
else
{
newState = Encryption::Unconfirmed;
}
}
else
{
newState = Encryption::Disabled;
}
return newState;
}
@@ -148,23 +167,7 @@ EncryptWidget::updateState()
}
}
Encryption newState;
if ( m_ui->m_encryptCheckBox->isChecked() || !m_ui->m_encryptCheckBox->isVisible() )
{
if ( !m_ui->m_passphraseLineEdit->text().isEmpty()
&& m_ui->m_passphraseLineEdit->text() == m_ui->m_confirmLineEdit->text() )
{
newState = Encryption::Confirmed;
}
else
{
newState = Encryption::Unconfirmed;
}
}
else
{
newState = Encryption::Disabled;
}
Encryption newState = state();
if ( newState != m_state )
{

View File

@@ -140,7 +140,7 @@ UsersTests::testHostnamed()
// then this one should, also; or, if the previous one failed, then this
// changes to whatever-the-hostname-is, and systemd dbus seems to call that
// a success, as well (since nothing changes). So no failure-expectation here.
// QEXPECT_FAIL( "", "Hostname changes are access-controlled (restore)", Continue );
QEXPECT_FAIL( "", "Hostname changes are access-controlled (restore)", Continue );
QVERIFY( setSystemdHostname( m_originalHostName ) );
}
}