From 8cb2c78769598943a9e8059f616fbf39458987a4 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 17 Jun 2022 11:48:51 +0000 Subject: [PATCH 1/3] nvidia-container-runtime: Update to newer version Sync with the current version of meta-tegra. Changelog-entry: nvidia-container-runtime: Update to newer version Signed-off-by: Alex Gonzalez --- .../nvidia-container-runtime/l4t.csv | 187 ------------------ .../nvidia-container-runtime_%.bbappend | 2 - .../nvidia-container-runtime_3.1.0.bb | 7 +- 3 files changed, 3 insertions(+), 193 deletions(-) diff --git a/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime/l4t.csv b/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime/l4t.csv index 8b56b4658..1d65008ab 100644 --- a/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime/l4t.csv +++ b/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime/l4t.csv @@ -21,190 +21,3 @@ dev, /dev/tegra_dc_ctrl dev, /dev/nvhost-msenc dev, /dev/nvhost-nvenc1 dev, /dev/nvhost-nvjpg -lib, /usr/lib/libv4l2.so.0 -dir, /lib/firmware/tegra19x -dir, /lib/firmware/tegra18x -dir, /lib/firmware/tegra21x -lib, /usr/lib/weston/desktop-shell.so -lib, /usr/lib/weston/drm-backend.so -lib, /usr/lib/weston/EGLWLInputEventExample -lib, /usr/lib/weston/EGLWLMockNavigation -lib, /usr/lib/weston/gl-renderer.so -lib, /usr/lib/weston/hmi-controller.so -lib, /usr/lib/weston/ivi-controller.so -lib, /usr/lib/weston/ivi-shell.so -lib, /usr/lib/weston/LayerManagerControl -lib, /usr/lib/weston/libilmClient.so.2.2.0 -lib, /usr/lib/weston/libilmCommon.so.2.2.0 -lib, /usr/lib/weston/libilmControl.so.2.2.0 -lib, /usr/lib/weston/libilmInput.so.2.2.0 -lib, /usr/lib/weston/libweston-6.so.0 -lib, /usr/lib/weston/libweston-desktop-6.so.0 -lib, /usr/lib/weston/simple-weston-client -lib, /usr/lib/weston/spring-tool -lib, /usr/lib/weston/wayland-backend.so -lib, /usr/lib/weston/weston -lib, /usr/lib/weston/weston-calibrator -lib, /usr/lib/weston/weston-clickdot -lib, /usr/lib/weston/weston-cliptest -lib, /usr/lib/weston/weston-debug -lib, /usr/lib/weston/weston-desktop-shell -lib, /usr/lib/weston/weston-dnd -lib, /usr/lib/weston/weston-eventdemo -lib, /usr/lib/weston/weston-flower -lib, /usr/lib/weston/weston-fullscreen -lib, /usr/lib/weston/weston-image -lib, /usr/lib/weston/weston-info -lib, /usr/lib/weston/weston-keyboard -lib, /usr/lib/weston/weston-launch -lib, /usr/lib/weston/weston-multi-resource -lib, /usr/lib/weston/weston-resizor -lib, /usr/lib/weston/weston-scaler -lib, /usr/lib/weston/weston-screenshooter -lib, /usr/lib/weston/weston-simple-dmabuf-egldevice -lib, /usr/lib/weston/weston-simple-egl -lib, /usr/lib/weston/weston-simple-shm -lib, /usr/lib/weston/weston-simple-touch -lib, /usr/lib/weston/weston-smoke -lib, /usr/lib/weston/weston-stacking -lib, /usr/lib/weston/weston-subsurfaces -lib, /usr/lib/weston/weston-terminal -lib, /usr/lib/weston/weston-transformed -lib, /usr/lib/gstreamer-1.0/libgstnvarguscamerasrc.so -lib, /usr/lib/gstreamer-1.0/libgstnvcompositor.so -lib, /usr/lib/gstreamer-1.0/libgstnvdrmvideosink.so -lib, /usr/lib/gstreamer-1.0/libgstnveglglessink.so -lib, /usr/lib/gstreamer-1.0/libgstnveglstreamsrc.so -lib, /usr/lib/gstreamer-1.0/libgstnvegltransform.so -lib, /usr/lib/gstreamer-1.0/libgstnvivafilter.so -lib, /usr/lib/gstreamer-1.0/libgstnvjpeg.so -lib, /usr/lib/gstreamer-1.0/libgstnvtee.so -lib, /usr/lib/gstreamer-1.0/libgstnvv4l2camerasrc.so -lib, /usr/lib/gstreamer-1.0/libgstnvvidconv.so -lib, /usr/lib/gstreamer-1.0/libgstnvvideo4linux2.so -lib, /usr/lib/gstreamer-1.0/libgstnvvideocuda.so -lib, /usr/lib/gstreamer-1.0/libgstnvvideosink.so -lib, /usr/lib/gstreamer-1.0/libgstnvvideosinks.so -lib, /usr/lib/gstreamer-1.0/libgstomx.so -lib, /usr/lib/libgstnvegl-1.0.so.0 -lib, /usr/lib/libgstnvexifmeta.so -lib, /usr/lib/libgstnvivameta.so -lib, /usr/lib/libnvsample_cudaprocess.so -lib, /lib/aarch64-linux-gnu/tegra-egl/ld.so.conf -lib, /lib/aarch64-linux-gnu/tegra-egl/libEGL_nvidia.so.0 -lib, /lib/aarch64-linux-gnu/tegra-egl/libGLESv1_CM_nvidia.so.1 -lib, /lib/aarch64-linux-gnu/tegra-egl/libGLESv2_nvidia.so.2 -lib, /lib/aarch64-linux-gnu/tegra-egl/nvidia.json -lib, /usr/lib/libcuda.so.1.1 -lib, /usr/lib/libdrm.so.2 -lib, /usr/lib/libGLX_nvidia.so.0 -lib, /usr/lib/libnvapputil.so -lib, /usr/lib/libnvargus.so -lib, /usr/lib/libnvargus_socketclient.so -lib, /usr/lib/libnvargus_socketserver.so -lib, /usr/lib/libnvavp.so -lib, /usr/lib/libnvbuf_fdmap.so.1.0.0 -lib, /usr/lib/libnvbufsurface.so.1.0.0 -lib, /usr/lib/libnvbufsurftransform.so.1.0.0 -lib, /usr/lib/libnvbuf_utils.so.1.0.0 -lib, /usr/lib/libnvcameratools.so -lib, /usr/lib/libnvcamerautils.so -lib, /usr/lib/libnvcam_imageencoder.so -lib, /usr/lib/libnvcamlog.so -lib, /usr/lib/libnvcamv4l2.so -lib, /usr/lib/libnvcapture.so -lib, /usr/lib/libnvcolorutil.so -lib, /usr/lib/libnvdc.so -lib, /usr/lib/libnvddk_2d_v2.so -lib, /usr/lib/libnvddk_vic.so -lib, /usr/lib/libnvdla_compiler.so -lib, /usr/lib/libnvdla_runtime.so -lib, /usr/lib/libnvdsbufferpool.so.1.0.0 -lib, /usr/lib/libnveglstream_camconsumer.so -lib, /usr/lib/libnveglstreamproducer.so -lib, /usr/lib/libnveventlib.so -lib, /usr/lib/libnvexif.so -lib, /usr/lib/libnvfnet.so -lib, /usr/lib/libnvfnetstoredefog.so -lib, /usr/lib/libnvfnetstorehdfx.so -lib, /usr/lib/libnvgbm.so -lib, /usr/lib/libnvgov_boot.so -lib, /usr/lib/libnvgov_camera.so -lib, /usr/lib/libnvgov_force.so -lib, /usr/lib/libnvgov_generic.so -lib, /usr/lib/libnvgov_gpucompute.so -lib, /usr/lib/libnvgov_graphics.so -lib, /usr/lib/libnvgov_il.so -lib, /usr/lib/libnvgov_spincircle.so -lib, /usr/lib/libnvgov_tbc.so -lib, /usr/lib/libnvgov_ui.so -lib, /usr/lib/libnvidia-eglcore.so.32.4.4 -lib, /usr/lib/libnvidia-egl-wayland.so -lib, /usr/lib/libnvidia-fatbinaryloader.so.32.4.4 -lib, /usr/lib/libnvidia-glcore.so.32.4.4 -lib, /usr/lib/libnvidia-glsi.so.32.4.4 -lib, /usr/lib/libnvidia-glvkspirv.so.32.4.4 -lib, /usr/lib/libnvidia-ptxjitcompiler.so.32.4.4 -lib, /usr/lib/libnvidia-rmapi-tegra.so.32.4.4 -lib, /usr/lib/libnvidia-tls.so.32.4.4 -lib, /usr/lib/libnvid_mapper.so.1.0.0 -lib, /usr/lib/libnvimp.so -lib, /usr/lib/libnvisp_utils.so -lib, /usr/lib/libnvjpeg.so -lib, /usr/lib/libnvll.so -lib, /usr/lib/libnvmedia.so -lib, /usr/lib/libnvmm_contentpipe.so -lib, /usr/lib/libnvmmlite_image.so -lib, /usr/lib/libnvmmlite.so -lib, /usr/lib/libnvmmlite_utils.so -lib, /usr/lib/libnvmmlite_video.so -lib, /usr/lib/libnvmm_parser.so -lib, /usr/lib/libnvmm.so -lib, /usr/lib/libnvmm_utils.so -lib, /usr/lib/libnvodm_imager.so -lib, /usr/lib/libnvofsdk.so -lib, /usr/lib/libnvomxilclient.so -lib, /usr/lib/libnvomx.so -lib, /usr/lib/libnvosd.so -lib, /usr/lib/libnvos.so -lib, /usr/lib/libnvparser.so -lib, /usr/lib/libnvphsd.so -lib, /usr/lib/libnvphs.so -lib, /usr/lib/libnvpva.so -lib, /usr/lib/libnvrm_gpu.so -lib, /usr/lib/libnvrm_graphics.so -lib, /usr/lib/libnvrm.so -lib, /usr/lib/libnvscf.so -lib, /usr/lib/libnvtestresults.so -lib, /usr/lib/libnvtnr.so -lib, /usr/lib/libnvtracebuf.so -lib, /usr/lib/libnvtvmr.so -lib, /usr/lib/libnvv4l2.so -lib, /usr/lib/libnvv4lconvert.so -lib, /usr/lib/libnvvulkan-producer.so -lib, /usr/lib/libnvwinsys.so -lib, /usr/lib/libsensors.hal-client.nvs.so -lib, /usr/lib/libsensors_hal.nvs.so -lib, /usr/lib/libsensors.l4t.no_fusion.nvs.so -lib, /usr/lib/libtegrav4l2.so -lib, /usr/lib/libv4l2_nvvidconv.so -lib, /usr/lib/libv4l2_nvvideocodec.so -lib, /usr/lib/libvulkan.so.1.2.132 -lib, /usr/lib/nvidia_icd.json -lib, /etc/vulkan/icd.d/nvidia_icd.json -sym, /usr/lib/libdrm_nvdc.so -sym, /usr/lib/libnvdsbufferpool.so -sym, /lib/aarch64-linux-gnu/libv4l2.so.0.0.999999 -sym, /lib/aarch64-linux-gnu/libv4lconvert.so.0.0.999999 -sym, /lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvvidconv.so -sym, /lib/aarch64-linux-gnu/libv4l/plugins/nv/libv4l2_nvvideocodec.so -sym, /usr/lib/libvulkan.so.1.2 -sym, /usr/lib/libcuda.so -sym, /usr/lib/libnvbufsurface.so -sym, /usr/lib/libnvbufsurftransform.so -sym, /usr/lib/libnvbuf_utils.so -sym, /usr/lib/libnvid_mapper.so -lib, /etc/glvnd/egl_vendor.d/10-nvidia.json -lib, /lib/firmware/tegra21x/nvhost_nvdec020_ns.fw -lib, /lib/firmware/tegra18x/nvhost_nvdec030_ns.fw -lib, /lib/firmware/tegra19x/nvhost_nvdec040_ns.fw diff --git a/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_%.bbappend b/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_%.bbappend index 0e24479f4..8c0dba780 100644 --- a/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_%.bbappend +++ b/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_%.bbappend @@ -1,5 +1,3 @@ FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" RDEPENDS:${PN} = "" -# Remove this when using Go >= 1.13 -GOBUILDFLAGS = "-v ${GO_LDFLAGS}" diff --git a/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_3.1.0.bb b/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_3.1.0.bb index 83defd969..0d05283f1 100644 --- a/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_3.1.0.bb +++ b/layers/meta-balena-jetson/recipes-containers/nvidia-container-runtime/nvidia-container-runtime_3.1.0.bb @@ -5,7 +5,7 @@ containers. \ " HOMEPAGE = "https://github.com/NVIDIA/nvidia-container-runtime" -# Taken from meta-tegra at revision 92f1be3f98cff3362e0d3c2bc7b581e541c9412b +# Taken from meta-tegra at revision c9c342a23738f70f4f1b1d53f5d22b3ba237ea2b LICENSE = "BSD-3-Clause & Apache-2.0 & MIT & ISC" LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=06cff45c51018e430083a716510821b7 \ @@ -17,18 +17,17 @@ LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=06cff45c51018e430083a716 file://src/${GO_INSTALL}/vendor/github.com/stretchr/testify/LICENSE;md5=d4c9e9b2abd3afaebed1524a9a77b937" SRC_URI = " \ - git://github.com/NVIDIA/nvidia-container-runtime;protocol=https \ + git://github.com/NVIDIA/nvidia-container-runtime.git;protocol=https;branch=master \ file://l4t.csv \ " SRCREV = "027d6c876ad8c163f53e75cbd5a6a54776985e5c" GO_IMPORT = "github.com/NVIDIA/${BPN}" GO_INSTALL = "${GO_IMPORT}/runtime/src" +export GO111MODULE = "off" S = "${WORKDIR}/git" -REQUIRED_DISTRO_FEATURES = "virtualization" - inherit go do_compile() { From 914b718fc087f71c80bd13252d6a1a229f1b3196 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 17 Jun 2022 12:12:00 +0000 Subject: [PATCH 2/3] nvidia-container-toolkit: Update to newer version Sync with the current version of meta-tegra. Signed-off-by: Alex Gonzalez --- .../nvidia-container-toolkit_%.bbappend | 3 --- .../nvidia-container-toolkit_1.0.5.bb | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_%.bbappend b/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_%.bbappend index 439881724..4ccf3eeb0 100644 --- a/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_%.bbappend +++ b/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_%.bbappend @@ -1,5 +1,2 @@ # We don't need to build or install docker-ce and cuda-toolkit RDEPENDS:${PN} = "" - -# Remove this when using Go >= 1.13 -GOBUILDFLAGS = "-v ${GO_LDFLAGS}" diff --git a/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_1.0.5.bb b/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_1.0.5.bb index 1a1e3c645..eeff16e6f 100644 --- a/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_1.0.5.bb +++ b/layers/meta-balena-jetson/recipes-containers/nvidia-container-toolkit/nvidia-container-toolkit_1.0.5.bb @@ -5,21 +5,21 @@ Provides an OCI hook to enable GPU support in containers. \ #Home page for now HOMEPAGE = "https://github.com/NVIDIA/nvidia-container-runtime" -# Taken from meta-tegra at revision 92f1be3f98cff3362e0d3c2bc7b581e541c9412b +# Taken from meta-tegra at revision c9c342a23738f70f4f1b1d53f5d22b3ba237ea2b LICENSE = "Apache-2.0 & BSD-3-Clause & MIT" LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://src/${GO_IMPORT}/pkg/rpm/SOURCES/LICENSE;md5=06cff45c51018e430083a716510821b7 \ file://src/${GO_INSTALL}/vendor/github.com/BurntSushi/toml/COPYING;md5=9e24c0e2a784c1d1fcabb279f4f107e0" -SRC_URI = "git://github.com/NVIDIA/container-toolkit;protocol=https" +SRC_URI = "git://github.com/NVIDIA/nvidia-container-toolkit.git;protocol=https;branch=master" SRCREV = "60f165ad6901f85b0c3acbf7ce2c66cd759c4fb8" GO_IMPORT = "github.com/NVIDIA/${BPN}" GO_INSTALL = "${GO_IMPORT}/${BPN}" -S = "${WORKDIR}/git" +export GO111MODULE = "off" -REQUIRED_DISTRO_FEATURES = "virtualization" +S = "${WORKDIR}/git" inherit go From 7fb3a27251890a1ed38a369ebd0bec983cc8b09d Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Fri, 17 Jun 2022 12:54:03 +0000 Subject: [PATCH 3/3] libnvidia-container-tools: Update to 0.10.0 This is the version used in meta-tegra. Signed-off-by: Alex Gonzalez --- ...-flags-and-change-path-definitions-s.patch | 16 ++-- ...et-JETSON-variable-if-not-set-before.patch | 29 ++++++ ...g-of-library-paths-for-jetson-mounts.patch | 60 +++++++----- ...-build.h-generation-for-cross-builds.patch | 44 +++++++++ ...for-statically-linking-external-libt.patch | 27 ++++++ ...rrent-directory-as-git-safe-director.patch | 31 ++++++ ...et-JETSON-variable-if-not-set-before.patch | 29 ------ .../libnvidia-container-tools_0.10.0.bb | 96 +++++++++++++++++++ .../libnvidia-container-tools_0.10.0.bbappend | 3 + .../libnvidia-container-tools_0.9.0.bb | 74 -------------- ...dtbsize-rlim_cur-instead-of-rlim_max.patch | 50 ++++++++++ .../libtirpc126_1.2.6.bb | 31 ++++++ 12 files changed, 359 insertions(+), 131 deletions(-) rename layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/{libnvidia-container-tools-0.9.0 => libnvidia-container-tools-0.10.0}/0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch (90%) create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0002-mk-common.mk-set-JETSON-variable-if-not-set-before.patch rename layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/{libnvidia-container-tools-0.9.0 => libnvidia-container-tools-0.10.0}/0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch (84%) create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0004-Fix-build.h-generation-for-cross-builds.patch create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0005-Update-makefile-for-statically-linking-external-libt.patch create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0006-common.mk-Add-current-directory-as-git-safe-director.patch delete mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0002-common.mk-Set-JETSON-variable-if-not-set-before.patch create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bb create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bbappend delete mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.9.0.bb create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126/0001-__rpc_dtbsize-rlim_cur-instead-of-rlim_max.patch create mode 100644 layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126_1.2.6.bb diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch similarity index 90% rename from layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch rename to layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch index 24240069c..0297c3f08 100644 --- a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch @@ -1,17 +1,18 @@ -From f9756aeb7e5095f17cfbe6ec6cfac9ccf63554a5 Mon Sep 17 00:00:00 2001 -From: Pablo Rodriguez Quesada -Date: Thu, 6 Feb 2020 00:10:41 +0000 -Subject: [PATCH] Makefile: Fix RCP flags and change path definitions signs +From 8fdbc558a8a3230899942fe2a8ce4b76cab40846 Mon Sep 17 00:00:00 2001 +From: Ilies CHERGUI +Date: Sun, 8 Aug 2021 21:18:48 +0100 +Subject: [PATCH 1/4] Makefile: Fix RCP flags and change path definitions signs Add RCP -ltirpc flag and fix equal signs on paths definitions. Signed-off-by: Pablo Rodriguez Quesada +Signed-off-by: Ilies CHERGUI --- Makefile | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile -index 8f7f3b4..6150129 100644 +index 8f7f3b4..3f02b9d 100644 --- a/Makefile +++ b/Makefile @@ -13,14 +13,14 @@ WITH_SECCOMP ?= yes @@ -49,7 +50,7 @@ index 8f7f3b4..6150129 100644 -Wstrict-prototypes -Wunreachable-code -Wconversion -Wsign-conversion \ - -Wno-unknown-warning-option -Wno-format-extra-args -Wno-gnu-alignof-expression $(CFLAGS) + -Wno-format-extra-args $(if $(filter clang,$(CCNAME)),-Wno-unknown-warning-option -Wno-gnu-alignof-expression,) \ -+ -I=/usr/include/tirpc $(CFLAGS) ++ -I=/usr/include/tirpc $(CFLAGS) LDFLAGS := -Wl,-zrelro -Wl,-znow -Wl,-zdefs -Wl,--gc-sections $(LDFLAGS) LDLIBS := $(LDLIBS) @@ -89,3 +90,6 @@ index 8f7f3b4..6150129 100644 endif install: all +-- +2.32.0 + diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0002-mk-common.mk-set-JETSON-variable-if-not-set-before.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0002-mk-common.mk-set-JETSON-variable-if-not-set-before.patch new file mode 100644 index 000000000..94f9f6fc5 --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0002-mk-common.mk-set-JETSON-variable-if-not-set-before.patch @@ -0,0 +1,29 @@ +From aa71d4c097034cdcc0b0958d1c3f21da96cc4ead Mon Sep 17 00:00:00 2001 +From: Ilies CHERGUI +Date: Sun, 8 Aug 2021 21:22:14 +0100 +Subject: [PATCH 2/4] mk/common.mk: set JETSON variable if not set before + Changing the equal sign will allow modifying the variable using the + environment variables. + +Signed-off-by: Pablo Rodriguez Quesada +Signed-off-by: Ilies CHERGUI +--- + mk/common.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mk/common.mk b/mk/common.mk +index d6ef499..875e412 100644 +--- a/mk/common.mk ++++ b/mk/common.mk +@@ -24,7 +24,7 @@ DATE := $(shell date -u --iso-8601=minutes) + REVISION := $(shell git rev-parse HEAD) + COMPILER := $(realpath $(shell which $(CC))) + PLATFORM ?= $(shell uname -m) +-JETSON := TRUE ++JETSON ?= TRUE + + ifeq ($(DATE),) + $(error Invalid date format) +-- +2.32.0 + diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch similarity index 84% rename from layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch rename to layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch index 31936af23..e90bc5e69 100644 --- a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch @@ -1,17 +1,19 @@ -From 2753ed9d92689dadc3f91643343735360818a6ea Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Sat, 14 Mar 2020 07:16:38 -0700 -Subject: [PATCH] Fix mapping of library paths for jetson mounts +From 08af34415b46e77e50cbc13846a74fda1352558f Mon Sep 17 00:00:00 2001 +From: Ilies CHERGUI +Date: Sun, 8 Aug 2021 21:40:36 +0100 +Subject: [PATCH 3/4] Fix mapping of library paths for jetson mounts +Signed-off-by: Matt Madison +Signed-off-by: Ilies CHERGUI --- Makefile | 3 +- - src/jetson_mount.c | 72 +++++++++++++++++++++++++++++++++++++++------- + src/jetson_mount.c | 70 ++++++++++++++++++++++++++++++++++++++++------ src/jetson_mount.h | 2 +- - src/nvc_mount.c | 6 ++-- - 4 files changed, 66 insertions(+), 17 deletions(-) + src/nvc_mount.c | 4 +-- + 4 files changed, 65 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile -index 6150129..a574800 100644 +index 3f02b9d..d179986 100644 --- a/Makefile +++ b/Makefile @@ -113,9 +113,8 @@ LIB_PKGCFG := $(LIB_NAME).pc @@ -26,10 +28,10 @@ index 6150129..a574800 100644 -Wall -Wextra -Wcast-align -Wpointer-arith -Wmissing-prototypes -Wnonnull \ -Wwrite-strings -Wlogical-op -Wformat=2 -Wmissing-format-attribute -Winit-self -Wshadow \ diff --git a/src/jetson_mount.c b/src/jetson_mount.c -index dff9c97..8d3e275 100644 +index 1c5d9de..5cf94c8 100644 --- a/src/jetson_mount.c +++ b/src/jetson_mount.c -@@ -18,28 +18,69 @@ +@@ -18,6 +18,9 @@ #include "utils.h" #include "xfuncs.h" #include "jetson_mount.h" @@ -37,6 +39,11 @@ index dff9c97..8d3e275 100644 +#define stringify__(s__) #s__ +static const char *hostlibdir = stringify(HOST_LIBDIR) "/"; + static int + resolve_symlink(struct error *err, const char *src, char *dst) +@@ -34,30 +37,69 @@ resolve_symlink(struct error *err, const char *src, char *dst) + } + char ** -mount_jetson_files(struct error *err, const char *root, const struct nvc_container *cnt, char *paths[], size_t size) +mount_jetson_files(struct error *err, const char *root, const struct nvc_container *cnt, const char *dir, char *paths[], size_t size) @@ -53,11 +60,15 @@ index dff9c97..8d3e275 100644 for (size_t i = 0; i < size; ++i) { + int samepath = 0; + if (!match_jetson_library_flags(paths[i], cnt->flags) && + !match_jetson_directory_flags(paths[i], cnt->flags)) + continue; + if (path_new(err, src, root) < 0) goto fail; - if (path_new(err, dst, cnt->cfg.rootfs) < 0) - goto fail; -- + + if (dir != NULL) { + size_t hostlibdirlen = strlen(hostlibdir); + /* @@ -104,7 +115,7 @@ index dff9c97..8d3e275 100644 goto fail; if (file_mode(err, src, &mode) < 0) -@@ -71,22 +112,31 @@ create_jetson_symlinks(struct error *err, const char *root, const struct nvc_con +@@ -89,25 +131,35 @@ create_jetson_symlinks(struct error *err, const char *root, const struct nvc_con char src[PATH_MAX]; char src_lnk[PATH_MAX]; char dst[PATH_MAX]; @@ -112,11 +123,14 @@ index dff9c97..8d3e275 100644 for (size_t i = 0; i < size; ++i) { + file = basename(paths[i]); + if (!match_jetson_symlink_flags(paths[i], cnt->flags)) + continue; + if (path_new(err, src, root) < 0) return (-1); - if (path_new(err, dst, cnt->cfg.rootfs) < 0) - return (-1); -- + if (path_append(err, src, paths[i]) < 0) return (-1); - if (path_append(err, dst, paths[i]) < 0) @@ -143,12 +157,12 @@ index dff9c97..8d3e275 100644 return (-1); diff --git a/src/jetson_mount.h b/src/jetson_mount.h -index 76ade6a..a7b390f 100644 +index c11e6d3..b1af835 100644 --- a/src/jetson_mount.h +++ b/src/jetson_mount.h -@@ -11,7 +11,7 @@ - int resolve_symlink(struct error *, const char *, char *); - void unmount(const char *); +@@ -8,7 +8,7 @@ + #include "nvc_internal.h" + #include "error.h" -char **mount_jetson_files(struct error *, const char *, const struct nvc_container *, char * [], size_t); +char **mount_jetson_files(struct error *, const char *, const struct nvc_container *, const char *, char * [], size_t); @@ -156,10 +170,10 @@ index 76ade6a..a7b390f 100644 #endif /* HEADER_JETSON_MOUNT_H */ diff --git a/src/nvc_mount.c b/src/nvc_mount.c -index 61af23d..67ac414 100644 +index fc2d0ec..8971e28 100644 --- a/src/nvc_mount.c +++ b/src/nvc_mount.c -@@ -486,15 +486,15 @@ nvc_driver_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const +@@ -477,7 +477,7 @@ nvc_driver_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const log_info("mount jetson libraries"); if (info->jetson->libs != NULL && info->jetson->nlibs > 0) { @@ -168,13 +182,15 @@ index 61af23d..67ac414 100644 goto fail; ptr = array_append(ptr, tmp, array_size(tmp)); free(tmp); - } +@@ -485,7 +485,7 @@ nvc_driver_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const log_info("mount jetson dirs"); -- if (info->jetson->libs != NULL && info->jetson->nlibs > 0) { + if (info->jetson->dirs != NULL && info->jetson->ndirs > 0) { - if ((tmp = (const char **)mount_jetson_files(&ctx->err, ctx->cfg.root, cnt, info->jetson->dirs, info->jetson->ndirs)) == NULL) -+ if (info->jetson->dirs != NULL && info->jetson->ndirs > 0) { + if ((tmp = (const char **)mount_jetson_files(&ctx->err, ctx->cfg.root, cnt, NULL, info->jetson->dirs, info->jetson->ndirs)) == NULL) goto fail; ptr = array_append(ptr, tmp, array_size(tmp)); free(tmp); +-- +2.32.0 + diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0004-Fix-build.h-generation-for-cross-builds.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0004-Fix-build.h-generation-for-cross-builds.patch new file mode 100644 index 000000000..55803a567 --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0004-Fix-build.h-generation-for-cross-builds.patch @@ -0,0 +1,44 @@ +From 9cb99609be811ce0a1b5a53ad01b1ab86f0eefa8 Mon Sep 17 00:00:00 2001 +From: Ilies CHERGUI +Date: Sun, 8 Aug 2021 21:45:09 +0100 +Subject: [PATCH 4/4] Fix build.h generation for cross builds + +Signed-off-by: Matt Madison +Signed-off-by: Ilies CHERGUI +--- + Makefile | 4 ++++ + mk/common.mk | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index d179986..a2aaf17 100644 +--- a/Makefile ++++ b/Makefile +@@ -177,7 +177,11 @@ DEPENDENCIES := $(BIN_OBJS:%.o=%.d) $(LIB_OBJS:%.lo=%.d) + $(BUILD_DEFS): + @printf '#define BUILD_DATE "%s"\n' '$(strip $(DATE))' >$(BUILD_DEFS) + @printf '#define BUILD_COMPILER "%s " __VERSION__\n' '$(notdir $(COMPILER))' >>$(BUILD_DEFS) ++ifeq ($(EXCLUDE_BUILD_FLAGS),) + @printf '#define BUILD_FLAGS "%s"\n' '$(strip $(CPPFLAGS) $(CFLAGS) $(LDFLAGS))' >>$(BUILD_DEFS) ++else ++ @printf '#define BUILD_FLAGS ""\n' >>$(BUILD_DEFS) ++endif + @printf '#define BUILD_REVISION "%s"\n' '$(strip $(REVISION))' >>$(BUILD_DEFS) + @printf '#define BUILD_PLATFORM "%s"\n' '$(strip $(PLATFORM))' >>$(BUILD_DEFS) + +diff --git a/mk/common.mk b/mk/common.mk +index 875e412..f8170de 100644 +--- a/mk/common.mk ++++ b/mk/common.mk +@@ -22,7 +22,7 @@ UID := $(shell id -u) + GID := $(shell id -g) + DATE := $(shell date -u --iso-8601=minutes) + REVISION := $(shell git rev-parse HEAD) +-COMPILER := $(realpath $(shell which $(CC))) ++COMPILER := $(realpath $(shell which $(firstword $(CC)))) + PLATFORM ?= $(shell uname -m) + JETSON ?= TRUE + +-- +2.32.0 + diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0005-Update-makefile-for-statically-linking-external-libt.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0005-Update-makefile-for-statically-linking-external-libt.patch new file mode 100644 index 000000000..c557cd838 --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0005-Update-makefile-for-statically-linking-external-libt.patch @@ -0,0 +1,27 @@ +From 8302198ab0e2bfe9709b747d24cfca79753ed706 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Mon, 18 Oct 2021 02:43:19 -0700 +Subject: [PATCH] Update makefile for statically linking external libtirpc + +Signed-off-by: Matt Madison +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index a2aaf17..231a4ad 100644 +--- a/Makefile ++++ b/Makefile +@@ -127,9 +127,9 @@ LDLIBS := $(LDLIBS) + # Library flags (recursively expanded to handle target-specific flags) + LIB_CPPFLAGS = -DNV_LINUX -isystem $(DEPS_DIR)$(includedir) -include $(BUILD_DEFS) + LIB_CFLAGS = -fPIC +-LIB_LDFLAGS = -L$(DEPS_DIR)$(libdir) -shared -Wl,-soname=$(LIB_SONAME) +-LIB_LDLIBS_STATIC = -l:libnvidia-modprobe-utils.a +-LIB_LDLIBS_SHARED = -ldl -lcap -ltirpc ++LIB_LDFLAGS = -shared -Wl,-soname=$(LIB_SONAME) ++LIB_LDLIBS_STATIC = -L$(DEPS_DIR)$(libdir) -l:libnvidia-modprobe-utils.a -L=$(libdir) -l:libtirpc.a ++LIB_LDLIBS_SHARED = -ldl -lcap -lpthread + ifeq ($(WITH_LIBELF), yes) + LIB_CPPFLAGS += -DWITH_LIBELF + LIB_LDLIBS_SHARED += -lelf diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0006-common.mk-Add-current-directory-as-git-safe-director.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0006-common.mk-Add-current-directory-as-git-safe-director.patch new file mode 100644 index 000000000..cb1591297 --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.10.0/0006-common.mk-Add-current-directory-as-git-safe-director.patch @@ -0,0 +1,31 @@ +From: Alex Gonzalez +Date: Fri, 17 Jun 2022 14:50:13 +0200 +Subject: [PATCH] common.mk: Add current directory as git safe directory + +The security vulnerability CVE-2022-24765 was fixed in git v2.35.2 enforces +new access controls. This has been addressed in newer Poky versions with +the addition of a git-intercept script. +(see 4d7383aefb391a5a998454c70feb96127951ca0a) + +Until then, patch the build scripts to configure the working directory +as safe. + +Upstream-Status: Inappropriate (upstream uses git intercept) +Signed-off-by: Alex Gonzalez +--- + mk/common.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mk/common.mk b/mk/common.mk +index f8170de83a66..346b09da03b9 100644 +--- a/mk/common.mk ++++ b/mk/common.mk +@@ -21,7 +21,7 @@ DOCKER ?= docker + UID := $(shell id -u) + GID := $(shell id -g) + DATE := $(shell date -u --iso-8601=minutes) +-REVISION := $(shell git rev-parse HEAD) ++REVISION := $(shell git config --global --add safe.directory ${PWD} && git rev-parse HEAD) + COMPILER := $(realpath $(shell which $(firstword $(CC)))) + PLATFORM ?= $(shell uname -m) + JETSON ?= TRUE diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0002-common.mk-Set-JETSON-variable-if-not-set-before.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0002-common.mk-Set-JETSON-variable-if-not-set-before.patch deleted file mode 100644 index 030f1635d..000000000 --- a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools-0.9.0/0002-common.mk-Set-JETSON-variable-if-not-set-before.patch +++ /dev/null @@ -1,29 +0,0 @@ -From adee8c49a5c3192bdcc5b859fde356dbd73d6f0b Mon Sep 17 00:00:00 2001 -From: Pablo Rodriguez Quesada -Date: Thu, 6 Feb 2020 00:12:45 +0000 -Subject: [PATCH 2/2] common.mk: Set JETSON variable if not set before - -Changing the equal sign will allow modifying the variable using the -environment variables. - -Signed-off-by: Pablo Rodriguez Quesada ---- - mk/common.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mk/common.mk b/mk/common.mk -index f35903c..09987a3 100644 ---- a/mk/common.mk -+++ b/mk/common.mk -@@ -24,7 +24,7 @@ DATE := $(shell date -u --iso-8601=minutes) - REVISION := $(shell git rev-parse HEAD) - COMPILER := $(realpath $(shell which $(CC))) - PLATFORM ?= $(shell uname -m) --JETSON := $(shell test -f /etc/nv_tegra_release && echo "TRUE") -+JETSON ?= $(shell test -f /etc/nv_tegra_release && echo "TRUE") - - ifeq ($(DATE),) - $(error Invalid date format) --- -2.23.0 - diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bb b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bb new file mode 100644 index 000000000..04a0facea --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bb @@ -0,0 +1,96 @@ +SUMMARY = "NVIDIA container runtime library" + +DESCRIPTION = "NVIDIA container runtime library \ +The nvidia-container library provides an interface to configure GNU/Linux \ +containers leveraging NVIDIA hardware. The implementation relies on several \ +kernel subsystems and is designed to be agnostic of the container runtime. \ +" +HOMEPAGE = "https://github.com/NVIDIA/libnvidia-container" + +COMPATIBLE_MACHINE = "(tegra)" + +DEPENDS = " \ + coreutils-native \ + pkgconfig-native \ + libcap \ + elfutils \ + libtirpc126 \ + ldconfig-native \ +" +LICENSE = "BSD-3-Clause & MIT & Proprietary" + +# From meta-tegra c9c342a23738f70f4f1b1d53f5d22b3ba237ea2b + +# Both source repositories include GPL COPYING (and for +# libnvidia-container, COPYING.LESSER) files. However: +# * For libnvidia-container, those files might only apply if elfutils +# sources were included (the makefile has commands to download and +# build libelf from elfutils sources). We configure the build to +# use libelf provided externally. +# * For nvidia-modprobe, only the nvidia-modprobe-utils library is +# built and used. All sources for that library are MIT-licensed. + +LIC_FILES_CHKSUM = "\ + file://LICENSE;md5=06cff45c51018e430083a716510821b7 \ + file://deps/src/nvidia-modprobe-${NVIDIA_MODPROBE_VERSION}/modprobe-utils/nvidia-modprobe-utils.c;endline=22;md5=8f11a22ea12c5aecde3340212f7fc9a1 \ + file://deps/src/nvidia-modprobe-${NVIDIA_MODPROBE_VERSION}/modprobe-utils/pci-enum.h;endline=29;md5=b2c0e63b1fa594dcb4f4093247d74a29 \ + file://deps/src/nvidia-modprobe-${NVIDIA_MODPROBE_VERSION}/modprobe-utils/pci-sysfs.c;endline=25;md5=a5eee0d4ba40238ac5823a33ead29b6d \ + file://src/cuda.h;endline=48;md5=d212e7eced2562852ccf8267e4811e6f \ +" + +PR = "r1" + +NVIDIA_MODPROBE_VERSION = "396.51" +ELF_TOOLCHAIN_VERSION = "0.7.1" +LIBTIRPC_VERSION = "1.1.4" + +SRC_URI = "git://github.com/NVIDIA/libnvidia-container.git;protocol=https;name=libnvidia;branch=jetson \ + git://github.com/NVIDIA/nvidia-modprobe.git;protocol=https;branch=main;name=modprobe;destsuffix=git/deps/src/nvidia-modprobe-${NVIDIA_MODPROBE_VERSION} \ + file://0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch \ + file://0002-mk-common.mk-set-JETSON-variable-if-not-set-before.patch \ + file://0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch \ + file://0004-Fix-build.h-generation-for-cross-builds.patch \ + file://0005-Update-makefile-for-statically-linking-external-libt.patch \ + " + +SRC_URI[modprobe.md5sum] = "f82b649e7a0f1d1279264f9494e7cf43" +SRC_URI[modprobe.sha256sum] = "25bc6437a384be670e9fd76ac2e5b9753517e23eb16e7fa891b18537b70c4b20" + + +SRCREV_libnvidia = "61f57bcdf7aa6e73d9a348a7e36ec9fd94128fb2" +# Nvidia modprobe version 396.51 +SRCREV_modprobe = "d97c08af5061f1516fb2e3a26508936f69d6d71d" +SRCREV_FORMAT = "libnvidia_modprobe" + +S = "${WORKDIR}/git" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[seccomp] = "WITH_SECCOMP=yes,WITH_SECCOMP=no,libseccomp" + +def build_date(d): + import datetime + epoch = d.getVar('SOURCE_DATE_EPOCH') + if epoch: + dt = datetime.datetime.fromtimestamp(int(epoch), tz=datetime.timezone.utc) + return 'DATE=' + dt.isoformat(timespec='minutes') + return '' + +# We need to link with libelf, otherwise we need to +# include bmake-native which does not exist at the moment. +EXTRA_OEMAKE = "EXCLUDE_BUILD_FLAGS=1 PLATFORM=${HOST_ARCH} JETSON=TRUE WITH_LIBELF=yes ${@build_date(d)} ${PACKAGECONFIG_CONFARGS}" + +CFLAGS:prepend = " -I=/usr/include/tirpc-1.2.6 " + +export OBJCPY="${OBJCOPY}" + +# Fix me: Create an independent recipe for nvidia-modprobe +do_configure:append() { + # Mark Nvidia modprobe as downloaded + touch ${S}/deps/src/nvidia-modprobe-${NVIDIA_MODPROBE_VERSION}/.download_stamp +} + +do_install () { + oe_runmake install DESTDIR=${D} +} + +INSANE_SKIP:${PN} = "already-stripped" diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bbappend b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bbappend new file mode 100644 index 000000000..f86180a39 --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.10.0.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append = " file://0006-common.mk-Add-current-directory-as-git-safe-director.patch" diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.9.0.bb b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.9.0.bb deleted file mode 100644 index 341ada3ad..000000000 --- a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libnvidia-container-tools_0.9.0.bb +++ /dev/null @@ -1,74 +0,0 @@ -SUMMARY = "NVIDIA container runtime library" - -DESCRIPTION = "NVIDIA container runtime library \ -The nvidia-container library provides an interface to configure GNU/Linux \ -containers leveraging NVIDIA hardware. The implementation relies on several \ -kernel subsystems and is designed to be agnostic of the container runtime. \ -" -HOMEPAGE = "https://github.com/NVIDIA/libnvidia-container" - -# Taken from meta-tegra at revision 92f1be3f98cff3362e0d3c2bc7b581e541c9412b - -COMPATIBLE_MACHINE = "(tegra)" - -DEPENDS = " \ - coreutils-native \ - pkgconfig-native \ - libcap \ - elfutils \ - libtirpc \ - ldconfig-native \ -" -LICENSE = "BSD-3-Clause & GPLv3 & Proprietary" - -LIC_FILES_CHKSUM = "\ - file://LICENSE;md5=06cff45c51018e430083a716510821b7 \ - file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ - file://COPYING.LESSER;md5=3000208d539ec061b899bce1d9ce9404 \ -" - -PR = "r1" - -NVIDIA_MODPROBE_VERSION = "396.51" -ELF_TOOLCHAIN_VERSION = "0.7.1" -LIBTIRPC_VERSION = "1.1.4" - -SRC_URI = "git://github.com/NVIDIA/libnvidia-container.git;name=libnvidia;branch=jetson \ - git://github.com/NVIDIA/nvidia-modprobe.git;name=modprobe;branch=main;destsuffix=git/deps/src/nvidia-modprobe-${NVIDIA_MODPROBE_VERSION} \ - file://0001-Makefile-Fix-RCP-flags-and-change-path-definitions-s.patch \ - file://0002-common.mk-Set-JETSON-variable-if-not-set-before.patch \ - file://0003-Fix-mapping-of-library-paths-for-jetson-mounts.patch \ - " - -SRC_URI[modprobe.md5sum] = "f82b649e7a0f1d1279264f9494e7cf43" -SRC_URI[modprobe.sha256sum] = "25bc6437a384be670e9fd76ac2e5b9753517e23eb16e7fa891b18537b70c4b20" - - -SRCREV_libnvidia = "09df17a2424704c1e4af310d3ce51fe475ba292a" -# Nvidia modprobe version 396.51 -SRCREV_modprobe = "d97c08af5061f1516fb2e3a26508936f69d6d71d" - -S = "${WORKDIR}/git" - -PACKAGECONFIG ??= "" -PACKAGECONFIG[seccomp] = " WITH_SECCOMP=yes , WITH_SECCOMP=no ,libseccomp" - -# We need to link with libelf, otherwise we need to -# include bmake-native which does not exist at the moment. -EXTRA_OEMAKE:append = " WITH_LIBELF=yes JETSON=TRUE ${PACKAGECONFIG_CONFARGS}" - -CFLAGS:prepend = " -I=/usr/include/tirpc " - -export OBJCPY="${OBJCOPY}" - -# Fix me: Create an independent recipe for nvidia-modprobe -do_configure:append() { - # Mark Nvidia modprobe as downloaded - touch ${S}/deps/src/nvidia-modprobe-${NVIDIA_MODPROBE_VERSION}/.download_stamp -} - -do_install () { - oe_runmake install DESTDIR=${D} -} - -INSANE_SKIP:${PN} = "already-stripped" diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126/0001-__rpc_dtbsize-rlim_cur-instead-of-rlim_max.patch b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126/0001-__rpc_dtbsize-rlim_cur-instead-of-rlim_max.patch new file mode 100644 index 000000000..21eaeaca2 --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126/0001-__rpc_dtbsize-rlim_cur-instead-of-rlim_max.patch @@ -0,0 +1,50 @@ +From 99f943123d2832cdd0f77c989d82cc8cba26e90b Mon Sep 17 00:00:00 2001 +From: Steve Dickson +Date: Wed, 22 Apr 2020 12:18:43 -0400 +Subject: [PATCH] __rpc_dtbsize: rlim_cur instead of rlim_max + +In the client code, rlim_max is used to allocate two +arrays used for multithread locking. These arrays are +indexed with open file descriptors. + +With some recent changes to systemd, the rlim_max is +now a very large number and no longer represents the +max number of open file descriptors allowed causing +the locking arrays to be huge resulting in processes +being OOM killed. + +It turns out the max number opens allowed in a process +is still fairly small (1023) which means rlim_cur (1024) +can be used instead of rlim_max. + +Signed-off-by: Steve Dickson +--- + src/rpc_generic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: libtirpc-1.2.6/src/rpc_generic.c +=================================================================== +--- libtirpc-1.2.6.orig/src/rpc_generic.c ++++ libtirpc-1.2.6/src/rpc_generic.c +@@ -112,7 +112,7 @@ __rpc_dtbsize() + return (tbsize); + } + if (getrlimit(RLIMIT_NOFILE, &rl) == 0) { +- return (tbsize = (int)rl.rlim_max); ++ return (tbsize = (int)(rl.rlim_cur > 1024 ? 1024 : rl.rlim_cur)); + } + /* + * Something wrong. I'll try to save face by returning a +Index: libtirpc-1.2.6/src/rpc_dtablesize.c +=================================================================== +--- libtirpc-1.2.6.orig/src/rpc_dtablesize.c ++++ libtirpc-1.2.6/src/rpc_dtablesize.c +@@ -42,6 +42,8 @@ _rpc_dtablesize(void) + + if (size == 0) { + size = getdtablesize(); ++ if (size > 1024) ++ size = 1024; + } + return (size); + } diff --git a/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126_1.2.6.bb b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126_1.2.6.bb new file mode 100644 index 000000000..9d6b900b7 --- /dev/null +++ b/layers/meta-balena-jetson/recipes-containers/libnvidia-container-tools/libtirpc126_1.2.6.bb @@ -0,0 +1,31 @@ +SUMMARY = "Transport-Independent RPC library" +DESCRIPTION = "Libtirpc is a port of Suns Transport-Independent RPC library to Linux" +SECTION = "libs/network" +HOMEPAGE = "http://sourceforge.net/projects/libtirpc/" +BUGTRACKER = "http://sourceforge.net/tracker/?group_id=183075&atid=903784" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \ + file://src/netname.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24" + +SRC_URI = "${SOURCEFORGE_MIRROR}/libtirpc/libtirpc-${PV}.tar.bz2" +SRC_URI[sha256sum] = "4278e9a5181d5af9cd7885322fdecebc444f9a3da87c526e7d47f7a12a37d1cc" + +# From meta-tegra c9c342a23738f70f4f1b1d53f5d22b3ba237ea2b + +SRC_URI += "file://0001-__rpc_dtbsize-rlim_cur-instead-of-rlim_max.patch" + +S = "${WORKDIR}/libtirpc-${PV}" + +inherit autotools pkgconfig + +DISABLE_STATIC = "" +EXTRA_OECONF = "--disable-gssapi --enable-static" + +do_install:append() { + rm -r ${D}${sysconfdir} ${D}${datadir} ${D}${libdir}/pkgconfig + rm ${D}${libdir}/*.so* + mv ${D}${includedir}/tirpc ${D}${includedir}/tirpc-1.2.6 +} + +inherit nopackages +