From: foopub <45460217+foopub@users.noreply.github.com> Date: Wed, 3 Feb 2021 17:41:08 +0000 (+0000) Subject: Fix bad ls parsing X-Git-Tag: 052~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c409108b0489e7d70f5f6a830d874a9384d4f8d2;p=thirdparty%2Fdracut.git Fix bad ls parsing This used to cause some echo write/invalid argument errors. Simplest fix is to use readlink with -f for absolute path and -n to remove trailing newline. See previous discussion here: https://github.com/void-linux/void-packages/issues/13024 --- diff --git a/modules.d/95resume/resume.sh b/modules.d/95resume/resume.sh index 8d366755f..e7becd0ae 100755 --- a/modules.d/95resume/resume.sh +++ b/modules.d/95resume/resume.sh @@ -14,9 +14,5 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin esac [ -x "$(command -v resume)" ] && command resume $a_splash "$resume" - # parsing the output of ls is Bad, but until there is a better way... - ls -lH "$resume" | ( - read x x x x maj min x; - echo "${maj%,}:$min"> /sys/power/resume) - >/.resume + (readlink -fn $resume > /sys/power/resume)>/.resume }