diff mbox series

[v2,1/6] package/nvidia-modprobe: new package

Message ID 20200808123918.1880533-1-christian@paral.in
State RFC
Headers show
Series [v2,1/6] package/nvidia-modprobe: new package | expand

Commit Message

Christian Stewart Aug. 8, 2020, 12:39 p.m. UTC
nvidia-modprobe package adds a utility and headers for probing the NVIDIA
hardware at runtime.

https://github.com/NVIDIA/nvidia-modprobe

Signed-off-by: Christian Stewart <christian@paral.in>
---
 package/Config.in                            |  1 +
 package/nvidia-modprobe/Config.in            | 12 ++++++
 package/nvidia-modprobe/nvidia-modprobe.hash |  3 ++
 package/nvidia-modprobe/nvidia-modprobe.mk   | 45 ++++++++++++++++++++
 4 files changed, 61 insertions(+)
 create mode 100644 package/nvidia-modprobe/Config.in
 create mode 100644 package/nvidia-modprobe/nvidia-modprobe.hash
 create mode 100644 package/nvidia-modprobe/nvidia-modprobe.mk

Comments

Asaf Kahlon Aug. 8, 2020, 1:58 p.m. UTC | #1
Hello,

On Sat, Aug 8, 2020 at 3:39 PM Christian Stewart <christian@paral.in> wrote:
>
> nvidia-modprobe package adds a utility and headers for probing the NVIDIA
> hardware at runtime.
>
> https://github.com/NVIDIA/nvidia-modprobe
>
> Signed-off-by: Christian Stewart <christian@paral.in>
> ---
>  package/Config.in                            |  1 +
>  package/nvidia-modprobe/Config.in            | 12 ++++++
>  package/nvidia-modprobe/nvidia-modprobe.hash |  3 ++
>  package/nvidia-modprobe/nvidia-modprobe.mk   | 45 ++++++++++++++++++++
>  4 files changed, 61 insertions(+)
>  create mode 100644 package/nvidia-modprobe/Config.in
>  create mode 100644 package/nvidia-modprobe/nvidia-modprobe.hash
>  create mode 100644 package/nvidia-modprobe/nvidia-modprobe.mk
A general note for the whole series: you should add an entry in the
DEVELOPERS file for the new files you add in your patches.

