diff --git a/dracut-functions.sh b/dracut-functions.sh index 1431dd18..ccc48971 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -676,17 +676,6 @@ get_ucode_file () fi } -# Get currently loaded modules -# sorted, and delimited by newline -get_loaded_kernel_modules () -{ - local modules=( ) - while read _module _size _used _used_by; do - modules+=( "$_module" ) - done <<< "$(lsmod | sed -n '1!p')" - printf '%s\n' "${modules[@]}" | sort -} - # Not every device in /dev/mapper should be examined. # If it is an LVM device, touch only devices which have /dev/VG/LV symlink. lvm_internal_dev() { diff --git a/dracut.sh b/dracut.sh index fd9903b6..41fd76f9 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1490,7 +1490,7 @@ dinfo "*** Including modules done ***" ## final stuff that has to happen if [[ $no_kernel != yes ]]; then if [[ $hostonly ]]; then - echo "$(get_loaded_kernel_modules)" > $initdir/lib/dracut/loaded-kernel-modules.txt + cp "$DRACUT_KERNEL_MODALIASES" $initdir/lib/dracut/hostonly-kernel-modules.txt fi if [[ $drivers ]]; then