Skip to content

Commit

Permalink
package/nvidia-persistenced: new package
Browse files Browse the repository at this point in the history
NVIDIA driver persistence daemon.

Signed-off-by: Raphael Pavlidis <raphael.pavlidis@gmail.com>
[Arnout:
 - disable on BR2_STATIC_LIBS;
 - only depend on tirpc if toolchain doesn't have RPC;
 - use unstripped binary - the strip support in the makefile is utterly
   broken (and we anyway strip in target-finalize);
 - define NVIDIA_PERSISTENCED_USERS directly rather than with another
   variable;
 - install all the systemd stuff in
   NVIDIA_PERSISTENCED_INSTALL_INIT_SYSTEMD.
]
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
  • Loading branch information
Raphael Pavlidis authored and arnout committed Sep 30, 2023
1 parent 21a2b1d commit d41386a
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions DEVELOPERS
Original file line number Diff line number Diff line change
Expand Up @@ -2511,6 +2511,7 @@ F: support/testing/tests/package/test_python_rsa.py
F: support/testing/tests/package/test_python_s3transfer.py

N: Raphael Pavlidis <raphael.pavlidis@gmail.com>
F: package/nvidia-persistenced/
F: package/shadow/
F: package/slirp4netns/
F: package/sway/
Expand Down
1 change: 1 addition & 0 deletions package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ endmenu
source "package/neard/Config.in"
source "package/nvidia-driver/Config.in"
source "package/nvidia-modprobe/Config.in"
source "package/nvidia-persistenced/Config.in"
source "package/nvme/Config.in"
source "package/ofono/Config.in"
source "package/ola/Config.in"
Expand Down
14 changes: 14 additions & 0 deletions package/nvidia-persistenced/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config BR2_PACKAGE_NVIDIA_PERSISTENCED
bool "nvidia-persistenced"
depends on BR2_USE_MMU # fork()
depends on !BR2_STATIC_LIBS # dlfcn.h
depends on BR2_TOOLCHAIN_HAS_THREADS # libtirpc
select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC
help
NVIDIA driver persistence daemon.

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

comment "nvidia-persistenced needs a toolchain w/ threads, dynamic libs"
depends on BR2_USE_MMU
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
1 change: 1 addition & 0 deletions package/nvidia-persistenced/nvidia-persistenced.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
u nvidia-persistenced - 'NVIDIA Persistence Daemon'
3 changes: 3 additions & 0 deletions package/nvidia-persistenced/nvidia-persistenced.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Locally computed:
sha256 b84fb8eb86127a725d0134a2c64a64e7844e125dece137e7fe8adf8a33cbe817 nvidia-persistenced-515.48.07.tar.gz
sha256 279d814320adc07ca5a4ee101a0b428ddf22a6f3513b8c051f9eb7be47b2e797 COPYING
47 changes: 47 additions & 0 deletions package/nvidia-persistenced/nvidia-persistenced.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
################################################################################
#
# nvidia-persistenced
#
################################################################################

NVIDIA_PERSISTENCED_VERSION = 515.48.07
NVIDIA_PERSISTENCED_SITE = $(call github,NVIDIA,nvidia-persistenced,$(NVIDIA_PERSISTENCED_VERSION))
NVIDIA_PERSISTENCED_LICENSE = MIT
NVIDIA_PERSISTENCED_LICENSE_FILES = COPYING

NVIDIA_PERSISTENCED_DEPENDENCIES = host-pkgconf

ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
NVIDIA_PERSISTENCED_DEPENDENCIES += libtirpc
endif

define NVIDIA_PERSISTENCED_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
OUTPUTDIR=. ./nvidia-persistenced.unstripped
endef

define NVIDIA_PERSISTENCED_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/nvidia-persistenced.unstripped \
$(TARGET_DIR)/usr/bin/nvidia-persistenced
endef

ifeq ($(BR2_PACKAGE_SYSTEMD_SYSUSERS),y)
define NVIDIA_PERSISTENCED_INSTALL_SYSTEMD_SYSUSERS
$(INSTALL) -D -m 0644 $(NVIDIA_PERSISTENCED_PKGDIR)/nvidia-persistenced.conf \
$(TARGET_DIR)/usr/lib/sysusers.d/nvidia-persistenced.conf
endef
else
define NVIDIA_PERSISTENCED_USERS
nvidia-persistenced -1 nvidia-persistenced -1 * - - - NVIDIA Persistence Daemon
endef
endif

define NVIDIA_PERSISTENCED_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 $(@D)/init/systemd/nvidia-persistenced.service.template \
$(TARGET_DIR)/usr/lib/systemd/system/nvidia-persistenced.service
$(SED) 's/__USER__/nvidia-persistenced/g' \
$(TARGET_DIR)/usr/lib/systemd/system/nvidia-persistenced.service
$(NVIDIA_PERSISTENCED_INSTALL_SYSTEMD_SYSUSERS)
endef

$(eval $(generic-package))

0 comments on commit d41386a

Please sign in to comment.