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 <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-09-26 00:55:36 +02:00 committed by Clayton Craft
parent d8530c4144
commit 1a9eb8973e
No known key found for this signature in database
GPG Key ID: 4A4CED6D7EDF950A

View File

@ -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