-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
0036-Set-512-LUKS-sector-size-under-LVM.patch
70 lines (63 loc) · 3.36 KB
/
0036-Set-512-LUKS-sector-size-under-LVM.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 063875c7a7cbd6f92188793b5622bfd296167253 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Sun, 13 Aug 2023 04:00:50 +0200
Subject: [PATCH] Set 512 LUKS sector size under LVM
LVM (thin) volumes present the original sector size to the VM. Currently
all the qubes templates are built with 512 sector size (that's how
partition table and filesystem are created). When installing Qubes on a
4Kn disk, such VMs won't boot. LUKS2 supports passing down the sector
size, and cryptsetup used in Qubes 4.2 has it enabled by default.
As a temporary workaround, force 512 LUKS sector size on a LVM thin
partitioning layout.
QubesOS/qubes-issues#4974
---
.../partitioning/automatic/automatic_partitioning.py | 4 ++++
.../storage/partitioning/custom/custom_partitioning.py | 6 ++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/modules/storage/partitioning/automatic/automatic_partitioning.py b/pyanaconda/modules/storage/partitioning/automatic/automatic_partitioning.py
index 61e3849ed6..02e6d11ab4 100644
--- a/pyanaconda/modules/storage/partitioning/automatic/automatic_partitioning.py
+++ b/pyanaconda/modules/storage/partitioning/automatic/automatic_partitioning.py
@@ -17,6 +17,7 @@
#
from blivet.partitioning import do_partitioning, grow_lvm
from blivet.static_data import luks_data
+from pykickstart.constants import AUTOPART_TYPE_LVM_THINP
from pyanaconda.anaconda_loggers import get_module_logger
from pyanaconda.modules.common.structures.partitioning import PartitioningRequest
@@ -119,6 +120,9 @@ class AutomaticPartitioningTask(NonInteractivePartitioningTask):
"pbkdf_args": pbkdf_args,
"escrow_cert": escrow_cert,
"add_backup_passphrase": request.backup_passphrase_enabled,
+ "luks_sector_size": (
+ 512 if request.partitioning_scheme == AUTOPART_TYPE_LVM_THINP else 0
+ ),
}
@staticmethod
diff --git a/pyanaconda/modules/storage/partitioning/custom/custom_partitioning.py b/pyanaconda/modules/storage/partitioning/custom/custom_partitioning.py
index e59509975f..68c4a49110 100644
--- a/pyanaconda/modules/storage/partitioning/custom/custom_partitioning.py
+++ b/pyanaconda/modules/storage/partitioning/custom/custom_partitioning.py
@@ -410,7 +410,8 @@ class CustomPartitioningTask(NonInteractivePartitioningTask):
escrow_cert=cert,
add_backup_passphrase=partition_data.backuppassphrase,
luks_version=partition_data.luks_version,
- pbkdf_args=pbkdf_args
+ pbkdf_args=pbkdf_args,
+ luks_sector_size=(512 if ty == "lvmpv" else 0),
)
luksdev = LUKSDevice(
"luks%d" % storage.next_id,
@@ -426,7 +427,8 @@ class CustomPartitioningTask(NonInteractivePartitioningTask):
escrow_cert=cert,
add_backup_passphrase=partition_data.backuppassphrase,
luks_version=partition_data.luks_version,
- pbkdf_args=pbkdf_args
+ pbkdf_args=pbkdf_args,
+ luks_sector_size=(512 if ty == "lvmpv" else 0),
)
luksdev = LUKSDevice("luks%d" % storage.next_id,
fmt=luksformat,
--
2.45.2