initramfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mwilck-IBi9RG/b67k@public.gmane.org
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>,
	Daniel Molkentin <dmolkentin-l3A5Bk7waGM@public.gmane.org>,
	Thomas Blume <Thomas.Blume-IBi9RG/b67k@public.gmane.org>,
	Martin Wilck <mwilck-IBi9RG/b67k@public.gmane.org>,
	Kairui Song <kasong-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 1/2] Add module "90nvdimm" for NVDIMM support
Date: Thu, 30 Jan 2020 16:18:20 +0100	[thread overview]
Message-ID: <20200130151821.24042-1-mwilck@suse.com> (raw)

From: Martin Wilck <mwilck-IBi9RG/b67k@public.gmane.org>

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 | 31 ++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100755 modules.d/90nvdimm/module-setup.sh

diff --git a/modules.d/90nvdimm/module-setup.sh b/modules.d/90nvdimm/module-setup.sh
new file mode 100755
index 0000000..98913a4
--- /dev/null
+++ b/modules.d/90nvdimm/module-setup.sh
@@ -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 /usr/bin/ndctl
+}
-- 
2.25.0


             reply	other threads:[~2020-01-30 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 15:18 mwilck-IBi9RG/b67k [this message]
     [not found] ` <20200130151821.24042-1-mwilck-IBi9RG/b67k@public.gmane.org>
2020-01-30 15:18   ` [PATCH 2/2] 90kernel-modules: remove nfit from static module list mwilck-IBi9RG/b67k
     [not found]     ` <20200130151821.24042-2-mwilck-IBi9RG/b67k@public.gmane.org>
2020-01-30 16:04       ` Dracut GitHub Import Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200130151821.24042-1-mwilck@suse.com \
    --to=mwilck-ibi9rg/b67k@public.gmane.org \
    --cc=Thomas.Blume-IBi9RG/b67k@public.gmane.org \
    --cc=dmolkentin-l3A5Bk7waGM@public.gmane.org \
    --cc=harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hare-l3A5Bk7waGM@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kasong-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).