From: Daniel Molkentin Date: Thu, 18 Jan 2018 16:45:01 +0000 (+0100) Subject: 50plymouth: improve distro compatibility X-Git-Tag: 047~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=421b46f8ae89cfe2b62e880a8a5079ee8c1b3aae;p=thirdparty%2Fdracut.git 50plymouth: improve distro compatibility The existence of dpkg-achitecture is not indicative of a debian installation. It may well be installed on systems of people who package for both distros. The previous code path did not take that into account. We now traverse all known plymouth directories, locking on the first valid one, and try to work with it. At the same time, we do not include the module if the plymouth directory could not be found. --- diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh index 27dafcac0..5fbca8b00 100755 --- a/modules.d/50plymouth/module-setup.sh +++ b/modules.d/50plymouth/module-setup.sh @@ -1,8 +1,23 @@ #!/bin/bash +pkglib_dir() { + local _dirs="/usr/lib/plymouth /usr/libexec/plymouth/" + if type -P dpkg-architecture &>/dev/null; then + _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth" + fi + for _dir in $_dirs; do + if [ -d $_dir ]; then + echo $_dir + return + fi + done +} + # called by dracut check() { [[ "$mount_needs" ]] && return 1 + [ -z $(pkglib_dir) ] && return 1 + require_binaries plymouthd plymouth plymouth-set-default-theme } @@ -13,12 +28,7 @@ depends() { # called by dracut install() { - PKGLIBDIR="/usr/lib/plymouth" - if type -P dpkg-architecture &>/dev/null; then - PKGLIBDIR="/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth" - fi - [ -x /usr/libexec/plymouth/plymouth-populate-initrd ] && PKGLIBDIR="/usr/libexec/plymouth" - + PKGLIBDIR=$(pkglib_dir) if grep -q nash ${PKGLIBDIR}/plymouth-populate-initrd \ || [ ! -x ${PKGLIBDIR}/plymouth-populate-initrd ]; then . "$moddir"/plymouth-populate-initrd.sh