Merge ~nwg/ubuntu/+source/os-prober:scan-luks-partitions into ubuntu/+source/os-prober:ubuntu/devel

Proposed by Nathaniel Griswold
Status: Needs review
Proposed branch: ~nwg/ubuntu/+source/os-prober:scan-luks-partitions
Merge into: ubuntu/+source/os-prober:ubuntu/devel
Diff against target: 20 lines (+9/-0)
1 file modified
os-prober (+9/-0)
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
git-ubuntu import Pending
Review via email: mp+465944@code.launchpad.net

Commit message

Also scan LUKS encrypted partitions

Description of the change

Ubuntu bug #530252 still exists on branch main and on my jammy system

This patch adds LUKS encrypted partitions to `partions ()' in
/usr/bin/os-prober

https://bugs.launchpad.net/ubuntu/+source/os-prober/+bug/530252

To post a comment you must log in.

Unmerged commits

70b3e94... by Nathaniel Griswold <email address hidden>

Detect LUKS encrypted volumes in partitions ()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/os-prober b/os-prober
2index 0d73ade..ebb1f90 100755
3--- a/os-prober
4+++ b/os-prober
5@@ -73,6 +73,15 @@ partitions () {
6 echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name |
7 sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|")"
8 fi
9+
10+ # Also detect OSes on LUKS encrypted volumes that are currently unlocked
11+ if type cryptsetup >/dev/null 2>&1; then
12+ for device in $(ls /dev/mapper); do
13+ if [ "$(cryptsetup status /dev/mapper/$device | grep LUKS)" != "" ]; then
14+ echo "/dev/mapper/$device"
15+ fi
16+ done
17+ fi
18 }
19
20 parse_proc_swaps () {

Subscribers

People subscribed via source and target branches