]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions.sh: find_binary: path starting with variable
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Sun, 7 Oct 2012 13:29:03 +0000 (15:29 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 8 Oct 2012 07:46:19 +0000 (03:46 -0400)
Credits go to Alexander Tsoy <bugs+gentoo@puleglot.ru> who provided the
patch with following explanation:

  I get messages "Skipping program $env{DM_SBIN_PATH}/..." when
  generating initramfs. This happens because some udev rules contains
  variables in path to command:

  $ egrep -r 'IMPORT\{program\}=\"\$' /lib64/udev/rules.d/
  /lib64/udev/rules.d/10-dm.rules:ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env{DM_COOKIE}"

  [...]

  $ sudo dracut -f "" 3.5.4-hardened-r1
  I: *** Including module: dm ***
  I: Skipping program $env{DM_SBIN_PATH}/dmsetup using in udev rule 10-dm.rules as it cannot be found

dracut-functions.sh

index 8f59ff457b660d083d96111458245eec7fe4d1ac..58b0b4dccd1822cddfe07bc78bfd59dc1150ab8c 100755 (executable)
@@ -45,7 +45,7 @@ find_binary() {
         fi
     fi
 
-    type -P $1
+    type -P ${1##*/}
 }
 
 if ! [[ $dracutbasedir ]]; then