os-prober and LUKS
Hello,
I am not sure where to discuss these things, since I can't find the original
repository of os-prober.
While playing around with full-disk-encryption, I stumbled over two problems.
First problem is, that IMHO, the test for separate boot partition seems to be
inversed. Please check/comment this patch:
--- /usr/bin/linux-boot-prober-orig 2024-06-22 01:28:39.158074714 +0200
+++ /usr/bin/linux-boot-prober 2024-06-22 01:27:42.877687702 +0200
@@ -35,7 +35,7 @@
mpoint="$(unescape_mount "$mpoint")"
if [ "$mpoint" != "/target/boot" ] && [ "$mpoint" != "/target" ] && [ "$mpoint" != "/" ]; then
type=$(grep "^$mapped " "$OS_PROBER_TMP/mounted-map" | head -n1 | cut -d " " -f 3)
- if ! grep -q " $mpoint/boot " "$OS_PROBER_TMP/mounted-map"; then
+ if grep -q " $mpoint/boot " "$OS_PROBER_TMP/mounted-map"; then
linux_mount_boot "$partition" "$mpoint"
bootpart="${mountboot%% *}"
bootmounted="${mountboot#* }"
Second is a missing feature. OS on LUKS volumes wont be checked at all, even
if the partition is currently unlocked. Please check/comment on this patch:
--- /usr/bin/os-prober-orig 2021-07-11 04:43:50.000000000 +0200
+++ /usr/bin/os-prober 2024-06-21 22:13:54.286221887 +0200
@@ -74,6 +74,15 @@
echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name |
sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|")"
fi
+
+ # Also detect OSes on LUKS encrypted volumes that are currently unlocked
+ if type cryptsetup >/dev/null 2>&1; then
+ for device in $(ls /dev/mapper); do
+ if [ "$(cryptsetup status /dev/mapper/$device | grep LUKS)" != "" ]; then
+ echo "/dev/mapper/$device"
+ fi
+ done
+ fi
}
parse_proc_swaps () {
--
Josef Wolf
jw@raven.inka.de
Reply to: