]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(plymouth): hide dpkg-architecture stderr messages
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Wed, 16 Mar 2022 16:01:37 +0000 (17:01 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Sun, 27 Mar 2022 18:37:39 +0000 (18:37 +0000)
dpkg-architecture prints warnings and errors to stderr. If the system does
not have gcc installed, it issues a warning:

dpkg-architecture: warning: cannot determine CC system type, falling back to default (native compilation)

This fix checks only the value of the queried variable.

modules.d/50plymouth/module-setup.sh

index 32aa3ff8b90c4d7eb08011aa216f279b71388765..cc6629bae166fc032b75c14807c384d42b6d3a03 100755 (executable)
@@ -3,7 +3,9 @@
 pkglib_dir() {
     local _dirs="/usr/lib/plymouth /usr/libexec/plymouth/"
     if find_binary dpkg-architecture &> /dev/null; then
-        _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
+        local _arch
+        _arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null)
+        [ -n "$_arch" ] && _dirs+=" /usr/lib/$_arch/plymouth"
     fi
     for _dir in $_dirs; do
         if [ -x "$dracutsysrootdir""$_dir"/plymouth-populate-initrd ]; then