Skip to content

add lvm-on-luks partition to crypttab #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/Core/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2879,11 +2879,19 @@ public class Main : GLib.Object{
// check and add entries for mapped devices which are encrypted

foreach(var mnt in mount_list){
if ((mnt.device != null) && (mnt.device.parent != null) && (mnt.device.is_on_encrypted_partition())){

if ((mnt.device != null) && (mnt.device.parent != null)
&& ((mnt.device.is_on_encrypted_partition())
|| ((mnt.device.parent.parent != null) &&
(mnt.device.parent.is_on_encrypted_partition())))){

// We could be either directly on LUKS or on LVM-on-LUKS,
// so be sure to get the top-level LUKS UUID.
var crypt_parent = (mnt.device.is_on_encrypted_partition()) ?
mnt.device.parent.uuid : mnt.device.parent.parent.uuid;

// find existing
var entry = CryptTabEntry.find_entry_by_uuid(
crypttab_list, mnt.device.parent.uuid);
crypttab_list, crypt_parent);

// add if missing
if (entry == null){
Expand All @@ -2892,8 +2900,8 @@ public class Main : GLib.Object{
}

// set custom values
entry.device_uuid = mnt.device.parent.uuid;
entry.mapped_name = "luks-%s".printf(mnt.device.parent.uuid);
entry.device_uuid = crypt_parent;
entry.mapped_name = "luks-%s".printf(crypt_parent);
entry.keyfile = "none";
entry.options = "luks,nofail";
}
Expand Down