>
> diff --git a/package/Config.in b/package/Config.in
> index 015a7f1054..3349641371 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -501,6 +501,7 @@ endmenu
>         source "package/nanocom/Config.in"
>         source "package/neard/Config.in"
>         source "package/nvidia-driver/Config.in"
> +       source "package/nvidia-modprobe/Config.in"
>         source "package/nvidia-tegra23/Config.in"
>         source "package/nvme/Config.in"
>         source "package/ofono/Config.in"
> diff --git a/package/nvidia-modprobe/Config.in b/package/nvidia-modprobe/Config.in
> new file mode 100644
> index 0000000000..35953a33d4
> --- /dev/null
> +++ b/package/nvidia-modprobe/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_NVIDIA_MODPROBE
> +       bool "nvidia-modprobe"
> +       depends on BR2_TOOLCHAIN_HAS_THREADS
> +       depends on BR2_TOOLCHAIN_USES_GLIBC
> +       help
> +         nvidia-modprobe package adds a utility and headers for
> +         probing the NVIDIA hardware at runtime.
> +
> +         https://github.com/NVIDIA/nvidia-modprobe
> +
> +comment "nvidia-modprobe needs a glibc toolchain w/ threads"
> +       depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAN_USES_GLIBC
> diff --git a/package/nvidia-modprobe/nvidia-modprobe.hash b/package/nvidia-modprobe/nvidia-modprobe.hash
> new file mode 100644
> index 0000000000..99908680f0
> --- /dev/null
> +++ b/package/nvidia-modprobe/nvidia-modprobe.hash
> @@ -0,0 +1,3 @@
> +# Locally computed:
> +sha256 396b4102d3075a2dee3024652fae206a1b38ace54b8efb1e2c20757a11ec19f1  nvidia-modprobe-450.57.tar.gz
> +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
> diff --git a/package/nvidia-modprobe/nvidia-modprobe.mk b/package/nvidia-modprobe/nvidia-modprobe.mk
> new file mode 100644
> index 0000000000..7eeee6716c
> --- /dev/null
> +++ b/package/nvidia-modprobe/nvidia-modprobe.mk
> @@ -0,0 +1,45 @@
> +################################################################################
> +#
> +# nvidia-modprobe
> +#
> +################################################################################
> +
> +NVIDIA_MODPROBE_VERSION = 450.57
> +NVIDIA_MODPROBE_SITE = $(call github,NVIDIA,nvidia-modprobe,$(NVIDIA_MODPROBE_VERSION))
> +NVIDIA_MODPROBE_LICENSE = GPL-2
> +NVIDIA_MODPROBE_LICENSE_FILES = COPYING
> +
> +NVIDIA_MODPROBE_DEPENDENCIES = host-pkgconf
> +NVIDIA_MODPROBE_INSTALL_STAGING = YES
> +
> +define NVIDIA_MODPROBE_BUILD_CMDS
> +       mkdir -p $(@D)/bin
> +       $(TARGET_MAKE_ENV) $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
> +               -I $(@D)/common-utils -I $(@D)/modprobe-utils \
> +               -o $(@D)/bin/nvidia-modprobe \
> +               -DNV_LINUX=true -DPROGRAM_NAME=\"nvidia-modprobe\" \
> +               -DNVIDIA_VERSION=\"$(NVIDIA_MODPROBE_VERSION)\" \
> +               $(@D)/nvidia-modprobe.c $(@D)/modprobe-utils/nvidia-modprobe-utils.c \
> +               $(@D)/modprobe-utils/pci-sysfs.c $(@D)/common-utils/common-utils.c \
> +               $(@D)/common-utils/msg.c $(@D)/common-utils/nvgetopt.c
> +endef
> +
> +define NVIDIA_MODPROBE_INSTALL_STAGING_CMDS
> +       $(INSTALL) -D -m 644 $(@D)/modprobe-utils/nvidia-modprobe-utils.h \
> +               $(STAGING_DIR)/usr/include/nvidia-modprobe-utils/nvidia-modprobe-utils.h
> +       $(INSTALL) -D -m 644 $(@D)/modprobe-utils/pci-enum.h \
> +               $(STAGING_DIR)/usr/include/nvidia-modprobe-utils/pci-enum.h
> +       $(INSTALL) -D -m 644 $(@D)/common-utils/common-utils.h \
> +               $(STAGING_DIR)/usr/include/nvidia-modprobe-utils/nvidia-common-utils.h
> +       $(INSTALL) -D -m 644 $(@D)/common-utils/msg.h \
> +               $(STAGING_DIR)/usr/include/nvidia-modprobe-utils/msg.h
> +       $(INSTALL) -D -m 644 $(@D)/common-utils/nvgetopt.h \
> +               $(STAGING_DIR)/usr/include/nvidia-modprobe-utils/nvgetopt.h
> +endef
> +
> +define NVIDIA_MODPROBE_INSTALL_TARGET_CMDS
> +       $(INSTALL) -m 0755 $(@D)/bin/nvidia-modprobe \
> +               $(TARGET_DIR)/usr/bin/nvidia-modprobe
> +endef
> +
> +$(eval $(generic-package))
> --
> 2.28.0
>
Regards,
Asaf
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index 015a7f1054..3349641371 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -501,6 +501,7 @@  endmenu
 	source "package/nanocom/Config.in"
 	source "package/neard/Config.in"
 	source "package/nvidia-driver/Config.in"
+	source "package/nvidia-modprobe/Config.in"
 	source "package/nvidia-tegra23/Config.in"
 	source "package/nvme/Config.in"
 	source "package/ofono/Config.in"
