mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-25 16:38:21 -04:00
Merge pull request #1844 from dalto8/openswap
Add support for unlocking encrypted swap with root on a btrfs subvol
This commit is contained in:
commit
47f2dd3c18
1 changed files with 7 additions and 2 deletions
|
@ -64,6 +64,11 @@ def write_openswap_conf(partitions, root_mount_point, openswap_conf_path):
|
||||||
elif lines[i].startswith("keyfile_filename"):
|
elif lines[i].startswith("keyfile_filename"):
|
||||||
lines[i] = "keyfile_filename=crypto_keyfile.bin"
|
lines[i] = "keyfile_filename=crypto_keyfile.bin"
|
||||||
|
|
||||||
|
elif lines[i].startswith("#keyfile_device_mount_options"):
|
||||||
|
if libcalamares.globalstorage.contains("btrfsRootSubvolume"):
|
||||||
|
btrfs_root_subvolume = libcalamares.globalstorage.value("btrfsRootSubvolume")
|
||||||
|
lines[i] = "keyfile_device_mount_options=--options=subvol=" + btrfs_root_subvolume.lstrip("/")
|
||||||
|
|
||||||
with open(os.path.join(root_mount_point,
|
with open(os.path.join(root_mount_point,
|
||||||
openswap_conf_path), 'w') as openswap_file:
|
openswap_conf_path), 'w') as openswap_file:
|
||||||
openswap_file.write("\n".join(lines) + "\n")
|
openswap_file.write("\n".join(lines) + "\n")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue