If kernel version is not passed in the command line for a dracut invocation then
dracut.sh should be the only place where kernel version is determined.
Remove the heuristic to determine kernel version from dracut-init.sh.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-export LC_MESSAGES=C
+export LC_MESSAGES=C kernel
if [[ $EUID == "0" ]] && ! [[ ${DRACUT_NO_XATTR-} ]]; then
export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr"
mkdir -p "$initdir"
fi
-if ! [[ ${kernel-} ]]; then
- kernel=$(uname -r)
- export kernel
-fi
-
srcmods="$(realpath -e "${dracutsysrootdir-}/lib/modules/$kernel")"
[[ ${drivers_dir-} ]] && {