]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Add module "90nvdimm" for NVDIMM support
authorMartin Wilck <mwilck@suse.com>
Thu, 30 Jan 2020 12:48:11 +0000 (13:48 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 6 Mar 2020 09:52:06 +0000 (10:52 +0100)
Detection of persistent memory devices works mostly out of the box
already. Only the "provider" modules for ndbus devices, which are responsible
to extract information of available NVDIMM devices and their configuration
from system firmware, are only indirectly linked into the module stack.
Examples for such modules are nfit.ko, nd_e820.ko, and virtio-pmem.ko.

Add a module that resolves these dependencies.

modules.d/90nvdimm/module-setup.sh [new file with mode: 0755]

diff --git a/modules.d/90nvdimm/module-setup.sh b/modules.d/90nvdimm/module-setup.sh
new file mode 100755 (executable)
index 0000000..6d58efd
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# called by dracut
+check() {
+    if [[ ! $hostonly ]]; then
+        return 0
+    fi
+    [[ $DRACUT_KERNEL_MODALIASES && -f "$DRACUT_KERNEL_MODALIASES" ]] && \
+        grep -q libnvdimm "$DRACUT_KERNEL_MODALIASES" && return 0
+    return 255
+}
+
+# called by dracut
+depends() {
+    return 0
+}
+
+# called by dracut
+installkernel() {
+    # Directories to search for NVDIMM "providers" (firmware drivers)
+    # These modules call "nvdimm_bus_register()".
+    local _provider_dirs='=drivers/nvdimm =drivers/acpi =arch/powerpc'
+
+    #instmods() will take care of hostonly
+    dracut_instmods -o -s nvdimm_bus_register $_provider_dirs
+}
+
+# called by dracut
+install() {
+    inst_multiple -o ndctl
+}