]> git.ipfire.org Git - thirdparty/dracut.git/blobdiff - dracut-functions.sh
iscsi: always popd, even if there is no iscsi device
[thirdparty/dracut.git] / dracut-functions.sh
index ccc489719678600fdf132136e92677523dcb3bed..1431dd1861da9a27815f5c426668f02b3c095aca 100755 (executable)
@@ -676,6 +676,17 @@ 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() {