diff --git a/package/nvidia-modprobe/Config.in b/package/nvidia-modprobe/Config.in
new file mode 100644
index 0000000000..35953a33d4
--- /dev/null
+++ b/package/nvidia-modprobe/Config.in
@@ -0,0 +1,12 @@ 
+config BR2_PACKAGE_NVIDIA_MODPROBE
+	bool "nvidia-modprobe"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  nvidia-modprobe package adds a utility and headers for
+	  probing the NVIDIA hardware at runtime.
+
+	  https://github.com/NVIDIA/nvidia-modprobe
+
+comment "nvidia-modprobe needs a glibc toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAN_USES_GLIBC
diff --git a/package/nvidia-modprobe/nvidia-modprobe.hash b/package/nvidia-modprobe/nvidia-modprobe.hash
new file mode 100644
index 0000000000..99908680f0
--- /dev/null
+++ b/package/nvidia-modprobe/nvidia-modprobe.hash
@@ -0,0 +1,3 @@ 
+# Locally computed:
+sha256 396b4102d3075a2dee3024652fae206a1b38ace54b8efb1e2c20757a11ec19f1  nvidia-modprobe-450.57.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/nvidia-modprobe/nvidia-modprobe.mk b/package/nvidia-modprobe/nvidia-modprobe.mk
new file mode 100644
index 0000000000..7eeee6716c
--- /dev/null
+++ b/package/nvidia-modprobe/nvidia-modprobe.mk
@@ -0,0 +1,45 @@ 
+################################################################################
+#
+# nvidia-modprobe
+#
+################################################################################
+
+NVIDIA_MODPROBE_VERSION = 450.57
+NVIDIA_MODPROBE_SITE = $(call github,NVIDIA,nvidia-modprobe,$(NVIDIA_MODPROBE_VERSION))
+NVIDIA_MODPROBE_LICENSE = GPL-2
+NVIDIA_MODPROBE_LICENSE_FILES = COPYING
+
+NVIDIA_MODPROBE_DEPENDENCIES = host-pkgconf
+NVIDIA_MODPROBE_INSTALL_STAGING = YES
+
+define NVIDIA_MODPROBE_BUILD_CMDS
+	mkdir -p $(@D)/bin
+	$(TARGET_MAKE_ENV) $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
+		-I $(@D)/common-utils -I $(@D)/modprobe-utils \
+		-o $(@D)/bin/nvidia-modprobe \
+		-DNV_LINUX=true -DPROGRAM_NAME=\"nvidia-modprobe\" \
+		-DNVIDIA_VERSION=\"$(NVIDIA_MODPROBE_VERSION)\" \
+		$(@D)/nvidia-modprobe.c $(@D)/modprobe-utils/nvidia-modprobe-utils.c \
+		$(@D)/modprobe-utils/pci-sysfs.c $(@D)/common-utils/common-utils.c \
+		$(@D)/common-utils/msg.c $(@D)/common-utils/nvgetopt.c
+endef
+
+define NVIDIA_MODPROBE_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 644 $(@D)/modprobe-utils/nvidia-modprobe-utils.h \
+		$(STAGING_DIR)/usr/include/nvidia-modprobe-utils/nvidia-modprobe-utils.h
+	$(INSTALL) -D -m 644 $(@D)/modprobe-utils/pci-enum.h \
+		$(STAGING_DIR)/usr/include/nvidia-modprobe-utils/pci-enum.h
+	$(INSTALL) -D -m 644 $(@D)/common-utils/common-utils.h \
+		$(STAGING_DIR)/usr/include/nvidia-modprobe-utils/nvidia-common-utils.h
+	$(INSTALL) -D -m 644 $(@D)/common-utils/msg.h \
+		$(STAGING_DIR)/usr/include/nvidia-modprobe-utils/msg.h
+	$(INSTALL) -D -m 644 $(@D)/common-utils/nvgetopt.h \
+		$(STAGING_DIR)/usr/include/nvidia-modprobe-utils/nvgetopt.h
+endef
+
+define NVIDIA_MODPROBE_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/bin/nvidia-modprobe \
+		$(TARGET_DIR)/usr/bin/nvidia-modprobe
+endef
+
+$(eval $(generic-package))