From d5cb7ecec9d10069e2e37a2f88680dff6d3f6eb6 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Sun, 22 Oct 2023 10:22:21 -0400 Subject: [PATCH] use findmnt --- usr/bin/remount-secure | 2 +- usr/lib/dracut/modules.d/20remount-secure/module-setup.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/usr/bin/remount-secure b/usr/bin/remount-secure index 63a7eb4..2b88822 100755 --- a/usr/bin/remount-secure +++ b/usr/bin/remount-secure @@ -79,7 +79,7 @@ remount_secure() { ## example status_file_full_path: ## /run/remount-secure/_home - mount_line_of_mount_folder="$(echo "$mount_output" | grep "$mount_folder ")" || true + mount_line_of_mount_folder="$(findmnt --noheadings "$mount_folder")" || true if echo "$mount_line_of_mount_folder" | grep --quiet "$new_mount_options" ; then $output_command "INFO: $mount_folder has already intended mount options. ($new_mount_options)" diff --git a/usr/lib/dracut/modules.d/20remount-secure/module-setup.sh b/usr/lib/dracut/modules.d/20remount-secure/module-setup.sh index ba127f2..52b5faa 100755 --- a/usr/lib/dracut/modules.d/20remount-secure/module-setup.sh +++ b/usr/lib/dracut/modules.d/20remount-secure/module-setup.sh @@ -5,6 +5,7 @@ # called by dracut check() { + require_binaries findmnt || return 1 require_binaries touch || return 1 require_binaries grep || return 1 require_binaries id || return 1 @@ -20,6 +21,7 @@ depends() { # called by dracut install() { + inst_multiple findmnt inst_multiple touch inst_multiple grep inst_multiple id