mirror of
https://git.launchpad.net/~ubuntu-qt-code/ubuntu/+source/calamares/+git/calamares
synced 2025-07-07 15:41:28 +00:00
Refresh patches
This commit is contained in:
parent
70ccd4f025
commit
a28576e3af
@ -43,7 +43,7 @@ Last-Update: 2024-02-26
|
||||
// warnings to ensure that all the cases are covered below.
|
||||
@@ -252,6 +259,10 @@ PartitionLayout::createPartitions( Devic
|
||||
availableSectors = totalSectors;
|
||||
for ( const auto& entry : qAsConst( m_partLayout ) )
|
||||
for ( const auto& entry : std::as_const( m_partLayout ) )
|
||||
{
|
||||
+ if ( luksPassphrase.isEmpty() && entry.partOnlyPresentWithEncryption ) {
|
||||
+ // this partition is being skipped entirely
|
||||
@ -54,7 +54,7 @@ Last-Update: 2024-02-26
|
||||
{
|
||||
@@ -265,6 +276,10 @@ PartitionLayout::createPartitions( Devic
|
||||
// Assign sectors for percentage-defined partitions.
|
||||
for ( const auto& entry : qAsConst( m_partLayout ) )
|
||||
for ( const auto& entry : std::as_const( m_partLayout ) )
|
||||
{
|
||||
+ if ( luksPassphrase.isEmpty() && entry.partOnlyPresentWithEncryption ) {
|
||||
+ // this partition is being skipped entirely
|
||||
@ -65,7 +65,7 @@ Last-Update: 2024-02-26
|
||||
qint64 sectors
|
||||
@@ -288,6 +303,10 @@ PartitionLayout::createPartitions( Devic
|
||||
availableSectors = totalSectors;
|
||||
for ( const auto& entry : qAsConst( m_partLayout ) )
|
||||
for ( const auto& entry : std::as_const( m_partLayout ) )
|
||||
{
|
||||
+ if ( luksPassphrase.isEmpty() && entry.partOnlyPresentWithEncryption ) {
|
||||
+ // this partition is being skipped entirely
|
||||
|
49
debian/patches/unmount-encrypted-devices.patch
vendored
49
debian/patches/unmount-encrypted-devices.patch
vendored
@ -9,11 +9,9 @@ Subject: [PATCH 1/2] [libcalamares] Add a closeCryptsetup function to properly
|
||||
src/libcalamares/partition/Mount.h | 7 +++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
diff --git a/src/libcalamares/partition/Mount.cpp b/src/libcalamares/partition/Mount.cpp
|
||||
index 03b776f4be..e4c3d06b94 100644
|
||||
--- a/src/libcalamares/partition/Mount.cpp
|
||||
+++ b/src/libcalamares/partition/Mount.cpp
|
||||
@@ -84,6 +84,15 @@ unmount( const QString& path, const QStringList& options )
|
||||
@@ -84,6 +84,15 @@ unmount( const QString& path, const QStr
|
||||
return r.getExitCode();
|
||||
}
|
||||
|
||||
@ -29,11 +27,9 @@ index 03b776f4be..e4c3d06b94 100644
|
||||
struct TemporaryMount::Private
|
||||
{
|
||||
QString m_devicePath;
|
||||
diff --git a/src/libcalamares/partition/Mount.h b/src/libcalamares/partition/Mount.h
|
||||
index 3781c4feb2..e197594a1d 100644
|
||||
--- a/src/libcalamares/partition/Mount.h
|
||||
+++ b/src/libcalamares/partition/Mount.h
|
||||
@@ -51,6 +51,13 @@ DLLEXPORT int mount( const QString& devicePath,
|
||||
@@ -51,6 +51,13 @@ DLLEXPORT int mount( const QString& devi
|
||||
*/
|
||||
DLLEXPORT int unmount( const QString& path, const QStringList& options = QStringList() );
|
||||
|
||||
@ -47,26 +43,12 @@ index 3781c4feb2..e197594a1d 100644
|
||||
|
||||
/** @brief Mount and automatically unmount a device
|
||||
*
|
||||
|
||||
From f6fc0d19493afbb084f57f81e451c9f0d0844281 Mon Sep 17 00:00:00 2001
|
||||
From: Simon Quigley <simon@tsimonq2.net>
|
||||
Date: Fri, 22 Nov 2024 19:38:15 -0600
|
||||
Subject: [PATCH 2/2] [umount] After unmounting partitions, close any encrypted
|
||||
partitions that are still open
|
||||
|
||||
---
|
||||
src/modules/umount/UmountJob.cpp | 41 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 41 insertions(+)
|
||||
|
||||
diff --git a/src/modules/umount/UmountJob.cpp b/src/modules/umount/UmountJob.cpp
|
||||
index 1e207d9eae..8cc8796ac9 100644
|
||||
--- a/src/modules/umount/UmountJob.cpp
|
||||
+++ b/src/modules/umount/UmountJob.cpp
|
||||
@@ -93,6 +93,38 @@ unmountTargetMounts( const QString& rootMountPoint )
|
||||
return Calamares::JobResult::ok();
|
||||
@@ -94,6 +94,38 @@ unmountTargetMounts( const QString& root
|
||||
}
|
||||
|
||||
+static Calamares::JobResult
|
||||
static Calamares::JobResult
|
||||
+unmountEncryptedPartitions( const QList<QVariant>& partitions )
|
||||
+{
|
||||
+ // Iterate on each partition in global storage
|
||||
@ -98,22 +80,23 @@ index 1e207d9eae..8cc8796ac9 100644
|
||||
+ return Calamares::JobResult::ok();
|
||||
+}
|
||||
+
|
||||
static Calamares::JobResult
|
||||
+static Calamares::JobResult
|
||||
exportZFSPools()
|
||||
{
|
||||
@@ -152,6 +184,15 @@ UmountJob::exec()
|
||||
}
|
||||
}
|
||||
|
||||
auto* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||
@@ -149,6 +181,15 @@ UmountJob::exec()
|
||||
if ( !r )
|
||||
{
|
||||
return r;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // For encrypted systems, close the partitions
|
||||
+ {
|
||||
+ auto r = unmountEncryptedPartitions( gs->value("partitions").toList() );
|
||||
+ if ( !r )
|
||||
+ {
|
||||
+ return r;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// For ZFS systems, export the pools
|
||||
{
|
||||
auto r = exportZFSPools();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user