From 1a9eb8973efc4df619111548fd1a2c901ab71596 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Thu, 26 Sep 2024 00:55:36 +0200 Subject: [PATCH] postmarketos-initramfs: run_hooks: hide ls error (MR 5636) We need to use ls to check if the hooks dir contains any hooks (otherwise the wildcard doesn't work). But ls prints an error if the dir is missing or empty. Hide the error to not pollute the log. Signed-off-by: Caleb Connolly --- main/postmarketos-initramfs/init_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/postmarketos-initramfs/init_functions.sh b/main/postmarketos-initramfs/init_functions.sh index f10d06be1..00c3339f2 100644 --- a/main/postmarketos-initramfs/init_functions.sh +++ b/main/postmarketos-initramfs/init_functions.sh @@ -681,7 +681,7 @@ mount_root_partition() { run_hooks() { scriptsdir="$1" - if [ -z "$(ls -A "$scriptsdir")" ]; then + if [ -z "$(ls -A "$scriptsdir" 2>/dev/null)" ]; then return fi