kernel: add kmod-nvme package
authorDaniel Golle <daniel@makrotopia.org>
Tue, 26 Jul 2022 08:17:07 +0000 (10:17 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 23 Oct 2022 11:20:32 +0000 (13:20 +0200)
Add driver for NVM Express block devices, ie. PCIe connected SSDs.

Targets which allow booting from NVMe (x86, maybe some mvebu boards come
to mind) should have it built-in, so rootfs can be mounted from there.
For targets without NVMe support in bootloader or BIOS/firmware it's
sufficient to provide the kernel module package.

On targets having the NVMe driver built-in the resulting kmod package
is an empty dummy. In any case, depending on or installing kmod-nvme
results in driver support being available (either because it was already
built-in or because the relevant kernel modules are added and loaded).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit dbe53352e38d20bb5245158b19d4ff810c209548)

package/kernel/linux/modules/block.mk

index 2be9ef0c649a24ce60e00414770f5a1bd4d2364e..52541f25925c9660be89e3ad1cfd3290affb822d 100644 (file)
@@ -508,6 +508,29 @@ endef
 $(eval $(call KernelPackage,nbd))
 
 
+define KernelPackage/nvme
+  SUBMENU:=$(BLOCK_MENU)
+  TITLE:=NVM Express block device
+  DEPENDS:=@PCI_SUPPORT
+  KCONFIG:= \
+       CONFIG_NVME_CORE \
+       CONFIG_BLK_DEV_NVME \
+       CONFIG_NVME_MULTIPATH=n \
+       CONFIG_NVME_HWMON=n
+  FILES:= \
+       $(LINUX_DIR)/drivers/nvme/host/nvme-core.ko \
+       $(LINUX_DIR)/drivers/nvme/host/nvme.ko
+  AUTOLOAD:=$(call AutoLoad,30,nvme-core nvme)
+endef
+
+define KernelPackage/nvme/description
+ Kernel module for NVM Express solid state drives directly
+ connected to the PCI or PCI Express bus.
+endef
+
+$(eval $(call KernelPackage,nvme))
+
+
 define KernelPackage/scsi-core
   SUBMENU:=$(BLOCK_MENU)
   TITLE:=SCSI device support