Description of problem: The dracut internal variable dracut_cmd is set with 'readlink -f $0'. If the argument to readlink -f is not a full path and does not exist in the current working directly, then readlink -f returns $PWD/$0. If regenerate _all is set, then dracut calls $dracut_cmd. Presumably this is as root, so I'm setting a high severity. Version-Release: dracut-046-5.fc27.x86_64 How reproducible: 100% Steps to Reproduce: 1. Run dracut --regenerate all 2. 3. Actual results: It runs $PWD/dracut. Expected results: It runs /usr/bin/dracut. Additional info: I haven't actually run with --regenerate-all. I'm chasing another problem, this jumped out at me, and I thought I should flag it... With a fix, you may want to leave a testing override - which is presumably why readlink was used.
Oh dear, fancy "pagure over dist-git" stuff is still broken. I am definitely not the default assignee for "dracut", re-assigning manually for now. Reported the issue at https://pagure.io/fedora-infrastructure/issue/6587 already.
Hmm, I don't know how $0 could end up without a path. With "--help printing $dracut_cmd" cat << EOF Usage: $dracut_cmd [OPTION]... [<initramfs> [<kernel-version>]] Test: creating local dracut executable: ~ # cat dracut #!/bin/sh echo "FAIL" ~ # ./dracut FAIL Testing /usr/bin/dracut: ~ # dracut --help | head -1 Usage: /usr/bin/dracut [OPTION]... [<initramfs> [<kernel-version>]]
In a POSIX shell, $0 is not required to include the full path - only the path components that were used. But bash is not a POSIX shell, and this is not a bug.