Skip to contentSkip to conversation

package/nvidia-modprobe: new package

PATCH New Christian Stewart 6 participants 32 messages Nov 19, 2020 – Jan 11, 2021 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/5 package/nvidia-modprobe: new package

nvidia-modprobe package adds a utility and headers for probing the NVIDIA hardware at runtime.

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

---
 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
package/Config.in +1 -0
index 016a99ed1a..fa1b5d35e9 100644
@@ -502,6 +502,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/nvme/Config.in"
 	source "package/ofono/Config.in"
 	source "package/on2-8170-modules/Config.in"
package/nvidia-modprobe/Config.in new file +12 -0
new file mode 100644
index 0000000000..35953a33d4
@@ -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
package/nvidia-modprobe/nvidia-modprobe.hash new file +3 -0
new file mode 100644
index 0000000000..99908680f0
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 396b4102d3075a2dee3024652fae206a1b38ace54b8efb1e2c20757a11ec19f1  nvidia-modprobe-450.57.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
package/nvidia-modprobe/nvidia-modprobe.mk new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.29.2
#1 lore raw

PATCH v4 2/5 package/linux4tegra: new package

NVIDIA Linux4Tegra utilities and binaries.

https://developer.nvidia.com/embedded/linux-tegra-archive

v1 -> v2:

- cjs: add license hashes

v2 -> v3:

- cjs: fix broken LICENSE hash
- cjs: add support for t210ref

---
 package/Config.in                             |   1 +
 ...for-flashing-Buildroot-produced-disk.patch |  58 +++++++++
 package/linux4tegra/Config.in                 |  28 ++++
 package/linux4tegra/linux4tegra.hash          |  55 ++++++++
 package/linux4tegra/linux4tegra.mk            | 120 ++++++++++++++++++
 5 files changed, 262 insertions(+)
 create mode 100644 package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch
 create mode 100644 package/linux4tegra/Config.in
 create mode 100644 package/linux4tegra/linux4tegra.hash
 create mode 100644 package/linux4tegra/linux4tegra.mk
package/Config.in +1 -0
index fa1b5d35e9..01072c3e45 100644
@@ -482,6 +482,7 @@ endmenu
 	source "package/libuio/Config.in"
 	source "package/linux-backports/Config.in"
 	source "package/linux-serial-test/Config.in"
+	source "package/linux4tegra/Config.in"
 	source "package/linuxconsoletools/Config.in"
 	source "package/lirc-tools/Config.in"
 	source "package/lm-sensors/Config.in"
package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch new file +58 -0

58 lines not on this page · raw message

package/linux4tegra/Config.in new file +28 -0
new file mode 100644
index 0000000000..71f29494dc
@@ -0,0 +1,28 @@
+config BR2_PACKAGE_LINUX4TEGRA
+	bool "linux4tegra"
+	help
+	  NVIDIA Linux4Tegra utilities and binaries.
+
+	  https://developer.nvidia.com/embedded/linux-tegra-archive
+
+if BR2_PACKAGE_LINUX4TEGRA
+
+choice
+	prompt "Platform"
+	default BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF
+	help
+	  Select the platform variant for linux4tegra.
+
+config BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF
+	bool "t186ref"
+	help
+	  Jetson AGX Xavier, Xavier NX, or TX2
+
+config BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T210REF
+	bool "t210ref"
+	help
+	  Jetson Nano or Jetson TX1
+
+endchoice
+
+endif # if BR2_PACKAGE_LINUX4TEGRA
package/linux4tegra/linux4tegra.hash new file +55 -0

55 lines not on this page · raw message

package/linux4tegra/linux4tegra.mk new file +120 -0

120 lines not on this page · raw message

Signature · 1 line
2.29.2
#2 lore raw

PATCH v4 2/5 package/linux4tegra: new package

Hello Christian,

Le 19/11/2020 ? 08:53, Christian Stewart a ?crit?:

Quoted 56 lines

NVIDIA Linux4Tegra utilities and binaries.

https://developer.nvidia.com/embedded/linux-tegra-archive

v1 -> v2:

- cjs: add license hashes

v2 -> v3:

- cjs: fix broken LICENSE hash
- cjs: add support for t210ref

---
 package/Config.in                             |   1 +
 ...for-flashing-Buildroot-produced-disk.patch |  58 +++++++++
 package/linux4tegra/Config.in                 |  28 ++++
 package/linux4tegra/linux4tegra.hash          |  55 ++++++++
 package/linux4tegra/linux4tegra.mk            | 120 ++++++++++++++++++
 5 files changed, 262 insertions(+)
 create mode 100644 package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch
 create mode 100644 package/linux4tegra/Config.in
 create mode 100644 package/linux4tegra/linux4tegra.hash
 create mode 100644 package/linux4tegra/linux4tegra.mk
package/Config.in +1 -0
index fa1b5d35e9..01072c3e45 100644
@@ -482,6 +482,7 @@ endmenu
 	source "package/libuio/Config.in"
 	source "package/linux-backports/Config.in"
 	source "package/linux-serial-test/Config.in"
+	source "package/linux4tegra/Config.in"
 	source "package/linuxconsoletools/Config.in"
 	source "package/lirc-tools/Config.in"
 	source "package/lm-sensors/Config.in"
package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch new file +10 -0
new file mode 100644
index 0000000000..4ace27bddc
@@ -0,0 +1,58 @@
+From fbd0d35995a23351d4b50ed0b814442a6873ded2 Mon Sep 17 00:00:00 2001
+From: Christian Stewart <[email protected]>
+Date: Fri, 17 Jul 2020 13:58:43 -0700
+Subject: [PATCH] Adjust flash.sh for flashing Buildroot-produced disk image
+
+Signed-off-by: Christian Stewart <[email protected]>
+---
+ flash.sh | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+

package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch line 20

Quoted 10 lines
package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch new file +10 -0
+diff --git a/flash.sh b/flash.sh
+index 38c0cbb..c27b41b 100755
+--- a/flash.sh
++++ b/flash.sh
+@@ -1339,9 +1339,10 @@ elif [ "${target_rootdev}" == "internal" ] || \
+ 		usage allunknown 1;
+ 	fi
+ 
+-	cmdline+="root=PARTUUID=${rootfsuuid} rw rootwait rootfstype=ext4 "
++	# cmdline+="root=PARTUUID=${rootfsuuid} rw rootwait rootfstype=ext4 "

Remove the commented line.

Quoted 22 lines
package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch new file +22 -0
++	cmdline+="root=/dev/${target_rootdev} rw rootwait"
+ else
+-	cmdline+="root=/dev/${target_rootdev} rw rootwait rootfstype=ext4 "
++	cmdline+="root=/dev/${target_rootdev} rw rootwait"
+ fi;
+ 
+ if [ "${CMDLINE_ADD}" != "" ]; then
+@@ -1512,11 +1513,7 @@ if [ "${write_image_name}" != "" ]; then
+ 	fi
+ fi
+ 
+-if [ "${INITRD_IN_BOOTIMG}" = "yes" ]; then
+-	ramdisk=initrd;
+-else
+-	ramdisk="/dev/null"
+-fi
++ramdisk="/dev/null"
+ echo -n "Making Boot image... ";
+ MKBOOTARG+="--kernel ${kernel_image} ";
+ MKBOOTARG+="--ramdisk ${ramdisk} ";
+@@ -1977,8 +1974,12 @@ if [ "${reuse_systemimg}" = "true" ] || [ "${skip_systemimg}" = "true" ]; then
+ elif [ "${rootdev_type}" = "internal" ]; then

package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch line 52

Quoted 10 lines
package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch new file +10 -0
+ 	APP_TAG+="-e s/APPFILE/${localsysfile}/ ";
+ 	if [ "${target_partname}" = "" -o "${target_partname}" = "APP" ]; then
+-		build_fsimg "$localsysfile" "$fillpat" \
+-		    "$rootfssize" "$rootfs_type" "$rootfs_dir" "$cmdline";
++    echo "Skipping image build and setting target_partfile to INITRD."
++    # target_partfile=${INITRD}
++    # cp ${INITRD} ./system.img
++    ln -fs ${INITRD} ./system.img
++		#build_fsimg "$localsysfile" "$fillpat" \
++		#    "$rootfssize" "$rootfs_type" "$rootfs_dir" "$cmdline";

Remove the commented lines.

Quoted 91 lines
package/linux4tegra/0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch new file +6 -0
+ 	fi;
+ elif [ "${rootdev_type}" = "network" -o "${rootdev_type}" = "external" ]; then
+ 	APP_TAG+="-e s/APPFILE/${localsysfile}/ ";
+-- 
+2.27.0
+
package/linux4tegra/Config.in new file +28 -0
new file mode 100644
index 0000000000..71f29494dc
@@ -0,0 +1,28 @@
+config BR2_PACKAGE_LINUX4TEGRA
+	bool "linux4tegra"
+	help
+	  NVIDIA Linux4Tegra utilities and binaries.
+
+	  https://developer.nvidia.com/embedded/linux-tegra-archive
+
+if BR2_PACKAGE_LINUX4TEGRA
+
+choice
+	prompt "Platform"
+	default BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF
+	help
+	  Select the platform variant for linux4tegra.
+
+config BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF
+	bool "t186ref"
+	help
+	  Jetson AGX Xavier, Xavier NX, or TX2
+
+config BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T210REF
+	bool "t210ref"
+	help
+	  Jetson Nano or Jetson TX1
+
+endchoice
+
+endif # if BR2_PACKAGE_LINUX4TEGRA
package/linux4tegra/linux4tegra.hash new file +45 -0
new file mode 100644
index 0000000000..5e5f9b02c8
@@ -0,0 +1,55 @@
+# locally computed
+sha256	9a2d13b1f4b67fef97a428d54724b23e84e14636eedfa22f338c2d1ea62558e2  Tegra186_Linux_R32.4.3_aarch64.tbz2
+sha256	0c8590218be814eeec2a6f8b4fd01271893e4881ef2c66d130792c1d62737642  Tegra210_Linux_R32.4.3_aarch64.tbz2
+sha256	bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526  bootloader/LICENSE
+sha256	496f3bc5456694cce764d28a93565bb0d0967dbd95256759e4168a9587406949  bootloader/LICENSE.adsp
+sha256	d4885fa44934935d6a178c84a16aec49dae1bd4f41f14bbbd781bafcf704885f  bootloader/LICENSE.bpmp
+sha256	fd4513e2857a0d91c521dfbb924733563b55d5a2d42d4fb688d2506ed34df0c4  bootloader/LICENSE.bpmp_t194
+sha256	205a391eb9cfc69854cc0c3082de204d30124607cedecbdd3f47420b5f37f302  bootloader/LICENSE.camera-rtcpu
+sha256	3cc8cfbf77eb7f086d9b6f68de92251ebbcf13fd7a20fec2749cab30348bf9b1  bootloader/LICENSE.cboot
+sha256	3cc8cfbf77eb7f086d9b6f68de92251ebbcf13fd7a20fec2749cab30348bf9b1  bootloader/LICENSE.cboot_t194
+sha256	bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526  bootloader/LICENSE.chkbdinfo
+sha256	7bf7d9fae6472452d585ec38dd684daa86dc83638984d1cb14ee35239a868543  bootloader/LICENSE.mce_c10_prod_cr
+sha256	bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526  bootloader/LICENSE.mkbctpart
+sha256	9b0ccf575cfd9febc97b8f9967216f06341db2d44abc69df92c3127cc1a2608f  bootloader/LICENSE.mkbootimg
+sha256	bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526  bootloader/LICENSE.mkgpt
+sha256	cddaa9d5583a7705cd4734a6af4b421bca9016ba6af854c51efbfcbe19a4a893  bootloader/LICENSE.nv_smd_generator
+sha256	7b699cea50c65de6679ea0617e8276cf24a523d6068e2502e637fadf9bc49713  bootloader/LICENSE.spe.bin
+sha256	7b699cea50c65de6679ea0617e8276cf24a523d6068e2502e637fadf9bc49713  bootloader/LICENSE.spe_t194.bin
+sha256	0ef77b4d7ffb0195540e394863dd969594ba8e21cb4b810822b4d42c1ab8ef72  bootloader/LICENSE.tos-mon-only.img.arm-trusted-firmware
+sha256	0ef77b4d7ffb0195540e394863dd969594ba8e21cb4b810822b4d42c1ab8ef72  bootloader/LICENSE.tos-trusty.img.arm-trusted-firmware
+sha256	5a316570e2f1d43b09e51432e613c408b240d0ea0ce30134a7de16c25b832130  bootloader/LICENSE.tos-trusty.img.trusty
+sha256	0ef77b4d7ffb0195540e394863dd969594ba8e21cb4b810822b4d42c1ab8ef72  bootloader/LICENSE.tos-trusty_t194.img.arm-trusted-firmware
+sha256	5a316570e2f1d43b09e51432e613c408b240d0ea0ce30134a7de16c25b832130  bootloader/LICENSE.tos-trusty_t194.img.trusty
+sha256	bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526  nv_tegra/LICENSE
+sha256	bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526  nv_tegra/LICENSE
+sha256	a85e1af5d521f0d68aa08806292076bb9bda8a31a496f17063fafab121053e4d  nv_tegra/LICENSE.brcm_patchram_plus
+sha256	88e408dec7796e0440b0bf5131f88f0d97bc4014fc389562ec0d5cc7ed1c45ad  nv_tegra/LICENSE.l4t-usb-device-mode-filesystem.img
+sha256	1467d3bd35f6ad87ffb24c0e665c2d028dda6e943dff66b347f0051370dcf88d  nv_tegra/LICENSE.libnvargus
+sha256	7ea9279fe435e009307da026ea72a1f47ecbdeef3a6a7f6bb04a2dec7bbdfcd5  nv_tegra/LICENSE.libnvcam_imageencoder
+sha256	c19b803d92378a0acc9c7dc02e018022f821b8284a5d918e2628e6d1d9376245  nv_tegra/LICENSE.libnveventlib
+sha256	1f1bf0c752f072a447b1013fc9d76268ddf098c37ddc63988d60e4973cbee2f4  nv_tegra/LICENSE.libnvscf
+sha256	c19b803d92378a0acc9c7dc02e018022f821b8284a5d918e2628e6d1d9376245  nv_tegra/LICENSE.libnvtracebuf
+sha256	b4e0f72b067cd11afa0875d20144423a80b7293e4309cca43190cf8c1d4ba200  nv_tegra/LICENSE.libtegrav4l2
+sha256	8610954adbca6c6b85d8b1ae5613b44b0014e437d32fcad6683bb27541411686  nv_tegra/LICENSE.minigbm
+sha256	cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  nv_tegra/LICENSE.nvbootctrl
+sha256	fa776c507a543cc43d9d66407cfe5d685f35207fd9631e7fd77ee4f42ef92be6  nv_tegra/LICENSE.nvdla
+sha256	8b6a8553e4a1668a6267b9789bd69ffe105bffd8f2af59e2fc74a5910bb159ab  nv_tegra/LICENSE.weston
+sha256	a34730970264d619f352598bf30295ad505a60fc3a493add8aa851645ce3ea47  nv_tegra/LICENSE.weston-data
+sha256	88e408dec7796e0440b0bf5131f88f0d97bc4014fc389562ec0d5cc7ed1c45ad  nv_tegra/nvidia_configs/opt/nvidia/l4t-usb-device-mode/LICENSE.filesystem.img
+sha256	a85e1af5d521f0d68aa08806292076bb9bda8a31a496f17063fafab121053e4d  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.brcm_patchram_plus
+sha256	89786bfd7060f6a60feae03257da6f3206b0f777352cf750c67b3b560dd087a5  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.cypress_wifibt
+sha256	1467d3bd35f6ad87ffb24c0e665c2d028dda6e943dff66b347f0051370dcf88d  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvargus
+sha256	7ea9279fe435e009307da026ea72a1f47ecbdeef3a6a7f6bb04a2dec7bbdfcd5  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvcam_imageencoder
+sha256	c19b803d92378a0acc9c7dc02e018022f821b8284a5d918e2628e6d1d9376245  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnveventlib
+sha256	c19b803d92378a0acc9c7dc02e018022f821b8284a5d918e2628e6d1d9376245  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvtracebuf

package/linux4tegra/linux4tegra.hash line 55

Quoted 10 lines
package/linux4tegra/linux4tegra.hash new file +10 -0
+sha256	dee27dbeddf4f7d093df765624022e72fb28c818d60fa3fd9d1dd77b392e4d31  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvv4l2
+sha256	dee27dbeddf4f7d093df765624022e72fb28c818d60fa3fd9d1dd77b392e4d31  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvv4lconvert
+sha256	b4e0f72b067cd11afa0875d20144423a80b7293e4309cca43190cf8c1d4ba200  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libtegrav4l2
+sha256	fbef9c34b63148c0e670e6ac07705b25bebcc1f963b48bf7447ee61cfaadcc1e  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libvulkan1
+sha256	8610954adbca6c6b85d8b1ae5613b44b0014e437d32fcad6683bb27541411686  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.minigbm
+sha256	fa776c507a543cc43d9d66407cfe5d685f35207fd9631e7fd77ee4f42ef92be6  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.nvdla
+sha256	bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.realtek_8822ce_wifibt
+sha256	f3f3ecff94537e7d5944fdbae7c6bd02d5eddca8fe1c29d8699ff2e54d26cebc  nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.tegra_sensors
+sha256	cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  nv_tegra/nvidia_tools/usr/share/doc/nvidia-tegra/LICENSE.nvbootctrl
+sha256	5f28c11f8b1b3f97b9d42c74b85371ebf4127f241b799279bcecd69f7ee542dc  nv_tegra/nvidia_tools/usr/share/doc/nvidia-tegra/LICENSE.tipc_test

Please use two space instead of a tab between sha256 and the hash.

Quoted 97 lines
package/linux4tegra/linux4tegra.mk new file +91 -0
new file mode 100644
index 0000000000..48061f4c98
@@ -0,0 +1,120 @@
+################################################################################
+#
+# linux4tegra
+#
+################################################################################
+
+LINUX4TEGRA_VERSION = 32.4.3
+
+ifeq ($(BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF),y)
+LINUX4TEGRA_SITE = https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t186ref_release_aarch64
+LINUX4TEGRA_SOURCE = Tegra186_Linux_R$(LINUX4TEGRA_VERSION)_aarch64.tbz2
+else # ifeq ($(BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T210REF),y)
+LINUX4TEGRA_SITE = https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t210ref_release_aarch64
+LINUX4TEGRA_SOURCE = Tegra210_Linux_R$(LINUX4TEGRA_VERSION)_aarch64.tbz2
+endif
+
+LINUX4TEGRA_LICENSE = NVIDIA Software License, GPL-2.0, LGPL, Apache-2.0, MIT
+LINUX4TEGRA_LICENSE_FILES = \
+	bootloader/LICENSE \
+	bootloader/LICENSE.adsp \
+	bootloader/LICENSE.bpmp \
+	bootloader/LICENSE.bpmp_t194 \
+	bootloader/LICENSE.camera-rtcpu \
+	bootloader/LICENSE.cboot \
+	bootloader/LICENSE.cboot_t194 \
+	bootloader/LICENSE.chkbdinfo \
+	bootloader/LICENSE.mce_c10_prod_cr \
+	bootloader/LICENSE.mkbctpart \
+	bootloader/LICENSE.mkbootimg \
+	bootloader/LICENSE.mkgpt \
+	bootloader/LICENSE.nv_smd_generator \
+	bootloader/LICENSE.spe.bin \
+	bootloader/LICENSE.spe_t194.bin \
+	bootloader/LICENSE.tos-mon-only.img.arm-trusted-firmware \
+	bootloader/LICENSE.tos-trusty.img.arm-trusted-firmware \
+	bootloader/LICENSE.tos-trusty.img.trusty \
+	bootloader/LICENSE.tos-trusty_t194.img.arm-trusted-firmware \
+	bootloader/LICENSE.tos-trusty_t194.img.trusty \
+	nv_tegra/LICENSE \
+	nv_tegra/LICENSE \
+	nv_tegra/LICENSE.brcm_patchram_plus \
+	nv_tegra/LICENSE.l4t-usb-device-mode-filesystem.img \
+	nv_tegra/LICENSE.libnvargus \
+	nv_tegra/LICENSE.libnvcam_imageencoder \
+	nv_tegra/LICENSE.libnveventlib \
+	nv_tegra/LICENSE.libnvscf \
+	nv_tegra/LICENSE.libnvtracebuf \
+	nv_tegra/LICENSE.libtegrav4l2 \
+	nv_tegra/LICENSE.minigbm \
+	nv_tegra/LICENSE.nvbootctrl \
+	nv_tegra/LICENSE.nvdla \
+	nv_tegra/LICENSE.weston \
+	nv_tegra/LICENSE.weston-data \
+	nv_tegra/nvidia_configs/opt/nvidia/l4t-usb-device-mode/LICENSE.filesystem.img \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.brcm_patchram_plus \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.cypress_wifibt \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvargus \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvcam_imageencoder \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnveventlib \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvtracebuf \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvv4l2 \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvv4lconvert \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libtegrav4l2 \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libvulkan1 \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.minigbm \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.nvdla \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.realtek_8822ce_wifibt \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.tegra_sensors \
+	nv_tegra/nvidia_tools/usr/share/doc/nvidia-tegra/LICENSE.nvbootctrl \
+	nv_tegra/nvidia_tools/usr/share/doc/nvidia-tegra/LICENSE.tipc_test
+
+LINUX4TEGRA_INSTALL_IMAGES = YES
+
+define LINUX4TEGRA_EXTRACT_NVIDIA_DRIVERS
+	@mkdir -p $(@D)/nv_tegra/nvidia_drivers
+	$(call suitable-extractor,nvidia_drivers.tbz2) \
+		$(@D)/nv_tegra/nvidia_drivers.tbz2 | \
+		$(TAR) -C $(@D)/nv_tegra/nvidia_drivers $(TAR_OPTIONS) -
+endef
+
+LINUX4TEGRA_POST_EXTRACT_HOOKS += LINUX4TEGRA_EXTRACT_NVIDIA_DRIVERS
+
+define LINUX4TEGRA_EXTRACT_NVIDIA_CONFIGS
+	@mkdir -p $(@D)/nv_tegra/nvidia_configs
+	$(call suitable-extractor,config.tbz2) \
+		$(@D)/nv_tegra/config.tbz2 | \
+		$(TAR) -C $(@D)/nv_tegra/nvidia_configs $(TAR_OPTIONS) -
+endef
+
+LINUX4TEGRA_POST_EXTRACT_HOOKS += LINUX4TEGRA_EXTRACT_NVIDIA_CONFIGS
+

package/linux4tegra/linux4tegra.mk line 101

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +10 -0
+define LINUX4TEGRA_EXTRACT_NVIDIA_TOOLS
+	@mkdir -p $(@D)/nv_tegra/nvidia_tools
+	$(call suitable-extractor,nv_tools.tbz2) \
+		$(@D)/nv_tegra/nv_tools.tbz2 | \
+		$(TAR) -C $(@D)/nv_tegra/nvidia_tools $(TAR_OPTIONS) -
+endef
+
+LINUX4TEGRA_POST_EXTRACT_HOOKS += LINUX4TEGRA_EXTRACT_NVIDIA_TOOLS
+
+# copy linux4tegra to the target dir

The comment is wrong because BINARIES_DIR is acually output/images.

Quoted 7 lines
package/linux4tegra/linux4tegra.mk new file +7 -0
+define LINUX4TEGRA_INSTALL_IMAGES_CMDS
+	cp -r $(@D)/. $(BINARIES_DIR)/linux4tegra
+endef
+
+LINUX4TEGRA_RSYNC = \
+	rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \

package/linux4tegra/linux4tegra.mk line 118

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +10 -0
+		--keep-dirlinks --exclude=ld.so.conf.d
+
+define LINUX4TEGRA_INSTALL_TARGET_CMDS
+	# install nvidia_drivers
+	$(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_drivers/ $(TARGET_DIR)/
+	# install nvidia_configs
+	$(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_configs/ $(TARGET_DIR)/
+	# install nvidia_tools
+	$(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_tools/ $(TARGET_DIR)/
+endef

This install a lot for prebuild binaries for example libGLX_nvidia.so.0. This means that this package should be at least a LIBGL provider etc.

There is a long list of shared libraries provided by this package, make sure to not override anything already installed by anoter package (ex: libdrm.so.2)

Best regards,
Romain

Quoted 3 lines
package/linux4tegra/linux4tegra.mk new file +2 -0
+
+$(eval $(generic-package))
#3 lore raw

PATCH v4 2/5 package/linux4tegra: new package

Hi Romain,

On Sat, Nov 21, 2020 at 2:40 AM Romain Naour <[email protected]> wrote:
[snip]

I applied the requested comment changes, patch change, and hash file tabs -> spaces change to the latest revision:

https://github.com/skiffos/buildroot/tree/tx2

Quoted 21 lines
Quoted 7 lines
package/linux4tegra/linux4tegra.mk new file +7 -0
+define LINUX4TEGRA_INSTALL_IMAGES_CMDS
+     cp -r $(@D)/. $(BINARIES_DIR)/linux4tegra
+endef
+
+LINUX4TEGRA_RSYNC = \
+     rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+             --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \

package/linux4tegra/linux4tegra.mk line 118

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +10 -0
+             --keep-dirlinks --exclude=ld.so.conf.d
+
+define LINUX4TEGRA_INSTALL_TARGET_CMDS
+     # install nvidia_drivers
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_drivers/ $(TARGET_DIR)/
+     # install nvidia_configs
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_configs/ $(TARGET_DIR)/
+     # install nvidia_tools
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_tools/ $(TARGET_DIR)/
+endef

This install a lot for prebuild binaries for example libGLX_nvidia.so.0. This means that this package should be at least a LIBGL provider etc.

Quoted 2 lines

There is a long list of shared libraries provided by this package, make sure to not override anything already installed by anoter package (ex: libdrm.so.2)

Unfortunately this is beyond my scope in Buildroot, so if someone else has a chance to take a look at marking LIBGL provided by this package, please go ahead.

I'm not actually using the graphics libraries provided by Buildroot in my applications, so it's important to me that linux4tegra compile even if the graphics packages are not available.

Best regards,
Christian

#4 lore raw

PATCH v4 2/5 package/linux4tegra: new package

Hello Christian,

Le 21/11/2020 ? 21:45, Christian Stewart a ?crit?:

Quoted 35 lines

Hi Romain,

On Sat, Nov 21, 2020 at 2:40 AM Romain Naour <[email protected]> wrote:
[snip]

I applied the requested comment changes, patch change, and hash file tabs -> spaces change to the latest revision:

https://github.com/skiffos/buildroot/tree/tx2

Quoted 21 lines
Quoted 7 lines
package/linux4tegra/linux4tegra.mk new file +7 -0
+define LINUX4TEGRA_INSTALL_IMAGES_CMDS
+     cp -r $(@D)/. $(BINARIES_DIR)/linux4tegra
+endef
+
+LINUX4TEGRA_RSYNC = \
+     rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+             --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \

package/linux4tegra/linux4tegra.mk line 118

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +10 -0
+             --keep-dirlinks --exclude=ld.so.conf.d
+
+define LINUX4TEGRA_INSTALL_TARGET_CMDS
+     # install nvidia_drivers
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_drivers/ $(TARGET_DIR)/
+     # install nvidia_configs
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_configs/ $(TARGET_DIR)/
+     # install nvidia_tools
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_tools/ $(TARGET_DIR)/
+endef

This install a lot for prebuild binaries for example libGLX_nvidia.so.0. This means that this package should be at least a LIBGL provider etc.

Quoted 2 lines

There is a long list of shared libraries provided by this package, make sure to not override anything already installed by anoter package (ex: libdrm.so.2)

Quoted 7 lines

Unfortunately this is beyond my scope in Buildroot, so if someone else has a chance to take a look at marking LIBGL provided by this package, please go ahead.

I'm not actually using the graphics libraries provided by Buildroot in my applications, so it's important to me that linux4tegra compile even if the graphics packages are not available.

I'm using meta-tegra for a customer project, I don't think I will be able to work with Buildroot for this project and continue the LIBGL part.

Best regards,
Romain

Quoted 4 lines

Best regards,
Christian

#5 lore raw

PATCH v4 2/5 package/linux4tegra: new package

In reply to Christian Stewart
Quoted 32 lines · Christian Stewart

Hi Romain,

On Sat, Nov 21, 2020 at 2:40 AM Romain Naour <[email protected]> wrote:
[snip]

I applied the requested comment changes, patch change, and hash file tabs -> spaces change to the latest revision:

https://github.com/skiffos/buildroot/tree/tx2

Quoted 21 lines
Quoted 7 lines
package/linux4tegra/linux4tegra.mk new file +7 -0
+define LINUX4TEGRA_INSTALL_IMAGES_CMDS
+     cp -r $(@D)/. $(BINARIES_DIR)/linux4tegra
+endef
+
+LINUX4TEGRA_RSYNC = \
+     rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+             --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \

package/linux4tegra/linux4tegra.mk line 118

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +10 -0
+             --keep-dirlinks --exclude=ld.so.conf.d
+
+define LINUX4TEGRA_INSTALL_TARGET_CMDS
+     # install nvidia_drivers
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_drivers/ $(TARGET_DIR)/
+     # install nvidia_configs
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_configs/ $(TARGET_DIR)/
+     # install nvidia_tools
+     $(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_tools/ $(TARGET_DIR)/
+endef

This install a lot for prebuild binaries for example libGLX_nvidia.so.0. This means that this package should be at least a LIBGL provider etc.

Quoted 6 lines
Quoted 2 lines

There is a long list of shared libraries provided by this package, make sure to not override anything already installed by anoter package (ex: libdrm.so.2)

Unfortunately this is beyond my scope in Buildroot, so if someone else has a chance to take a look at marking LIBGL provided by this package, please go ahead.

It's not complicated. [1]

The virtual package already exists (package/opengl/libgl) so you just need to
do the provider part.

The difficulty is finding out which libraries are opengl libraries, and which
ones are nvidia-specific.

Regards,
Arnout

Quoted 12 lines

I'm not actually using the graphics libraries provided by Buildroot in my applications, so it's important to me that linux4tegra compile even if the graphics packages are not available.

Best regards,
Christian
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#6 lore raw

PATCH v4 2/5 package/linux4tegra: new package

In reply to Christian Stewart
Quoted 16 lines · Christian Stewart

NVIDIA Linux4Tegra utilities and binaries.

https://developer.nvidia.com/embedded/linux-tegra-archive

v1 -> v2:

- cjs: add license hashes

v2 -> v3:

- cjs: fix broken LICENSE hash
- cjs: add support for t210ref

[snip]

package/linux4tegra/Config.in line 2

Quoted 8 lines
package/linux4tegra/Config.in new file +2 -0
new file mode 100644
index 0000000000..71f29494dc
@@ -0,0 +1,28 @@
+config BR2_PACKAGE_LINUX4TEGRA
+	bool "linux4tegra"

Since this package contains binaries, you'll need at least a dependency on the
arch, probably the subarch, and most likely also on libc.

Quoted 26 lines
package/linux4tegra/Config.in new file +26 -0
+	help
+	  NVIDIA Linux4Tegra utilities and binaries.
+
+	  https://developer.nvidia.com/embedded/linux-tegra-archive
+
+if BR2_PACKAGE_LINUX4TEGRA
+
+choice
+	prompt "Platform"
+	default BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF
+	help
+	  Select the platform variant for linux4tegra.
+
+config BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF
+	bool "t186ref"
+	help
+	  Jetson AGX Xavier, Xavier NX, or TX2
+
+config BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T210REF
+	bool "t210ref"
+	help
+	  Jetson Nano or Jetson TX1
+
+endchoice
+
+endif # if BR2_PACKAGE_LINUX4TEGRA

[snip]

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +4 -0
new file mode 100644
index 0000000000..48061f4c98
@@ -0,0 +1,120 @@
+################################################################################
+#
+# linux4tegra
+#

package/linux4tegra/linux4tegra.mk line 14

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +10 -0
+################################################################################
+
+LINUX4TEGRA_VERSION = 32.4.3
+
+ifeq ($(BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF),y)
+LINUX4TEGRA_SITE = https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t186ref_release_aarch64
+LINUX4TEGRA_SOURCE = Tegra186_Linux_R$(LINUX4TEGRA_VERSION)_aarch64.tbz2
+else # ifeq ($(BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T210REF),y)
+LINUX4TEGRA_SITE = https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t210ref_release_aarch64
+LINUX4TEGRA_SOURCE = Tegra210_Linux_R$(LINUX4TEGRA_VERSION)_aarch64.tbz2

Maybe it would be better as

ifeq (...)
LINUX4TEGRA_VARIANT = 186
else
LINUX4TEGRA_VARIANT = 210
endif
LINUX4TEGRA_SITE =
https://developer.nvidia.com/embedded/L4T/r32_Release_v4.3/t$(LINUX4TEGRA_VARIANT)ref_release_aarch64
LINUX4TEGRA_SOURCE = Tegra$(LINUX4TEGRA_VARIANT)_Linux_R$(LINUX4TEGRA_VERSION)_aarch64.tbz2

And then, actually, it would be better to move the variant to a hidden option
in the Config.in (but that's a bit more advanced).

package/linux4tegra/linux4tegra.mk line 17

Quoted 3 lines
package/linux4tegra/linux4tegra.mk new file +3 -0
+endif
+
+LINUX4TEGRA_LICENSE = NVIDIA Software License, GPL-2.0, LGPL, Apache-2.0, MIT

LGPL -> LGPL-2.0 (or whatever version it is)

Also check if there are any -or-later variants.

Quoted 70 lines
package/linux4tegra/linux4tegra.mk new file +70 -0
+LINUX4TEGRA_LICENSE_FILES = \
+	bootloader/LICENSE \
+	bootloader/LICENSE.adsp \
+	bootloader/LICENSE.bpmp \
+	bootloader/LICENSE.bpmp_t194 \
+	bootloader/LICENSE.camera-rtcpu \
+	bootloader/LICENSE.cboot \
+	bootloader/LICENSE.cboot_t194 \
+	bootloader/LICENSE.chkbdinfo \
+	bootloader/LICENSE.mce_c10_prod_cr \
+	bootloader/LICENSE.mkbctpart \
+	bootloader/LICENSE.mkbootimg \
+	bootloader/LICENSE.mkgpt \
+	bootloader/LICENSE.nv_smd_generator \
+	bootloader/LICENSE.spe.bin \
+	bootloader/LICENSE.spe_t194.bin \
+	bootloader/LICENSE.tos-mon-only.img.arm-trusted-firmware \
+	bootloader/LICENSE.tos-trusty.img.arm-trusted-firmware \
+	bootloader/LICENSE.tos-trusty.img.trusty \
+	bootloader/LICENSE.tos-trusty_t194.img.arm-trusted-firmware \
+	bootloader/LICENSE.tos-trusty_t194.img.trusty \
+	nv_tegra/LICENSE \
+	nv_tegra/LICENSE \
+	nv_tegra/LICENSE.brcm_patchram_plus \
+	nv_tegra/LICENSE.l4t-usb-device-mode-filesystem.img \
+	nv_tegra/LICENSE.libnvargus \
+	nv_tegra/LICENSE.libnvcam_imageencoder \
+	nv_tegra/LICENSE.libnveventlib \
+	nv_tegra/LICENSE.libnvscf \
+	nv_tegra/LICENSE.libnvtracebuf \
+	nv_tegra/LICENSE.libtegrav4l2 \
+	nv_tegra/LICENSE.minigbm \
+	nv_tegra/LICENSE.nvbootctrl \
+	nv_tegra/LICENSE.nvdla \
+	nv_tegra/LICENSE.weston \
+	nv_tegra/LICENSE.weston-data \
+	nv_tegra/nvidia_configs/opt/nvidia/l4t-usb-device-mode/LICENSE.filesystem.img \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.brcm_patchram_plus \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.cypress_wifibt \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvargus \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvcam_imageencoder \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnveventlib \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvtracebuf \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvv4l2 \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libnvv4lconvert \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libtegrav4l2 \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.libvulkan1 \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.minigbm \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.nvdla \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.realtek_8822ce_wifibt \
+	nv_tegra/nvidia_drivers/usr/share/doc/nvidia-tegra/LICENSE.tegra_sensors \
+	nv_tegra/nvidia_tools/usr/share/doc/nvidia-tegra/LICENSE.nvbootctrl \
+	nv_tegra/nvidia_tools/usr/share/doc/nvidia-tegra/LICENSE.tipc_test
+
+LINUX4TEGRA_INSTALL_IMAGES = YES
+
+define LINUX4TEGRA_EXTRACT_NVIDIA_DRIVERS
+	@mkdir -p $(@D)/nv_tegra/nvidia_drivers
+	$(call suitable-extractor,nvidia_drivers.tbz2) \
+		$(@D)/nv_tegra/nvidia_drivers.tbz2 | \
+		$(TAR) -C $(@D)/nv_tegra/nvidia_drivers $(TAR_OPTIONS) -
+endef
+
+LINUX4TEGRA_POST_EXTRACT_HOOKS += LINUX4TEGRA_EXTRACT_NVIDIA_DRIVERS
+
+define LINUX4TEGRA_EXTRACT_NVIDIA_CONFIGS
+	@mkdir -p $(@D)/nv_tegra/nvidia_configs
+	$(call suitable-extractor,config.tbz2) \
+		$(@D)/nv_tegra/config.tbz2 | \
+		$(TAR) -C $(@D)/nv_tegra/nvidia_configs $(TAR_OPTIONS) -

package/linux4tegra/linux4tegra.mk line 97

Quoted 10 lines
package/linux4tegra/linux4tegra.mk new file +10 -0
+endef
+
+LINUX4TEGRA_POST_EXTRACT_HOOKS += LINUX4TEGRA_EXTRACT_NVIDIA_CONFIGS
+
+define LINUX4TEGRA_EXTRACT_NVIDIA_TOOLS
+	@mkdir -p $(@D)/nv_tegra/nvidia_tools
+	$(call suitable-extractor,nv_tools.tbz2) \
+		$(@D)/nv_tegra/nv_tools.tbz2 | \
+		$(TAR) -C $(@D)/nv_tegra/nvidia_tools $(TAR_OPTIONS) -
+endef

It would be nicer to summarize those three in a single foreach loop. Something
like:

	$(foreach tarball,nvidia_drivers configs nv_tools,\
		@mkdir -p $(@D)/nv_tegra/$(tarball)$(sep) \
		$(BZCAT) $(@D)/nv_tegra/$(tarball).tbz2 | \
		$(TAR) -C $(@D)/nv_tegra/$(tarball) $(TAR_OPTIONS) - $(sep))

(note that the directory names are changed here, but they're anyway internal). (Note that suitable-extractor is not needed since we explicitly say it's bz2 anyway.)

package/linux4tegra/linux4tegra.mk line 103

Quoted 6 lines
package/linux4tegra/linux4tegra.mk new file +6 -0
+
+LINUX4TEGRA_POST_EXTRACT_HOOKS += LINUX4TEGRA_EXTRACT_NVIDIA_TOOLS
+
+# copy linux4tegra to the target dir
+define LINUX4TEGRA_INSTALL_IMAGES_CMDS
+	cp -r $(@D)/. $(BINARIES_DIR)/linux4tegra

Do we really want to install *everything*, including the tbz2 files and the
libraries, into the images directory?

package/linux4tegra/linux4tegra.mk line 109

Quoted 6 lines
package/linux4tegra/linux4tegra.mk new file +6 -0
+endef
+
+LINUX4TEGRA_RSYNC = \
+	rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
+		--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
+		--keep-dirlinks --exclude=ld.so.conf.d

I think most of these options are not relevant here.

And actually, we could just extract everything directly to target directory
instead of first going to build directory and then copying, no?

package/linux4tegra/linux4tegra.mk line 118

Quoted 9 lines
package/linux4tegra/linux4tegra.mk new file +9 -0
+
+define LINUX4TEGRA_INSTALL_TARGET_CMDS
+	# install nvidia_drivers
+	$(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_drivers/ $(TARGET_DIR)/
+	# install nvidia_configs
+	$(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_configs/ $(TARGET_DIR)/
+	# install nvidia_tools
+	$(LINUX4TEGRA_RSYNC) $(@D)/nv_tegra/nvidia_tools/ $(TARGET_DIR)/
+endef

Since some of these are libraries, shouldn't they be installed to staging as well?

Regards,
Arnout

Quoted 3 lines
package/linux4tegra/linux4tegra.mk new file +2 -0
+
+$(eval $(generic-package))
#7 lore raw

PATCH v4 3/5 package/libnvidia-container: new package

In reply to Christian Stewart

The libnvidia-container package adds a library and CLI for GPU-backed containers, agnostic to container runtime.

https://github.com/NVIDIA/libnvidia-container

v1 -> v2:

- cjs: thanks Asaf thanks for review
- cjs: remove extra include dirs
- cjs: simplify configuration opts

v2 -> v3:

- cjs: add fixup for go-module support

---
 package/Config.in                             |    1 +
 ...d-fixes-from-vowstar-portage-overlay.patch | 1890 +++++++++++++++++
 ...ve-dependency-handling-from-Makefile.patch |  698 ++++++
 package/libnvidia-container/Config.in         |   18 +
 .../libnvidia-container.hash                  |    3 +
 .../libnvidia-container.mk                    |   44 +
 6 files changed, 2654 insertions(+)
 create mode 100644 package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch
 create mode 100644 package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch
 create mode 100644 package/libnvidia-container/Config.in
 create mode 100644 package/libnvidia-container/libnvidia-container.hash
 create mode 100644 package/libnvidia-container/libnvidia-container.mk
package/Config.in +1 -0
index 01072c3e45..ef01361fdb 100644
@@ -1532,6 +1532,7 @@ menu "Hardware handling"
 	source "package/libllcp/Config.in"
 	source "package/libmbim/Config.in"
 	source "package/libnfc/Config.in"
+	source "package/libnvidia-container/Config.in"
 	source "package/libpciaccess/Config.in"
 	source "package/libphidget/Config.in"
 	source "package/libpri/Config.in"
package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch new file +1890 -0

1,890 lines not on this page · raw message

package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch new file +698 -0

698 lines not on this page · raw message

package/libnvidia-container/Config.in new file +18 -0
new file mode 100644
index 0000000000..7a452c3635
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_LIBNVIDIA_CONTAINER
+	bool "libnvidia-container"
+	depends on BR2_SHARED_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS # tirpc
+	depends on BR2_TOOLCHAIN_USES_GLIBC # fexecve
+	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_LIBCAP
+	select BR2_PACKAGE_LIBTIRPC
+	select BR2_PACKAGE_NVIDIA_MODPROBE
+	help
+	  The libnvidia-container package adds a library and CLI for
+	  GPU-backed containers, agnostic to container runtime.
+
+	  https://github.com/NVIDIA/libnvidia-container
+
+comment "libnvidia-container needs a shared glibc toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAN_USES_GLIBC || \
+		!BR2_SHARED_LIBS
package/libnvidia-container/libnvidia-container.hash new file +3 -0
new file mode 100644
index 0000000000..d356eb2b1e
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 fd447629fd65d171b68edb62fa2e581c67fdb450ff540f486987ab826150d06e  libnvidia-container-1.2.0.tar.gz
+sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
package/libnvidia-container/libnvidia-container.mk new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.29.2
#8 lore raw

PATCH v4 3/5 package/libnvidia-container: new package

Hello Christian,

Le 19/11/2020 ? 08:53, Christian Stewart a ?crit?:

Quoted 51 lines

The libnvidia-container package adds a library and CLI for GPU-backed containers, agnostic to container runtime.

https://github.com/NVIDIA/libnvidia-container

v1 -> v2:

- cjs: thanks Asaf thanks for review
- cjs: remove extra include dirs
- cjs: simplify configuration opts

v2 -> v3:

- cjs: add fixup for go-module support

---
 package/Config.in                             |    1 +
 ...d-fixes-from-vowstar-portage-overlay.patch | 1890 +++++++++++++++++
 ...ve-dependency-handling-from-Makefile.patch |  698 ++++++
 package/libnvidia-container/Config.in         |   18 +
 .../libnvidia-container.hash                  |    3 +
 .../libnvidia-container.mk                    |   44 +
 6 files changed, 2654 insertions(+)
 create mode 100644 package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch
 create mode 100644 package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch
 create mode 100644 package/libnvidia-container/Config.in
 create mode 100644 package/libnvidia-container/libnvidia-container.hash
 create mode 100644 package/libnvidia-container/libnvidia-container.mk
package/Config.in +1 -0
index 01072c3e45..ef01361fdb 100644
@@ -1532,6 +1532,7 @@ menu "Hardware handling"
 	source "package/libllcp/Config.in"
 	source "package/libmbim/Config.in"
 	source "package/libnfc/Config.in"
+	source "package/libnvidia-container/Config.in"
 	source "package/libpciaccess/Config.in"
 	source "package/libphidget/Config.in"
 	source "package/libpri/Config.in"
package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch new file +1 -0
new file mode 100644
index 0000000000..7232e76d97
@@ -0,0 +1,1890 @@
+From bd633a208446c86e11097e3cd3b019a086738ae3 Mon Sep 17 00:00:00 2001

package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch line 11

Quoted 10 lines
package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch new file +10 -0
+From: Christian Stewart <[email protected]>
+Date: Sun, 19 Jul 2020 09:56:42 -0700
+Subject: [PATCH] Build fixes from vowstar portage overlay
+
+This commit brings in build fixes written by @vowstar in the overlay:
+
+https://github.com/vowstar/vowstar-overlay/tree/master/app-emulation/libnvidia-container/files
+
+Signed-off-by: Christian Stewart <[email protected]>
+---

This is really a huge patch...

Quoted 6 lines
package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch new file +0 -0
new file mode 100644
index 0000000000..d4ba9dfe80

package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch line 9

Quoted 9 lines
package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch new file +9 -0
@@ -0,0 +1,698 @@
+From 6752d8d5e315eb3f061498a9c35558f90f9600e2 Mon Sep 17 00:00:00 2001
+From: Christian Stewart <[email protected]>
+Date: Sat, 18 Jul 2020 15:26:22 -0700
+Subject: [PATCH] Remove dependency handling from Makefile
+
+Buildroot will handle this for the makefile.
+
+Signed-off-by: Christian Stewart <[email protected]>
+---

Same

package/libnvidia-container/Config.in line 3

Quoted 9 lines
package/libnvidia-container/Config.in new file +3 -0
new file mode 100644
index 0000000000..7a452c3635
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_LIBNVIDIA_CONTAINER
+	bool "libnvidia-container"
+	depends on BR2_SHARED_LIBS

BR2_SHARED_STATIC_LIBS maybe

package/libnvidia-container/Config.in line 4

Quoted 1 line
package/libnvidia-container/Config.in new file +1 -0
+	depends on BR2_TOOLCHAIN_HAS_THREADS # tirpc

Already selected by glibc toolchain.

Quoted 39 lines
package/libnvidia-container/Config.in new file +14 -0
+	depends on BR2_TOOLCHAIN_USES_GLIBC # fexecve
+	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_LIBCAP
+	select BR2_PACKAGE_LIBTIRPC
+	select BR2_PACKAGE_NVIDIA_MODPROBE
+	help
+	  The libnvidia-container package adds a library and CLI for
+	  GPU-backed containers, agnostic to container runtime.
+
+	  https://github.com/NVIDIA/libnvidia-container
+
+comment "libnvidia-container needs a shared glibc toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAN_USES_GLIBC || \
+		!BR2_SHARED_LIBS
package/libnvidia-container/libnvidia-container.hash new file +3 -0
new file mode 100644
index 0000000000..d356eb2b1e
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 fd447629fd65d171b68edb62fa2e581c67fdb450ff540f486987ab826150d06e  libnvidia-container-1.2.0.tar.gz
+sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
package/libnvidia-container/libnvidia-container.mk new file +10 -0
new file mode 100644
index 0000000000..b040c0baaa
@@ -0,0 +1,44 @@
+################################################################################
+#
+# libnvidia-container
+#
+################################################################################
+
+LIBNVIDIA_CONTAINER_VERSION = 1.2.0
+LIBNVIDIA_CONTAINER_SITE = $(call github,NVIDIA,libnvidia-container,v$(LIBNVIDIA_CONTAINER_VERSION))
+LIBNVIDIA_CONTAINER_LICENSE = Apache-2.0
+LIBNVIDIA_CONTAINER_LICENSE_FILES = LICENSE

package/libnvidia-container/libnvidia-container.mk line 20

Quoted 10 lines
package/libnvidia-container/libnvidia-container.mk new file +10 -0
+
+LIBNVIDIA_CONTAINER_DEPENDENCIES = elfutils libcap libtirpc nvidia-modprobe \
+	host-pkgconf host-elfutils host-libcap
+
+LIBNVIDIA_CONTAINER_MAKE_OPTS = \
+	CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" \
+	OBJCPY="$(TARGET_OBJCOPY)" \
+	RPCGEN="$(HOST_DIR)/bin/rpcgen" \
+	WITH_LIBELF=yes \
+	WITH_TIRPC=no

Why adding libtirpc in the dependencies and using WITH_TIRPC=no ?

Best regards,
Romain

Quoted 25 lines
package/libnvidia-container/libnvidia-container.mk new file +24 -0
+
+ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
+LIBNVIDIA_CONTAINER_MAKE_OPTS += WITH_SECCOMP=yes
+LIBNVIDIA_CONTAINER_DEPENDENCIES += libseccomp
+else
+LIBNVIDIA_CONTAINER_MAKE_OPTS += WITH_SECCOMP=no
+endif
+
+define LIBNVIDIA_CONTAINER_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(TARGET_CONFIGURE_OPTS) \
+		$(LIBNVIDIA_CONTAINER_MAKE_OPTS) \
+		shared tools
+endef
+
+define LIBNVIDIA_CONTAINER_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(TARGET_CONFIGURE_OPTS) \
+		$(LIBNVIDIA_CONTAINER_MAKE_OPTS) \
+		DESTDIR="$(TARGET_DIR)" \
+		install
+endef
+
+$(eval $(generic-package))
#9 lore raw

PATCH v4 3/5 package/libnvidia-container: new package

Hi Romain,

Quoted 1 line · Romain Naour

This is really a huge patch...

Because it includes a couple of headers from nvidia-modprobe. It's necessary for the build to work. I wouldn't add the patch otherwise.

If you would like to take the time to find some alternative...

Quoted 8 lines

package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch line 9

Quoted 6 lines
package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch new file +6 -0
+Subject: [PATCH] Remove dependency handling from Makefile
+
+Buildroot will handle this for the makefile.
+
+Signed-off-by: Christian Stewart <[email protected]>
+---

Same

??

Quoted 6 lines

package/libnvidia-container/Config.in line 3

Quoted 4 lines
package/libnvidia-container/Config.in new file +3 -0
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_LIBNVIDIA_CONTAINER
+     bool "libnvidia-container"
+     depends on BR2_SHARED_LIBS

BR2_SHARED_STATIC_LIBS maybe

??

Quoted 3 lines

package/libnvidia-container/Config.in line 4

Quoted 1 line
package/libnvidia-container/Config.in new file +1 -0
+     depends on BR2_TOOLCHAIN_HAS_THREADS # tirpc

Already selected by glibc toolchain.

OK noted & removed.

Quoted 9 lines

package/libnvidia-container/libnvidia-container.mk line 20

Quoted 7 lines
package/libnvidia-container/libnvidia-container.mk new file +7 -0
+
+LIBNVIDIA_CONTAINER_MAKE_OPTS = \
+     CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" \
+     OBJCPY="$(TARGET_OBJCOPY)" \
+     RPCGEN="$(HOST_DIR)/bin/rpcgen" \
+     WITH_LIBELF=yes \
+     WITH_TIRPC=no

Why adding libtirpc in the dependencies and using WITH_TIRPC=no ?

Because, without it, we get this build error:

libnvidia-container-1.2.0/src/driver.c:23:10: fatal error:
driver_rpc.h: No such file or directory
23 | #include "driver_rpc.h"

Best,
Christian

#10 lore raw

PATCH v4 3/5 package/libnvidia-container: new package

Hello Christian,

Le 21/11/2020 ? 21:54, Christian Stewart a ?crit?:

Quoted 10 lines

Hi Romain,

Quoted 1 line · Romain Naour

This is really a huge patch...

Because it includes a couple of headers from nvidia-modprobe. It's necessary for the build to work. I wouldn't add the patch otherwise.

If you would like to take the time to find some alternative...

I don't have the time to search an test any alternative solution.

Quoted 11 lines
Quoted 9 lines

package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch line 9

Quoted 7 lines
package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch new file +6 -0
+Subject: [PATCH] Remove dependency handling from Makefile
+
+Buildroot will handle this for the makefile.
+
+Signed-off-by: Christian Stewart <[email protected]>
+---

Same

??

Another big patch impossible to review.

I'm not sure if maintainers will accept it as is.

Quoted 9 lines
Quoted 7 lines

package/libnvidia-container/Config.in line 3

Quoted 5 lines
package/libnvidia-container/Config.in new file +3 -0
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_LIBNVIDIA_CONTAINER
+     bool "libnvidia-container"
+     depends on BR2_SHARED_LIBS

BR2_SHARED_STATIC_LIBS maybe

??

I meant, maybe you only need to use:
depends on !BR2_STATIC_LIBS

Quoted 17 lines
Quoted 4 lines

package/libnvidia-container/Config.in line 4

Quoted 2 lines
package/libnvidia-container/Config.in new file +1 -0
+     depends on BR2_TOOLCHAIN_HAS_THREADS # tirpc

Already selected by glibc toolchain.

OK noted & removed.

Quoted 9 lines

package/libnvidia-container/libnvidia-container.mk line 20

Quoted 7 lines
package/libnvidia-container/libnvidia-container.mk new file +7 -0
+
+LIBNVIDIA_CONTAINER_MAKE_OPTS = \
+     CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" \
+     OBJCPY="$(TARGET_OBJCOPY)" \
+     RPCGEN="$(HOST_DIR)/bin/rpcgen" \
+     WITH_LIBELF=yes \
+     WITH_TIRPC=no

Why adding libtirpc in the dependencies and using WITH_TIRPC=no ?

Quoted 5 lines

Because, without it, we get this build error:

libnvidia-container-1.2.0/src/driver.c:23:10: fatal error:
driver_rpc.h: No such file or directory
23 | #include "driver_rpc.h"

So you can remove libtirpc from dependency ?

Best regards,
Romain

Quoted 4 lines

Best,
Christian

#11 lore raw

PATCH v4 3/5 package/libnvidia-container: new package

In reply to Romain Naour

Hi Romain,

Quoted 7 lines · Romain Naour

Le 19/11/2020 ? 08:53, Christian Stewart a ?crit :

Quoted 4 lines

The libnvidia-container package adds a library and CLI for GPU-backed containers, agnostic to container runtime.

https://github.com/NVIDIA/libnvidia-container

Quoted 10 lines

package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch line 11

Quoted 8 lines
package/libnvidia-container/0001-Build-fixes-from-vowstar-portage-overlay.patch new file +8 -0
+Subject: [PATCH] Build fixes from vowstar portage overlay
+
+This commit brings in build fixes written by @vowstar in the overlay:
+
+https://github.com/vowstar/vowstar-overlay/tree/master/app-emulation/libnvidia-container/files
+
+Signed-off-by: Christian Stewart <[email protected]>
+---

This is really a huge patch...

The patches bringing in the header files for nvidia-modprobe can actually be referenced in the staging headers directory.

So I can remove this massive patch by doing the following:

- Add build dependency on nvidia-modprobe
- Add staging dir to header search path

Then the headers will be sourced from nvidia-modprobe source tree instead

Quoted 10 lines
Quoted 10 lines
package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch new file +3 -0
new file mode 100644
index 0000000000..d4ba9dfe80
@@ -0,0 +1,698 @@
+From 6752d8d5e315eb3f061498a9c35558f90f9600e2 Mon Sep 17 00:00:00 2001
+From: Christian Stewart <[email protected]>
+Date: Sat, 18 Jul 2020 15:26:22 -0700
Quoted 8 lines

package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch line 9

Quoted 6 lines
package/libnvidia-container/0002-Remove-dependency-handling-from-Makefile.patch new file +6 -0
+Subject: [PATCH] Remove dependency handling from Makefile
+
+Buildroot will handle this for the makefile.
+
+Signed-off-by: Christian Stewart <[email protected]>
+---

Same

I don't see how to avoid this patch.

At the moment I will look into removing these large patches from the series, add the /usr/include/tirpc directory to the libnvidia-container compile header search path, and re-test using BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64.

Best,
Christian

#12 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

In reply to Christian Stewart

---

v3 -> v4:

- thanks Romain for the review
- cjs: added gcc + binutils version specifiers
- tested against devkit hardware

---
 board/jetson/tx2/readme.txt | 83 +++++++++++++++++++++++++++++++++++++
 board/jetsontx2             |  1 +
 configs/jetsontx2_defconfig | 64 ++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 board/jetson/tx2/readme.txt
 create mode 120000 board/jetsontx2
 create mode 100644 configs/jetsontx2_defconfig
board/jetson/tx2/readme.txt new file +83 -0
new file mode 100644
index 0000000000..45fdb50a56
@@ -0,0 +1,83 @@
+NVIDIA Jetson TX2
+
+Intro
+=====
+
+This configuration supports the Jetson TX2 devkit.
+
+Building
+========
+
+Configure Buildroot
+-------------------
+
+For Jetson TX2:
+
+  $ make jetsontx2_defconfig
+
+Build the rootfs
+----------------
+
+You may now build your rootfs with:
+
+  $ make
+
+
+Flashing
+========
+
+Once the build process is finished you will have the target binaries in the
+output/images directory, with a copy of linux4tegra.
+
+Flashing to the internal eMMC is done by booting to the official recovery mode,
+and flashing the system from there. The default factory-flashed TX2 is suitable.
+
+There are a lot of cases where the TX2 will not boot properly unless all of the
+peripherals are fully disconnected, power is disconnected, everything fully
+resets, and then the power is introduced back again.
+
+The recovery mode of the Jetson is used to flash. Entering recovery:
+
+ - Start with the machine powered off + fully unplugged.
+ - Plug in the device to power, and connect a HDMI display.
+ - Connect a micro-USB cable from the host PC to the target board.
+ - Power on the device by holding the start button until the red light is lit.
+ - Hold down the RST button and REC button simultaneously.
+ - Release the RST button while holding down the REC button.
+ - Wait a few seconds, then release the REC button.
+
+To flash over USB:
+
+```
+cd output/images/linux4tegra
+sudo bash ./flash.sh \
+     -I ../rootfs.ext2 \
+     -K ../Image \
+     -L ../u-boot-dtb.bin \
+     -C "ramdisk_size=100000 net.ifnames=0 elevator=deadline" \
+     -d ../tegra186-quill-p3310-1000-c03-00-base.dtb \
+     jetson-tx2-devkit mmcblk0p1
+```
+
+This will run the `flash.sh` script from L4T, and will setup the kernel, u-boot,
+persist + boot-up partition mmcblk0p1. This may overwrite your existing work so
+use it for initial setup only.
+
+Bootup Process
+==============
+
+The TX2 boots from the internal eMMC, at mmcblk0p1.
+
+A "secure boot" process is used, with multiple bootloaders:
+
+ - BootROM -> MB1 (TrustZone)
+ - MB2/BPMP -> (Non-Trustzone)
+ - Cboot (uses Little Kernel)
+ - Uboot
+ - Kernel
+ 
+Uboot is flashed to the mmcblk0p1 emmc partition.
+
+Cboot could be compiled from source, and the source is available from the
+official sources, however, we do not (yet) compile cboot.
+
board/jetsontx2 new file +1 -0
new file mode 120000
index 0000000000..7404114cc3
@@ -0,0 +1 @@
+./jetson/tx2
\ No newline at end of file
configs/jetsontx2_defconfig new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.29.2
#13 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

Hello Christian,

Le 19/11/2020 ? 08:53, Christian Stewart a ?crit?:

Quoted 129 lines

---

v3 -> v4:

- thanks Romain for the review
- cjs: added gcc + binutils version specifiers
- tested against devkit hardware

---
 board/jetson/tx2/readme.txt | 83 +++++++++++++++++++++++++++++++++++++
 board/jetsontx2             |  1 +
 configs/jetsontx2_defconfig | 64 ++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 board/jetson/tx2/readme.txt
 create mode 120000 board/jetsontx2
 create mode 100644 configs/jetsontx2_defconfig
board/jetson/tx2/readme.txt new file +83 -0
new file mode 100644
index 0000000000..45fdb50a56
@@ -0,0 +1,83 @@
+NVIDIA Jetson TX2
+
+Intro
+=====
+
+This configuration supports the Jetson TX2 devkit.
+
+Building
+========
+
+Configure Buildroot
+-------------------
+
+For Jetson TX2:
+
+  $ make jetsontx2_defconfig
+
+Build the rootfs
+----------------
+
+You may now build your rootfs with:
+
+  $ make
+
+
+Flashing
+========
+
+Once the build process is finished you will have the target binaries in the
+output/images directory, with a copy of linux4tegra.
+
+Flashing to the internal eMMC is done by booting to the official recovery mode,
+and flashing the system from there. The default factory-flashed TX2 is suitable.
+
+There are a lot of cases where the TX2 will not boot properly unless all of the
+peripherals are fully disconnected, power is disconnected, everything fully
+resets, and then the power is introduced back again.
+
+The recovery mode of the Jetson is used to flash. Entering recovery:
+
+ - Start with the machine powered off + fully unplugged.
+ - Plug in the device to power, and connect a HDMI display.
+ - Connect a micro-USB cable from the host PC to the target board.
+ - Power on the device by holding the start button until the red light is lit.
+ - Hold down the RST button and REC button simultaneously.
+ - Release the RST button while holding down the REC button.
+ - Wait a few seconds, then release the REC button.
+
+To flash over USB:
+
+```
+cd output/images/linux4tegra
+sudo bash ./flash.sh \
+     -I ../rootfs.ext2 \
+     -K ../Image \
+     -L ../u-boot-dtb.bin \
+     -C "ramdisk_size=100000 net.ifnames=0 elevator=deadline" \
+     -d ../tegra186-quill-p3310-1000-c03-00-base.dtb \
+     jetson-tx2-devkit mmcblk0p1
+```
+
+This will run the `flash.sh` script from L4T, and will setup the kernel, u-boot,
+persist + boot-up partition mmcblk0p1. This may overwrite your existing work so
+use it for initial setup only.
+
+Bootup Process
+==============
+
+The TX2 boots from the internal eMMC, at mmcblk0p1.
+
+A "secure boot" process is used, with multiple bootloaders:
+
+ - BootROM -> MB1 (TrustZone)
+ - MB2/BPMP -> (Non-Trustzone)
+ - Cboot (uses Little Kernel)
+ - Uboot
+ - Kernel
+ 
+Uboot is flashed to the mmcblk0p1 emmc partition.
+
+Cboot could be compiled from source, and the source is available from the
+official sources, however, we do not (yet) compile cboot.
+
board/jetsontx2 new file +1 -0
new file mode 120000
index 0000000000..7404114cc3
@@ -0,0 +1 @@
+./jetson/tx2
\ No newline at end of file
configs/jetsontx2_defconfig new file +5 -0
new file mode 100644
index 0000000000..5ca832524e
@@ -0,0 +1,64 @@
+BR2_aarch64=y
+BR2_cortex_a57=y
+BR2_ARM_FPU_FP_ARMV8=y
+
+# enable specific optimizations

configs/jetsontx2_defconfig line 15

Quoted 10 lines
configs/jetsontx2_defconfig new file +10 -0
+BR2_TARGET_OPTIMIZATION="-march=armv8-a+crypto -mcpu=cortex-a57+crypto"
+
+# Toolchain reference: docs.nvidia.com: "Jetson Linux Driver Package Toolchain"
+BR2_TOOLCHAIN_BUILDROOT=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
+BR2_BINUTILS_VERSION_2_32_X=y
+BR2_GCC_VERSION_7_X=y

This means that you are not working on Buildroot master because gcc 7 has been removed already.

This is anoying... either the latest NVIDIA SDK (jetpack 4.4.1) is already out of date because it require an old gcc version or gcc is moving too fast for such sdk.

Your work on this series must be discussed with other maintainers. Wait some time before sending v5.

configs/jetsontx2_defconfig line 16

Quoted 1 line
configs/jetsontx2_defconfig new file +1 -0
+BR2_GCC_ENABLE_LTO=n

Should be:
# BR2_GCC_ENABLE_LTO is not set

Best regards,
Romain

Quoted 49 lines
configs/jetsontx2_defconfig new file +48 -0
+BR2_USE_MMU=y
+
+BR2_SYSTEM_DHCP="eth0"
+
+# Linux headers same as kernel, a 4.9 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
+BR2_KERNEL_HEADERS_AS_KERNEL=y
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+# patches-l4t-r32.4
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,madisongh,linux-tegra-4.9,0be1a57448010ae60505acf4e2153638455cee7c)/linux-tegra-4.9.140-r1.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="tegra"
+
+# Build the DTB from the kernel sources
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="_ddot_/_ddot_/_ddot_/_ddot_/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base"
+
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+
+BR2_PACKAGE_LINUX4TEGRA=y
+BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF=y
+
+# TODO: NVIDIA_CONTAINER_TOOLKIT requires a go-module integration.
+# BR2_PACKAGE_NVIDIA_CONTAINER_TOOLKIT=y
+
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y
+
+# Required tools to create the image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_JQ=y
+BR2_PACKAGE_HOST_PARTED=y
+
+# Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="2000M"
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# Uboot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="p2771-0000-500"
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,paralin,u-boot-tegra,e6da093be3cc593ef4294e1922b3391ede9c94da)/u-boot-tegra-l4t-r32.4-v2016.7.tar.gz"
+BR2_TARGET_UBOOT_FORMAT_DTB_BIN=y
+BR2_TARGET_UBOOT_NEEDS_DTC=y
#14 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

Hello Christian,

Le 19/11/2020 ? 14:40, Romain Naour a ?crit?:

Quoted 24 lines

Hello Christian,

Le 19/11/2020 ? 08:53, Christian Stewart a ?crit?:

Quoted 21 lines

---

v3 -> v4:

- thanks Romain for the review
- cjs: added gcc + binutils version specifiers
- tested against devkit hardware

---
 board/jetson/tx2/readme.txt | 83 +++++++++++++++++++++++++++++++++++++
 board/jetsontx2             |  1 +
 configs/jetsontx2_defconfig | 64 ++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 board/jetson/tx2/readme.txt
 create mode 120000 board/jetsontx2
 create mode 100644 configs/jetsontx2_defconfig

[...]

Quoted 7 lines
Quoted 7 lines

+++ b/configs/jetsontx2_defconfig

configs/jetsontx2_defconfig new file +5 -0
@@ -0,0 +1,64 @@
+BR2_aarch64=y
+BR2_cortex_a57=y
+BR2_ARM_FPU_FP_ARMV8=y
+
+# enable specific optimizations
Quoted 8 lines

configs/jetsontx2_defconfig line 13

Quoted 8 lines
configs/jetsontx2_defconfig new file +8 -0
+BR2_TARGET_OPTIMIZATION="-march=armv8-a+crypto -mcpu=cortex-a57+crypto"
+
+# Toolchain reference: docs.nvidia.com: "Jetson Linux Driver Package Toolchain"
+BR2_TOOLCHAIN_BUILDROOT=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y

Glibc toolchains already select locale and whar support.

Quoted 1 line

configs/jetsontx2_defconfig line 14

Quoted 1 line
configs/jetsontx2_defconfig new file +1 -0
+BR2_BINUTILS_VERSION_2_32_X=y

I'm not sure why you need this version.

Quoted 11 lines

configs/jetsontx2_defconfig line 15

Quoted 1 line
configs/jetsontx2_defconfig new file +1 -0
+BR2_GCC_VERSION_7_X=y

This means that you are not working on Buildroot master because gcc 7 has been removed already.

This is anoying... either the latest NVIDIA SDK (jetpack 4.4.1) is already out of date because it require an old gcc version or gcc is moving too fast for such sdk.

Your work on this series must be discussed with other maintainers. Wait some time before sending v5.

Actually I would suggest to use the Linaro aarch64 2018.05 (BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64) because it's the toolchain recommended and used by Nvidia.

See: https://developer.nvidia.com/gcc-linaro-731-201805-sources

Quoted 10 lines

configs/jetsontx2_defconfig line 16

Quoted 2 lines
configs/jetsontx2_defconfig new file +1 -0
+BR2_GCC_ENABLE_LTO=n

Should be:
# BR2_GCC_ENABLE_LTO is not set

Best regards,
Romain

Quoted 7 lines

configs/jetsontx2_defconfig line 23

Quoted 7 lines
configs/jetsontx2_defconfig new file +7 -0
+BR2_USE_MMU=y
+
+BR2_SYSTEM_DHCP="eth0"
+
+# Linux headers same as kernel, a 4.9 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
+BR2_KERNEL_HEADERS_AS_KERNEL=y

We don't need this if we use the Linaro toolchain.

Quoted 23 lines
Quoted 23 lines
configs/jetsontx2_defconfig new file +23 -0
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+# patches-l4t-r32.4
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,madisongh,linux-tegra-4.9,0be1a57448010ae60505acf4e2153638455cee7c)/linux-tegra-4.9.140-r1.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="tegra"
+
+# Build the DTB from the kernel sources
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="_ddot_/_ddot_/_ddot_/_ddot_/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base"
+
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+
+BR2_PACKAGE_LINUX4TEGRA=y
+BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF=y
+
+# TODO: NVIDIA_CONTAINER_TOOLKIT requires a go-module integration.
+# BR2_PACKAGE_NVIDIA_CONTAINER_TOOLKIT=y
+
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y
+
+# Required tools to create the image
Quoted 8 lines

configs/jetsontx2_defconfig line 54

Quoted 8 lines
configs/jetsontx2_defconfig new file +8 -0
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_JQ=y
+BR2_PACKAGE_HOST_PARTED=y
+
+# Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="2000M"

This is huge, here target directory is only 215Mo after building this defconfig.

[target]$ du -hs .
215M

Best regards,
Romain

Quoted 17 lines

configs/jetsontx2_defconfig line 64

Quoted 11 lines
configs/jetsontx2_defconfig new file +10 -0
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# Uboot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="p2771-0000-500"
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,paralin,u-boot-tegra,e6da093be3cc593ef4294e1922b3391ede9c94da)/u-boot-tegra-l4t-r32.4-v2016.7.tar.gz"
+BR2_TARGET_UBOOT_FORMAT_DTB_BIN=y
+BR2_TARGET_UBOOT_NEEDS_DTC=y

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#15 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

hi Romain,

Quoted 6 lines · Romain Naour

Actually I would suggest to use the Linaro aarch64 2018.05 (BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64) because it's the toolchain recommended and used by Nvidia.

See: https://developer.nvidia.com/gcc-linaro-731-201805-sources

When using this EXTERNAL_LINARO_AARCH64 I'm getting the build error -

libnvidia-container-1.2.0/src/drivera-container-1.2.0/src/nvc_ldcache.lo] Error 1
10 | #include <rpc/rpc.h>

Even with libtirpc in the dependencies. So I guess two things:

- rpc.h is coming from the toolchain
- linaro toolchain doesn't have it (?)
- libtirpc is probably unnecessary since it's not actually being used

How to fix?

Best,
Christian

#16 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

Hello Christian,

Quoted 17 lines · Christian Stewart

hi Romain,

Quoted 6 lines · Romain Naour

Actually I would suggest to use the Linaro aarch64 2018.05 (BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64) because it's the toolchain recommended and used by Nvidia.

See: https://developer.nvidia.com/gcc-linaro-731-201805-sources

When using this EXTERNAL_LINARO_AARCH64 I'm getting the build error -

libnvidia-container-1.2.0/src/drivera-container-1.2.0/src/nvc_ldcache.lo] Error 1
10 | #include <rpc/rpc.h>

Quoted 7 lines

Even with libtirpc in the dependencies. So I guess two things:

- rpc.h is coming from the toolchain
- linaro toolchain doesn't have it (?)
- libtirpc is probably unnecessary since it's not actually being used

How to fix?

The libtirpc include files are installed to ./host/aarch64-buildroot-linux-gnu/sysroot/usr/include/tirpc, e.g.:
./host/aarch64-buildroot-linux-gnu/sysroot/usr/include/tirpc/rpc/rpc.h

Add the /usr/include/tirpc directory to the libnvidia-container compile header search path...

Regards,
Peter

Quoted 7 lines

Best,
Christian
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#17 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

In reply to Christian Stewart

Le 21/11/2020 ? 22:12, Christian Stewart a ?crit?:

Quoted 17 lines

hi Romain,

Quoted 6 lines · Romain Naour

Actually I would suggest to use the Linaro aarch64 2018.05 (BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64) because it's the toolchain recommended and used by Nvidia.

See: https://developer.nvidia.com/gcc-linaro-731-201805-sources

When using this EXTERNAL_LINARO_AARCH64 I'm getting the build error -

libnvidia-container-1.2.0/src/drivera-container-1.2.0/src/nvc_ldcache.lo] Error 1
10 | #include <rpc/rpc.h>

Quoted 7 lines

Even with libtirpc in the dependencies. So I guess two things:

- rpc.h is coming from the toolchain
- linaro toolchain doesn't have it (?)
- libtirpc is probably unnecessary since it's not actually being used

How to fix?

The Linaro toolchain provide /usr/include/rpc/rpc.h in staging directory.

libnvidia-container build fine here.

Best regards,
Romain

Quoted 4 lines

Best,
Christian

#18 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

In reply to Romain Naour

Hi Romain,

Quoted 12 lines · Romain Naour

configs/jetsontx2_defconfig line 15

Quoted 8 lines
configs/jetsontx2_defconfig new file +8 -0
+# Toolchain reference: docs.nvidia.com: "Jetson Linux Driver Package Toolchain"
+BR2_TOOLCHAIN_BUILDROOT=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
+BR2_BINUTILS_VERSION_2_32_X=y
+BR2_GCC_VERSION_7_X=y

This means that you are not working on Buildroot master because gcc 7 has been removed already.

Quoted 3 lines

This is anoying... either the latest NVIDIA SDK (jetpack 4.4.1) is already out of date because it require an old gcc version or gcc is moving too fast for such sdk.

I have tested this against GCC 8 and Buildroot 2020.08.x:

BR2_TOOLCHAIN_BUILDROOT=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_BINUTILS_VERSION_2_32_X=y
BR2_GCC_VERSION_8_X=y
BR2_USE_MMU=y

... and all works fine. Why do you think it won't work with GCC 8?

Best,
Christian

#19 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

Hello Christian,

Le 24/11/2020 ? 00:07, Christian Stewart a ?crit?:

Quoted 30 lines

Hi Romain,

Quoted 12 lines · Romain Naour

configs/jetsontx2_defconfig line 15

Quoted 8 lines
configs/jetsontx2_defconfig new file +8 -0
+# Toolchain reference: docs.nvidia.com: "Jetson Linux Driver Package Toolchain"
+BR2_TOOLCHAIN_BUILDROOT=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
+BR2_BINUTILS_VERSION_2_32_X=y
+BR2_GCC_VERSION_7_X=y

This means that you are not working on Buildroot master because gcc 7 has been removed already.

Quoted 3 lines

This is anoying... either the latest NVIDIA SDK (jetpack 4.4.1) is already out of date because it require an old gcc version or gcc is moving too fast for such sdk.

I have tested this against GCC 8 and Buildroot 2020.08.x:

BR2_TOOLCHAIN_BUILDROOT=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_BINUTILS_VERSION_2_32_X=y
BR2_GCC_VERSION_8_X=y
BR2_USE_MMU=y

Quoted 1 line

... and all works fine. Why do you think it won't work with GCC 8?

Cuda libraries requires a specific gcc version, see the tegra-demo-distro layer [1]. I guess nivida only use gcc 7 (or maybe gcc 8) because they are using ubuntu on this platform.

Also, the kernel you use come from github OE4T [2] where ~20 kernel patches have been backported to fix gcc >= 8 issues. But this is not really the kernel from Nvidia SDK.

I understand that the nvidia sdk is difficult to package into Buildroot or Yocto. My review is absolutely not a no-go for merging this BSP. You did a great job since you're able to use it with Buildroot :)

[1]
https://github.com/OE4T/tegra-demo-distro/blob/master/layers/meta-tegrademo/conf/distro/tegrademo.conf#L58
[2] https://github.com/OE4T/linux-tegra-4.9

Best regards,
Romain

Quoted 4 lines

Best,
Christian

#20 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

Hi Christian,

I wanted to follow up here with some feedback. I work for NVIDIA and have been working on similar things as you, integrating the Jetson line of boards into Buildroot. Usual disclaimer, all opinions expressed here are my own and do not reflect those of my employer. I'm very excited to see others working on this though!

I don't want to derail this discussion in any way, but I thought I might be able to help some. A couple of issues I noticed:

1. Package name -- this should be "tegra210" or "tegra210-linux" -- this package is for the BSP (Board Support Package), not Linux4Tegra, the custom kernel NVIDIA provides for its Tegra line of chips. Other boards require different BSPs, and still use Linux4Tegra for the kernel.

2. Root permissions -- you can remove the root permissions requirement by not using the flash.sh script NVIDIA provides. It's really a high-level wrapper around other scripts and image signing tools that require root. This should eliminate the need for your custom patch (0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch). Happy to work with you on this. The way NVIDIA flashes boards and defines the partition layout through xml files and parsing can be difficult to translate to genimage or another Buildroot-compatibile tool. The way I've gone here was to define a layout based on the output from NVIDIA's scripts, and then target different layouts based on the board configuration parameters. This is more work up-front and requires some thinking about how each of the boards can be structured within Buildroot, but I think the flexibility (and not having root permissions) outweighs. I personally find having a genimage.cfg much clearer than the XML files for referencing partition layouts too.

3. BSP software (everything under nv_tegra directory) -- this is a tough issue. Ideally, I would like to see NVIDIA offer some static download URLs for each of these pieces of software so we could create them as individual Buildroot packages, rather than just installed altogether as part of the BSP. I think this would be more in line with Buildroot's approach towards building minimal firmware with only the packages you need. I understand if this works for your use case, but there's a lot of system setup also included in this directory (nv_tegra/config.tbz2) that has implications on the Buildroot port and currently assumes you're building an Ubuntu-based system. How to handle udev configuration, for example -- I would suggest copying configurations over should be opt-in based on whether the user has selected BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y.

Quoted 1 line

Cuda libraries requires a specific gcc version, see the tegra-demo-distro

layer

Quoted 4 lines

[1]. I guess nivida only use gcc 7 (or maybe gcc 8) because they are using ubuntu on this platform.

Also, the kernel you use come from github OE4T [2] where ~20 kernel

patches have

Quoted 1 line

been backported to fix gcc >= 8 issues. But this is not really the kernel

from

Quoted 1 line

Nvidia SDK.

Romain is correct about the Linux4Tegra kernel here. I have a patch (really a series) I started to submit to add this in to Buildroot (see:
http://buildroot-busybox.2317881.n4.nabble.com/PATCH-0-1-package-linux-nvidia-for-Jetson-Nano-SD-td269064.html#a269065),
and hopefully you can build on it. L4T should be able to work and compile fine with GCC 8 or 9, but the kernel compilation currently breaks with 10.x.

Kind regards,
Graham Leva

Quoted 65 lines · Romain Naour

Hello Christian,

Le 24/11/2020 ? 00:07, Christian Stewart a ?crit :

Quoted 3 lines

Hi Romain,

On Thu, Nov 19, 2020 at 5:40 AM Romain Naour <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line

+# Toolchain reference: docs.nvidia.com: "Jetson Linux Driver Package

Toolchain"

Quoted 9 lines
Quoted 9 lines

configs/jetsontx2_defconfig line 15

Quoted 7 lines
configs/jetsontx2_defconfig new file +7 -0
+BR2_TOOLCHAIN_BUILDROOT=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
+BR2_BINUTILS_VERSION_2_32_X=y
+BR2_GCC_VERSION_7_X=y

This means that you are not working on Buildroot master because gcc 7

has been

Quoted 3 lines
Quoted 3 lines

removed already.

This is anoying... either the latest NVIDIA SDK (jetpack 4.4.1) is

already out

Quoted 1 line
Quoted 1 line

of date because it require an old gcc version or gcc is moving too fast

for such

Quoted 13 lines
Quoted 1 line

sdk.

I have tested this against GCC 8 and Buildroot 2020.08.x:

BR2_TOOLCHAIN_BUILDROOT=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
BR2_BINUTILS_VERSION_2_32_X=y
BR2_GCC_VERSION_8_X=y
BR2_USE_MMU=y

Quoted 1 line

... and all works fine. Why do you think it won't work with GCC 8?

Cuda libraries requires a specific gcc version, see the tegra-demo-distro layer
[1]. I guess nivida only use gcc 7 (or maybe gcc 8) because they are using ubuntu on this platform.

Also, the kernel you use come from github OE4T [2] where ~20 kernel patches have
been backported to fix gcc >= 8 issues. But this is not really the kernel from
Nvidia SDK.

I understand that the nvidia sdk is difficult to package into Buildroot or Yocto. My review is absolutely not a no-go for merging this BSP. You did a great
job since you're able to use it with Buildroot :)

[1]

https://github.com/OE4T/tegra-demo-distro/blob/master/layers/meta-tegrademo/conf/distro/tegrademo.conf#L58
[2] https://github.com/OE4T/linux-tegra-4.9

Best regards,
Romain

Quoted 1 line
Quoted 9 lines
Quoted 3 lines

Best,
Christian

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201124/93014645/attachment.html>

#21 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

Hi Graham,

Quoted 1 line · Graham Leva

I wanted to follow up here with some feedback. I work for NVIDIA and have been working on similar things as you, integrating the Jetson line of boards into Buildroot. Usual disclaimer, all opinions expressed here are my own and do not reflect those of my employer. I'm very excited to see others working on this though!

Glad to hear there is interest in supporting this effort in Buildroot from NVIDIA.

If you have a series you've written for L4T that provides LibGL properly, it'd be quite helpful if that could be merged into this and/or if we could use your series instead.

My primary goal is to provide support for the Jetson TX2 and Nano that works as reliably as possible while not falling too far behind on compiler and/or glibc versions.

Quoted 3 lines

I don't want to derail this discussion in any way, but I thought I might be able to help some. A couple of issues I noticed:

1. Package name -- this should be "tegra210" or "tegra210-linux" -- this package is for the BSP (Board Support Package), not Linux4Tegra, the custom kernel NVIDIA provides for its Tegra line of chips. Other boards require different BSPs, and still use Linux4Tegra for the kernel.

The download for this package comes from this page -

https://developer.nvidia.com/embedded/linux-tegra-archive

Which is named "linux-tegra-archive" - "L4T Archive" - "NVIDIA L4T is the board support package for Jetson."

The branding is pretty explicit that this board support package is named "linux4tegra" which includes the kernel as part of the bundle. This is why I chose this package name for the series.

The package supports fetching multiple variants, either the t210 or t186ref.

Given the large quantity of license files and hashes in this package, it would be (IMO) best to maintain a single package for all of the board variants, if possible. The contents of the different versions of l4t are nearly identical and are processed identically.

If it is indeed necessary / better to duplicate the package several times and make one per variant, I can make that change + the naming changes.

Quoted 1 line

2. Root permissions -- you can remove the root permissions requirement by not using the flash.sh script NVIDIA provides. It's really a high-level wrapper around other scripts and image signing tools that require root. This should eliminate the need for your custom patch (0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch). Happy to work with you on this.

Actually, the purpose of the patch is not to remove the requirement for root. It's to prevent the script from generating a new ext4 rootfs image. This step is unnecessary, Buildroot does it already.

Instead what happens, with the patch applied, is that the script will flash the buildroot produced ext4 partition image directly to the target emmc device, rather than building a ext4 image from scratch unnecessarily.

I use this to flash the emmc on the TX2 over USB (as mentioned in the readme.txt).

Quoted 1 line

The way NVIDIA flashes boards and defines the partition layout through xml files and parsing can be difficult to translate to genimage or another Buildroot-compatibile tool.

Indeed but this is a separate issue than the flash.sh patch. I believe flash.sh can still produce rootless images anyway even with the patch applied.

Quoted 2 lines

The way I've gone here was to define a layout based on the output from NVIDIA's scripts, and then target different layouts based on the board configuration parameters.
This is more work up-front and requires some thinking about how each of the boards can be structured within Buildroot, but I think the flexibility (and not having root permissions) outweighs. I personally find having a genimage.cfg much clearer than the XML files for referencing partition layouts too.

This is a lot of extra effort that I don't think I would be willing to maintain (can't speak for the other developers).

At the moment for practical purposes the flash.sh script works perfectly to flash the device over USB and/or produce the device images. Is there any reason why we shouldn't use that script?

If a custom partition layout is possible it would be quite good.

Quoted 1 line

3. BSP software (everything under nv_tegra directory) -- this is a tough issue. Ideally, I would like to see NVIDIA offer some static download URLs for each of these pieces of software so we could create them as individual Buildroot packages, rather than just installed altogether as part of the BSP. I think this would be more in line with Buildroot's approach towards building minimal firmware with only the packages you need. I understand if this works for your use case, but there's a lot of system setup also included in this directory (nv_tegra/config.tbz2) that has implications on the Buildroot port and currently assumes you're building an Ubuntu-based system. How to handle udev configuration, for example -- I would suggest copying configurations over should be opt-in based on whether the user has selected BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y.

Well, it's of course possible to filter which files we copy based on these conditions, even without splitting this into separate packages. I wonder though if (for an initial version in the tree) there's any harm in installing udev rules when udev is not enabled? This won't have any effect, right? So it shouldn't be a showstopper for v0.

Quoted 7 lines
Quoted 7 lines

Cuda libraries requires a specific gcc version, see the tegra-demo-distro layer [1]. I guess nivida only use gcc 7 (or maybe gcc 8) because they are using ubuntu on this platform.

Also, the kernel you use come from github OE4T [2] where ~20 kernel patches have been backported to fix gcc >= 8 issues. But this is not really the kernel from Nvidia SDK.

It works with GCC 8 but I am seeing some errors loading the tegra_xusb firmware.

Quoted 1 line

Romain is correct about the Linux4Tegra kernel here. I have a patch (really a series) I started to submit to add this in to Buildroot (see: http://buildroot-busybox.2317881.n4.nabble.com/PATCH-0-1-package-linux-nvidia-for-Jetson-Nano-SD-td269064.html#a269065), and hopefully you can build on it. L4T should be able to work and compile fine with GCC 8 or 9, but the kernel compilation currently breaks with 10.x.

That patch, as far as I can see, just downloads l4t from a git source via package-generic?

Which parts should I take from there for this series?

Thanks again for the support on this.

Best regards,
Christian Stewart

#22 lore raw

PATCH v4 4/5 board: add nvidia jetson tx2 support

Christian,

Quoted 2 lines

Glad to hear there is interest in supporting this effort in Buildroot from NVIDIA.

There's really not any official support from NVIDIA at this time, unfortunately,
just me working in my spare time right now. But I'm happy to help to see the Jetson series be more successful in Buildroot :)

Quoted 3 lines

My primary goal is to provide support for the Jetson TX2 and Nano that works as reliably as possible while not falling too far behind on compiler and/or glibc versions.

This is a great goal! I would very much like to see this happen too.

Quoted 3 lines

If you have a series you've written for L4T that provides LibGL properly, it'd be quite helpful if that could be merged into this and/or if we could use your series instead.

I wasn't aware there was an issue with LibGL and Buildroot. Feel free to reach out to me through email to discuss this in more detail.

Quoted 3 lines

The download for this package comes from this page -

https://developer.nvidia.com/embedded/linux-tegra-archive

<https://developer.nvidia.com/embedded/linux-tegra-archive>

Quoted 6 lines

...
The branding is pretty explicit that this board support package is named "linux4tegra" which includes the kernel as part of the bundle. This is why I chose this package name for the series.

The package supports fetching multiple variants, either the t210 or

t186ref.

Yeah, I can definitely see how you would come to that conclusion based on the
website and marketing. I think maybe this is more of an internal distinction than
external and not a big issue.

Quoted 4 lines

Given the large quantity of license files and hashes in this package, it would be (IMO) best to maintain a single package for all of the board variants, if possible. The contents of the different versions of l4t are nearly identical and are processed identically.

I agree with you that this is a major issue with using the BSP for everything.
The way NVIDIA approaches firmware for the Jetson line is philosophically quite different from Buildroot in that it's made for building an Ubuntu-based system
with package manager and all batteries included. Fortunately, NVIDIA provides separate git repositories for many of the BSP firmware components that can be selected and built conditionally, which I think will allow an approach to firmware generation more compatible with Buildroot. The biggest issue I see is that each piece of software NVIDIA is not yet packaged individually
yet (cuda-base, cuda, libargus, etc), making handling of the BSP in Buildroot
problematic.

Quoted 6 lines

This is a lot of extra effort that I don't think I would be willing to maintain (can't speak for the other developers).

At the moment for practical purposes the flash.sh script works perfectly to flash the device over USB and/or produce the device images. Is there any reason why we shouldn't use that script?

I don't mean to suggest there's anything wrong with the flash.sh script ? there's not, and you should use it if it works for you ? it just takes a different approach to building firmware.

Personally, I quite like how Buildroot board configs are responsible for generating image artifacts, leaving image generation and flashing to utilities. I'd like to see any NVIDIA board configs follow this approach if they were part of Buildroot. And yes, it is more work this way, but like I said before, I'm happy to help if I can :).

Quoted 5 lines

Well, it's of course possible to filter which files we copy based on these conditions, even without splitting this into separate packages. I wonder though if (for an initial version in the tree) there's any harm in installing udev rules when udev is not enabled? This won't have any effect, right? So it shouldn't be a showstopper for v0.

As far as I know, there wouldn't be any harm. I think it's just a matter of preference for not installing things your system doesn't need. I haven't gone through all of the configurations yet though, so I can't
speak to the rest.

Quoted 4 lines

That patch, as far as I can see, just downloads l4t from a git source via package-generic?

Which parts should I take from there for this series?

Yes, it's just a single patch there. I will probably resubmit as a full series
of patches as it makes little sense by itself. This branch includes a squashed
version of all kernel, bootloader, and firmware packages for the 4GB nano SD (p3450-0000) that will be broken up for the patch series:
https://github.com/celaxodon/buildroot/tree/board/jetson-nano-squashed

You can build everything with make jetson_nano_defconfig. Note that it's a little behind master, still uses GCC 7, and will require building different
NVIDIA hardware packages (see package/hardware-nvidia/Config.in) based on the target board. I can direct you to the patch series after I've carved
each out. To combine this work with yours, you could probably apply the single commit from my squashed branch and deactivate my BSP package, "tegra210-linux", substituting your "linux4tegra" package.

Kind regards,
Graham Leva

Quoted 139 lines · Christian Stewart

Hi Graham,

Quoted 1 line · Graham Leva

I wanted to follow up here with some feedback. I work for NVIDIA and

have been working on similar things as you, integrating the Jetson line of boards into Buildroot. Usual disclaimer, all opinions expressed here are my own and do not reflect those of my employer. I'm very excited to see others working on this though!

Glad to hear there is interest in supporting this effort in Buildroot from NVIDIA.

If you have a series you've written for L4T that provides LibGL properly, it'd be quite helpful if that could be merged into this and/or if we could use your series instead.

My primary goal is to provide support for the Jetson TX2 and Nano that works as reliably as possible while not falling too far behind on compiler and/or glibc versions.

Quoted 1 line

I don't want to derail this discussion in any way, but I thought I might

be able to help some. A couple of issues I noticed:

Quoted 2 lines

1. Package name -- this should be "tegra210" or "tegra210-linux" -- this

package is for the BSP (Board Support Package), not Linux4Tegra, the custom kernel NVIDIA provides for its Tegra line of chips. Other boards require different BSPs, and still use Linux4Tegra for the kernel.

The download for this package comes from this page -

https://developer.nvidia.com/embedded/linux-tegra-archive

Which is named "linux-tegra-archive" - "L4T Archive" - "NVIDIA L4T is the board support package for Jetson."

The branding is pretty explicit that this board support package is named "linux4tegra" which includes the kernel as part of the bundle. This is why I chose this package name for the series.

The package supports fetching multiple variants, either the t210 or t186ref.

Given the large quantity of license files and hashes in this package, it would be (IMO) best to maintain a single package for all of the board variants, if possible. The contents of the different versions of l4t are nearly identical and are processed identically.

If it is indeed necessary / better to duplicate the package several times and make one per variant, I can make that change + the naming changes.

Quoted 1 line

2. Root permissions -- you can remove the root permissions requirement

by not using the flash.sh script NVIDIA provides. It's really a high-level wrapper around other scripts and image signing tools that require root. This should eliminate the need for your custom patch (0001-Adjust-flash.sh-for-flashing-Buildroot-produced-disk.patch). Happy to work with you on this.

Actually, the purpose of the patch is not to remove the requirement for root. It's to prevent the script from generating a new ext4 rootfs image. This step is unnecessary, Buildroot does it already.

Instead what happens, with the patch applied, is that the script will flash the buildroot produced ext4 partition image directly to the target emmc device, rather than building a ext4 image from scratch unnecessarily.

I use this to flash the emmc on the TX2 over USB (as mentioned in the readme.txt).

Quoted 1 line

The way NVIDIA flashes boards and defines the partition layout through

xml files and parsing can be difficult to translate to genimage or another Buildroot-compatibile tool.

Indeed but this is a separate issue than the flash.sh patch. I believe flash.sh can still produce rootless images anyway even with the patch applied.

Quoted 1 line

The way I've gone here was to define a layout based on the output from

NVIDIA's scripts, and then target different layouts based on the board configuration parameters.

Quoted 1 line

This is more work up-front and requires some thinking about how each of

the boards can be structured within Buildroot, but I think the flexibility (and not having root permissions) outweighs. I personally find having a genimage.cfg much clearer than the XML files for referencing partition layouts too.

This is a lot of extra effort that I don't think I would be willing to maintain (can't speak for the other developers).

At the moment for practical purposes the flash.sh script works perfectly to flash the device over USB and/or produce the device images. Is there any reason why we shouldn't use that script?

If a custom partition layout is possible it would be quite good.

Quoted 1 line

3. BSP software (everything under nv_tegra directory) -- this is a tough

issue. Ideally, I would like to see NVIDIA offer some static download URLs for each of these pieces of software so we could create them as individual Buildroot packages, rather than just installed altogether as part of the BSP. I think this would be more in line with Buildroot's approach towards building minimal firmware with only the packages you need. I understand if this works for your use case, but there's a lot of system setup also included in this directory (nv_tegra/config.tbz2) that has implications on the Buildroot port and currently assumes you're building an Ubuntu-based system. How to handle udev configuration, for example -- I would suggest copying configurations over should be opt-in based on whether the user has selected BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y.

Well, it's of course possible to filter which files we copy based on these conditions, even without splitting this into separate packages. I wonder though if (for an initial version in the tree) there's any harm in installing udev rules when udev is not enabled? This won't have any effect, right? So it shouldn't be a showstopper for v0.

Quoted 1 line
Quoted 1 line

Cuda libraries requires a specific gcc version, see the

tegra-demo-distro layer

Quoted 1 line
Quoted 1 line

[1]. I guess nivida only use gcc 7 (or maybe gcc 8) because they are

using

Quoted 3 lines
Quoted 3 lines

ubuntu on this platform.

Also, the kernel you use come from github OE4T [2] where ~20 kernel

patches have

Quoted 1 line
Quoted 1 line

been backported to fix gcc >= 8 issues. But this is not really the

kernel from

Quoted 1 line
Quoted 1 line

Nvidia SDK.

It works with GCC 8 but I am seeing some errors loading the tegra_xusb firmware.

Quoted 1 line

Romain is correct about the Linux4Tegra kernel here. I have a patch

(really a series) I started to submit to add this in to Buildroot (see:
http://buildroot-busybox.2317881.n4.nabble.com/PATCH-0-1-package-linux-nvidia-for-Jetson-Nano-SD-td269064.html#a269065),
and hopefully you can build on it. L4T should be able to work and compile fine with GCC 8 or 9, but the kernel compilation currently breaks with 10.x.

That patch, as far as I can see, just downloads l4t from a git source via package-generic?

Quoted 7 lines

Which parts should I take from there for this series?

Thanks again for the support on this.

Best regards,
Christian Stewart

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201126/cff53eb4/attachment.html>

#23 lore raw

PATCH v4 5/5 board: add nvidia jetson nano support

In reply to Christian Stewart

---

v3 -> v4:

- thanks Romain for the review
- cjs: added gcc + binutils version specifiers
- tested against devkit hardware

---
 board/jetson/nano/format-sd.sh | 167 +++++++++++++++++++++++++++++++++
 board/jetson/nano/readme.txt   |  57 +++++++++++
 board/jetsonnano               |   1 +
 configs/jetsonnano_defconfig   |  64 +++++++++++++
 4 files changed, 289 insertions(+)
 create mode 100644 board/jetson/nano/format-sd.sh
 create mode 100644 board/jetson/nano/readme.txt
 create mode 120000 board/jetsonnano
 create mode 100644 configs/jetsonnano_defconfig
board/jetson/nano/format-sd.sh new file +167 -0
new file mode 100644
index 0000000000..1d3b6c442a
@@ -0,0 +1,167 @@
+#!/bin/bash
+set -eo pipefail
+
+# NOTE: The following copyright applies to linux4tegra and associated tools:
+
+# Copyright (c) 2019-2020, NVIDIA Corporation.  All Rights Reserved.
+#
+# NVIDIA Corporation and its licensors retain all intellectual property
+# and proprietary rights in and to this software, related documentation
+# and any modifications thereto.  Any use, reproduction, disclosure or
+# distribution of this software and related documentation without an express
+# license agreement from NVIDIA Corporation is strictly prohibited.
+
+if [ $EUID != 0 ]; then
+  echo "This script requires root."
+fi
+
+if [ -z "$NVIDIA_SD" ]; then
+    echo "Please set NVIDIA_SD and try again."
+    exit 1
+fi
+
+if [ ! -b "$NVIDIA_SD" ]; then
+    echo "$NVIDIA_SD is not a block device or doesn't exist."
+    exit 1
+fi
+
+IMAGES_DIR=$1
+if [ -z $IMAGES_DIR ]; then
+    echo "usage: $0 path/to/images/dir"
+    exit 1
+fi
+
+uimg_path=$IMAGES_DIR/Image
+if [ ! -f "$uimg_path" ]; then
+  echo "Image not found, make sure Buildroot is done compiling."
+  exit 1
+fi
+
+l4t_tools_path=$IMAGES_DIR/linux4tegra/tools
+if [ ! -d $l4t_tools_path ]; then
+    echo "linux4tegra tools not found, ensure buildroot is done compiling."
+    exit 1
+fi
+
+# jetson-nano
+boardid="3448"
+target="jetson-nano-qspi-sd"
+storage="sdcard"
+rev="300" # from 100, 200, 300
+chipid="0x21"
+
+l4t_dir=${IMAGES_DIR}/linux4tegra
+rootfs_img=$IMAGES_DIR/rootfs.ext2
+
+# TODO: dynamic rootfs size: the following /almost/ works:
+#rootfs_size=$(du -ms ${rootfs_img} | awk '{print $1}')
+#rootfs_size=$((rootfs_size + (rootfs_size / 10)))
+
+rootfs_size=2048
+
+echo "creating signed images"
+pushd ${l4t_dir}
+export BOARDID="${boardid}"
+export FAB="${rev}"
+
+${l4t_dir}/flash.sh \
+          --no-flash \
+          --sign \
+          --no-systemimg \
+          -x ${chipid} \
+          -B ${boardid} \
+          -S "${rootfs_size}MiB" \
+          -I $IMAGES_DIR/rootfs.ext2 \
+          -K $IMAGES_DIR/u-boot-dtb.bin \
+          -d $IMAGES_DIR/tegra210-p3448-0000-p3449-0000-b00.dtb \
+          "${target}" "mmcblk0p1"
+popd
+
+bootloader_dir=${l4t_dir}/bootloader
+if [ ! -f "${bootloader_dir}/flashcmd.txt" ]; then
+		echo "ERROR: ${bootloader_dir}/flashcmd.txt not found"
+		exit 1
+fi
+
+signed_image_dir=${bootloader_dir}/signed
+if [ ! -d "${signed_image_dir}" ]; then
+		echo "ERROR: ${signed_image_dir} not found"
+		exit 1
+fi
+
+chipid=$(sed -nr 's/.*chip ([^ ]*).*/\1/p' "${bootloader_dir}/flashcmd.txt")
+if [ "${chipid}" = "0x21" ]; then
+		signed_cfg="flash.xml"
+else
+		signed_cfg="flash.xml.tmp"
+fi
+
+if [ ! -f "${signed_image_dir}/${signed_cfg}" ]; then
+		echo "ERROR: ${signed_image_dir}/${signed_cfg} not found"
+		exit 1
+fi
+
+echo "create partitions"
+partitions=($(${l4t_tools_path}/nvptparser.py "${signed_image_dir}/${signed_cfg}" "${storage}"))
+part_type=8300 # Linux Filesystem
+
+sgdisk -og "${NVIDIA_SD}"
+for part in "${partitions[@]}"; do
+		eval "${part}"
+		if [ "${part_name}" = "master_boot_record" ]; then
+			  continue
+		fi
+		part_size=$((${part_size} / 512)) # convert to sectors
+		sgdisk -n "${part_num}":0:+"${part_size}" \
+			     -c "${part_num}":"${part_name}" \
+			     -t "${part_num}":"${part_type}" "${NVIDIA_SD}"
+done
+
+# prefer root partprobe
+PARTPROBE=partprobe
+if [ -f /usr/sbin/partprobe ]; then
+    PARTPROBE=/usr/sbin/partprobe
+fi
+
+$PARTPROBE ${NVIDIA_SD} || true
+sleep 1
+if $PARTPROBE ${NVIDIA_SD}; then
+    # wait for partitions to settle
+    sleep 1
+fi
+
+echo "write partitions"
+for part in "${partitions[@]}"; do
+		eval "${part}"
+		target_file=""
+		if [ "${part_name}" = "APP" ]; then
+			  target_file="${IMAGES_DIR}/rootfs.ext2" # Buildroot target system.
+		elif [ -e "${signed_image_dir}/${part_file}" ]; then
+			  target_file="${signed_image_dir}/${part_file}"
+		elif [ -e "${bootloader_dir}/${part_file}" ]; then
+			  target_file="${bootloader_dir}/${part_file}"
+		fi
+
+		echo "writing partition ${part_name}"
+		if [ "${part_name}" = "master_boot_record" ]; then
+			  echo "writing ${part_file}"
+			  dd conv=notrunc conv=fsync if="${signed_image_dir}/${part_file}" of="${NVIDIA_SD}" bs="${part_size}" count=1
+			  continue
+		fi
+
+		if [ "${target_file}" != "" ] && [ "${part_file}" != "" ]; then
+			  echo "writing ${target_file}"
+        target_part=${NVIDIA_SD}p${part_num}
+        if [ ! -b ${target_part} ]; then
+            target_part=${NVIDIA_SD}${part_num}
+        fi
+        if [ ! -b ${target_part} ]; then
+            echo "Partition block device ${target_part} or ${NVIDIA_SD}p${part_num} does not exist!"
+            exit 1
+        fi
+			  sudo dd conv=fsync if="${target_file}" of="${target_part}"
+		fi
+done
+
+echo "Successfully flashed $NVIDIA_SD"
+
board/jetson/nano/readme.txt new file +57 -0

57 lines not on this page · raw message

board/jetsonnano new file +1 -0
new file mode 120000
index 0000000000..808abfb405
@@ -0,0 +1 @@
+./jetson/nano
\ No newline at end of file
configs/jetsonnano_defconfig new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.29.2
#24 lore raw

PATCH v4 5/5 board: add nvidia jetson nano support

Hello Christian,

Le 19/11/2020 ? 08:53, Christian Stewart a ?crit?:

Quoted 142 lines

---

v3 -> v4:

- thanks Romain for the review
- cjs: added gcc + binutils version specifiers
- tested against devkit hardware

---
 board/jetson/nano/format-sd.sh | 167 +++++++++++++++++++++++++++++++++
 board/jetson/nano/readme.txt   |  57 +++++++++++
 board/jetsonnano               |   1 +
 configs/jetsonnano_defconfig   |  64 +++++++++++++
 4 files changed, 289 insertions(+)
 create mode 100644 board/jetson/nano/format-sd.sh
 create mode 100644 board/jetson/nano/readme.txt
 create mode 120000 board/jetsonnano
 create mode 100644 configs/jetsonnano_defconfig
board/jetson/nano/format-sd.sh new file +114 -0
new file mode 100644
index 0000000000..1d3b6c442a
@@ -0,0 +1,167 @@
+#!/bin/bash
+set -eo pipefail
+
+# NOTE: The following copyright applies to linux4tegra and associated tools:
+
+# Copyright (c) 2019-2020, NVIDIA Corporation.  All Rights Reserved.
+#
+# NVIDIA Corporation and its licensors retain all intellectual property
+# and proprietary rights in and to this software, related documentation
+# and any modifications thereto.  Any use, reproduction, disclosure or
+# distribution of this software and related documentation without an express
+# license agreement from NVIDIA Corporation is strictly prohibited.
+
+if [ $EUID != 0 ]; then
+  echo "This script requires root."
+fi
+
+if [ -z "$NVIDIA_SD" ]; then
+    echo "Please set NVIDIA_SD and try again."
+    exit 1
+fi
+
+if [ ! -b "$NVIDIA_SD" ]; then
+    echo "$NVIDIA_SD is not a block device or doesn't exist."
+    exit 1
+fi
+
+IMAGES_DIR=$1
+if [ -z $IMAGES_DIR ]; then
+    echo "usage: $0 path/to/images/dir"
+    exit 1
+fi
+
+uimg_path=$IMAGES_DIR/Image
+if [ ! -f "$uimg_path" ]; then
+  echo "Image not found, make sure Buildroot is done compiling."
+  exit 1
+fi
+
+l4t_tools_path=$IMAGES_DIR/linux4tegra/tools
+if [ ! -d $l4t_tools_path ]; then
+    echo "linux4tegra tools not found, ensure buildroot is done compiling."
+    exit 1
+fi
+
+# jetson-nano
+boardid="3448"
+target="jetson-nano-qspi-sd"
+storage="sdcard"
+rev="300" # from 100, 200, 300
+chipid="0x21"
+
+l4t_dir=${IMAGES_DIR}/linux4tegra
+rootfs_img=$IMAGES_DIR/rootfs.ext2
+
+# TODO: dynamic rootfs size: the following /almost/ works:
+#rootfs_size=$(du -ms ${rootfs_img} | awk '{print $1}')
+#rootfs_size=$((rootfs_size + (rootfs_size / 10)))
+
+rootfs_size=2048
+
+echo "creating signed images"
+pushd ${l4t_dir}
+export BOARDID="${boardid}"
+export FAB="${rev}"
+
+${l4t_dir}/flash.sh \
+          --no-flash \
+          --sign \
+          --no-systemimg \
+          -x ${chipid} \
+          -B ${boardid} \
+          -S "${rootfs_size}MiB" \
+          -I $IMAGES_DIR/rootfs.ext2 \
+          -K $IMAGES_DIR/u-boot-dtb.bin \
+          -d $IMAGES_DIR/tegra210-p3448-0000-p3449-0000-b00.dtb \
+          "${target}" "mmcblk0p1"
+popd
+
+bootloader_dir=${l4t_dir}/bootloader
+if [ ! -f "${bootloader_dir}/flashcmd.txt" ]; then
+		echo "ERROR: ${bootloader_dir}/flashcmd.txt not found"
+		exit 1
+fi
+
+signed_image_dir=${bootloader_dir}/signed
+if [ ! -d "${signed_image_dir}" ]; then
+		echo "ERROR: ${signed_image_dir} not found"
+		exit 1
+fi
+
+chipid=$(sed -nr 's/.*chip ([^ ]*).*/\1/p' "${bootloader_dir}/flashcmd.txt")
+if [ "${chipid}" = "0x21" ]; then
+		signed_cfg="flash.xml"
+else
+		signed_cfg="flash.xml.tmp"
+fi
+
+if [ ! -f "${signed_image_dir}/${signed_cfg}" ]; then
+		echo "ERROR: ${signed_image_dir}/${signed_cfg} not found"
+		exit 1
+fi
+
+echo "create partitions"
+partitions=($(${l4t_tools_path}/nvptparser.py "${signed_image_dir}/${signed_cfg}" "${storage}"))
+part_type=8300 # Linux Filesystem
+
+sgdisk -og "${NVIDIA_SD}"
+for part in "${partitions[@]}"; do
+		eval "${part}"
+		if [ "${part_name}" = "master_boot_record" ]; then
+			  continue
+		fi
+		part_size=$((${part_size} / 512)) # convert to sectors

board/jetson/nano/format-sd.sh line 124

Quoted 10 lines
board/jetson/nano/format-sd.sh new file +10 -0
+		sgdisk -n "${part_num}":0:+"${part_size}" \
+			     -c "${part_num}":"${part_name}" \
+			     -t "${part_num}":"${part_type}" "${NVIDIA_SD}"
+done
+
+# prefer root partprobe
+PARTPROBE=partprobe
+if [ -f /usr/sbin/partprobe ]; then
+    PARTPROBE=/usr/sbin/partprobe
+fi

This requires partprobe installed on the build machine. partprobe is available in HOST_DIR (see HOST_DIR/sbin/partprobe)

Quoted 126 lines
board/jetson/nano/format-sd.sh new file +43 -0
+
+$PARTPROBE ${NVIDIA_SD} || true
+sleep 1
+if $PARTPROBE ${NVIDIA_SD}; then
+    # wait for partitions to settle
+    sleep 1
+fi
+
+echo "write partitions"
+for part in "${partitions[@]}"; do
+		eval "${part}"
+		target_file=""
+		if [ "${part_name}" = "APP" ]; then
+			  target_file="${IMAGES_DIR}/rootfs.ext2" # Buildroot target system.
+		elif [ -e "${signed_image_dir}/${part_file}" ]; then
+			  target_file="${signed_image_dir}/${part_file}"
+		elif [ -e "${bootloader_dir}/${part_file}" ]; then
+			  target_file="${bootloader_dir}/${part_file}"
+		fi
+
+		echo "writing partition ${part_name}"
+		if [ "${part_name}" = "master_boot_record" ]; then
+			  echo "writing ${part_file}"
+			  dd conv=notrunc conv=fsync if="${signed_image_dir}/${part_file}" of="${NVIDIA_SD}" bs="${part_size}" count=1
+			  continue
+		fi
+
+		if [ "${target_file}" != "" ] && [ "${part_file}" != "" ]; then
+			  echo "writing ${target_file}"
+        target_part=${NVIDIA_SD}p${part_num}
+        if [ ! -b ${target_part} ]; then
+            target_part=${NVIDIA_SD}${part_num}
+        fi
+        if [ ! -b ${target_part} ]; then
+            echo "Partition block device ${target_part} or ${NVIDIA_SD}p${part_num} does not exist!"
+            exit 1
+        fi
+			  sudo dd conv=fsync if="${target_file}" of="${target_part}"
+		fi
+done
+
+echo "Successfully flashed $NVIDIA_SD"
+
board/jetson/nano/readme.txt new file +57 -0
new file mode 100644
index 0000000000..8161c7e60f
@@ -0,0 +1,57 @@
+NVIDIA Jetson Nano
+
+Intro
+=====
+
+This configuration adds support for the Jetson Nano devkit.
+
+Building
+========
+
+Configure Buildroot
+-------------------
+
+For Jetson Nano:
+
+  $ make jetsonnano_defconfig
+
+Build the rootfs
+----------------
+
+You may now build your rootfs with:
+
+  $ make
+
+
+Flashing
+========
+
+Once the build process is finished you will have the target binaries in the
+output/images directory with a copy of linux4tegra.
+
+To format your SD card with the required partition layout, use the
+"format-sd.sh" script located under board/jetson/nano/format-sd.sh:
+
+  sudo \
+    NVIDIA_SD=/dev/sdX \
+    PATH=$(pwd)/output/host/sbin:$PATH \
+    bash board/jetson/nano/format-sd.sh ./output/images
+
+This will also flash the ext4 rootfs image to the SD card.
+
+Bootup Process
+==============
+
+The Jetson Nano can boot to a SD card.
+
+A "secure boot" process is used, with multiple bootloaders:
+
+ - BootROM -> MB1 (TrustZone)
+ - MB2/BPMP -> (Non-Trustzone)
+ - Cboot (uses Little Kernel)
+ - Uboot
+ - Kernel
+ 
+Cboot could be compiled from source, and the source is available from the
+official sources, however, we do not (yet) compile cboot.
+
board/jetsonnano new file +1 -0
new file mode 120000
index 0000000000..808abfb405
@@ -0,0 +1 @@
+./jetson/nano
\ No newline at end of file
configs/jetsonnano_defconfig new file +6 -0
new file mode 100644
index 0000000000..e2ec18616f
@@ -0,0 +1,64 @@
+BR2_aarch64=y
+BR2_cortex_a57=y
+BR2_ARM_FPU_FP_ARMV8=y
+
+# enable specific optimizations
+BR2_TARGET_OPTIMIZATION="-march=armv8-a+crypto -mcpu=cortex-a57+crypto"

configs/jetsonnano_defconfig line 16

Quoted 10 lines
configs/jetsonnano_defconfig new file +10 -0
+
+# Toolchain reference: docs.nvidia.com: "Jetson Linux Driver Package Toolchain"
+BR2_TOOLCHAIN_BUILDROOT=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+BR2_TOOLCHAIN_BUILDROOT_LOCALE=y
+BR2_BINUTILS_VERSION_2_32_X=y
+BR2_GCC_VERSION_7_X=y
+BR2_GCC_ENABLE_LTO=n

Same as for jetson-tx2.

Best regards,
Romain

Quoted 49 lines
configs/jetsonnano_defconfig new file +48 -0
+BR2_USE_MMU=y
+
+BR2_SYSTEM_DHCP="eth0"
+
+# Linux headers same as kernel, a 4.9 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
+BR2_KERNEL_HEADERS_AS_KERNEL=y
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+# patches-l4t-r32.4
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,madisongh,linux-tegra-4.9,0be1a57448010ae60505acf4e2153638455cee7c)/linux-tegra-4.9.140-r1.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="tegra"
+
+# Build the DTB from the kernel sources
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="_ddot_/_ddot_/_ddot_/_ddot_/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-a02 _ddot_/_ddot_/_ddot_/_ddot_/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00"
+
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+
+BR2_PACKAGE_LINUX4TEGRA=y
+BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T210REF=y
+
+# TODO: NVIDIA_CONTAINER_TOOLKIT requires a go-module integration.
+# BR2_PACKAGE_NVIDIA_CONTAINER_TOOLKIT=y
+
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y
+
+# Required tools to create the image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_JQ=y
+BR2_PACKAGE_HOST_PARTED=y
+
+# Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="1024M"
+# BR2_TARGET_ROOTFS_TAR is not set
+
+# Uboot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="p3450-porg"
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,paralin,u-boot-tegra,45dfa3dff43f880243a9fe68f3d911e99a240654)/u-boot-tegra-l4t-r32.4.2-v2016.07.tar.gz"
+BR2_TARGET_UBOOT_FORMAT_DTB_BIN=y
+BR2_TARGET_UBOOT_NEEDS_DTC=y
#25 lore raw

PATCH v4 5/5 board: add nvidia jetson nano support

Hi Romain,

On Sat, Nov 21, 2020 at 3:03 AM Romain Naour <[email protected]> wrote:

[snip]

Quoted 9 lines

board/jetson/nano/format-sd.sh line 124

Quoted 6 lines
board/jetson/nano/format-sd.sh new file +6 -0
+
+# prefer root partprobe
+PARTPROBE=partprobe
+if [ -f /usr/sbin/partprobe ]; then
+    PARTPROBE=/usr/sbin/partprobe
+fi

This requires partprobe installed on the build machine. partprobe is available in HOST_DIR (see HOST_DIR/sbin/partprobe)

I'll fix this for the next revision - but - actually the reason why this is in here, is because the buildroot-produced partprobe was segfaulting on two of my machines.

Best,
Christian

#26 lore raw

PATCH v4 5/5 board: add nvidia jetson nano support

Hello Christian,

Le 21/11/2020 ? 22:01, Christian Stewart a ?crit?:

Quoted 16 lines

Hi Romain,

On Sat, Nov 21, 2020 at 3:03 AM Romain Naour <[email protected]> wrote:

[snip]

Quoted 9 lines

board/jetson/nano/format-sd.sh line 124

Quoted 6 lines
board/jetson/nano/format-sd.sh new file +6 -0
+
+# prefer root partprobe
+PARTPROBE=partprobe
+if [ -f /usr/sbin/partprobe ]; then
+    PARTPROBE=/usr/sbin/partprobe
+fi

This requires partprobe installed on the build machine. partprobe is available in HOST_DIR (see HOST_DIR/sbin/partprobe)

Quoted 3 lines

I'll fix this for the next revision - but - actually the reason why this is in here, is because the buildroot-produced partprobe was segfaulting on two of my machines.

partprobe built by Buildroot must work on any host. Can you give some details about this issue ? (Linux distro etc) Can you share the log ?

Best regards,
Romain

Quoted 4 lines

Best,
Christian

#27 lore raw

PATCH v4 1/5 package/nvidia-modprobe: new package

In reply to Christian Stewart

Hello Christian,

Le 19/11/2020 ? 08:53, Christian Stewart a ?crit?:

Quoted 34 lines

nvidia-modprobe package adds a utility and headers for probing the NVIDIA hardware at runtime.

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

---
 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
package/Config.in +1 -0
index 016a99ed1a..fa1b5d35e9 100644
@@ -502,6 +502,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/nvme/Config.in"
 	source "package/ofono/Config.in"
 	source "package/on2-8170-modules/Config.in"
package/nvidia-modprobe/Config.in new file +0 -0
new file mode 100644
index 0000000000..35953a33d4

package/nvidia-modprobe/Config.in line 3

Quoted 3 lines
package/nvidia-modprobe/Config.in new file +3 -0
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_NVIDIA_MODPROBE
+	bool "nvidia-modprobe"
+	depends on BR2_TOOLCHAIN_HAS_THREADS

glibc toolchains already select BR2_TOOLCHAIN_HAS_THREADS.

Quoted 24 lines
package/nvidia-modprobe/Config.in new file +9 -0
+	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
package/nvidia-modprobe/nvidia-modprobe.hash new file +3 -0
new file mode 100644
index 0000000000..99908680f0
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 396b4102d3075a2dee3024652fae206a1b38ace54b8efb1e2c20757a11ec19f1  nvidia-modprobe-450.57.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
package/nvidia-modprobe/nvidia-modprobe.mk new file +0 -0
new file mode 100644
index 0000000000..7eeee6716c

package/nvidia-modprobe/nvidia-modprobe.mk line 9

Quoted 9 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +9 -0
@@ -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

The license should use identifier like GPL-2.0 or GPL-2.0+. Here it should be GPL-2.0.

package/nvidia-modprobe/nvidia-modprobe.mk line 12

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_LICENSE_FILES = COPYING
+
+NVIDIA_MODPROBE_DEPENDENCIES = host-pkgconf

Why ? the binary is build by using gcc directly without any build system.

package/nvidia-modprobe/nvidia-modprobe.mk line 25

Quoted 13 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +13 -0
+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

There is a Makefile why not using it ?
Ok it want to install the man pages but it should be easy to fix it.

package/nvidia-modprobe/nvidia-modprobe.mk line 38

Quoted 13 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +13 -0
+
+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

Same, we really don't want to maintain the gcc command line and the list of installed files. The Makefile must do it for us :)

package/nvidia-modprobe/nvidia-modprobe.mk line 43

Quoted 5 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +5 -0
+
+define NVIDIA_MODPROBE_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 $(@D)/bin/nvidia-modprobe \
+		$(TARGET_DIR)/usr/bin/nvidia-modprobe
+endef

Same.

Best regards,
Romain

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +2 -0
+
+$(eval $(generic-package))
#28 lore raw

PATCH v4 1/5 package/nvidia-modprobe: new package

Hi Romain,

On Sat, Nov 21, 2020 at 2:19 AM Romain Naour <[email protected]> wrote:

[snip]

Quoted 6 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 9

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_VERSION = 450.57
+NVIDIA_MODPROBE_SITE = $(call github,NVIDIA,nvidia-modprobe,$(NVIDIA_MODPROBE_VERSION))
+NVIDIA_MODPROBE_LICENSE = GPL-2

The license should use identifier like GPL-2.0 or GPL-2.0+. Here it should be GPL-2.0.

Ok, noted.

Quoted 5 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 12

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_LICENSE_FILES = COPYING
+
+NVIDIA_MODPROBE_DEPENDENCIES = host-pkgconf

Why ? the binary is build by using gcc directly without any build system.

At one point I had errors about pkgconf, so I added the dependency. Will try building it without the dependency and see if it works.

Quoted 8 lines
Quoted 8 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +8 -0
+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\" \
Quoted 8 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 25

Quoted 5 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +5 -0
+             -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

There is a Makefile why not using it ?
Ok it want to install the man pages but it should be easy to fix it.

The makefile was not working correctly and doing a lot of extra stuff we don't need.

Why is storing the simplified build commands in the makefile via a patch more clear / easy to maintain than directly in the Buildroot makefiles?

If necessary, I will re-format this into the makefile via a patch for the next revision. But this definitely works fine as-is and we are unlikely to need a more complicated build script for this package in the future.

Quoted 7 lines
Quoted 7 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +7 -0
+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
Quoted 8 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 38

Quoted 5 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +5 -0
+     $(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

Same, we really don't want to maintain the gcc command line and the list of installed files. The Makefile must do it for us :)

Why? The list won't change. How is storing it in a patch file easier to maintain than in this makefile?

Quoted 7 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 43

Quoted 5 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +5 -0
+
+define NVIDIA_MODPROBE_INSTALL_TARGET_CMDS
+     $(INSTALL) -m 0755 $(@D)/bin/nvidia-modprobe \
+             $(TARGET_DIR)/usr/bin/nvidia-modprobe
+endef

Same.

??

Best,
Christian

#29 lore raw

PATCH v4 1/5 package/nvidia-modprobe: new package

Hello Christian,

Le 21/11/2020 ? 21:32, Christian Stewart a ?crit?:

Quoted 15 lines

Hi Romain,

On Sat, Nov 21, 2020 at 2:19 AM Romain Naour <[email protected]> wrote:

[snip]

Quoted 6 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 9

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_VERSION = 450.57
+NVIDIA_MODPROBE_SITE = $(call github,NVIDIA,nvidia-modprobe,$(NVIDIA_MODPROBE_VERSION))
+NVIDIA_MODPROBE_LICENSE = GPL-2

The license should use identifier like GPL-2.0 or GPL-2.0+. Here it should be GPL-2.0.

Ok, noted.

Quoted 8 lines
Quoted 5 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 12

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_LICENSE_FILES = COPYING
+
+NVIDIA_MODPROBE_DEPENDENCIES = host-pkgconf

Why ? the binary is build by using gcc directly without any build system.

At one point I had errors about pkgconf, so I added the dependency. Will try building it without the dependency and see if it works.

I tried without host-pkgconf and nvidia-modprobe build.

Quoted 21 lines
Quoted 17 lines
Quoted 4 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_INSTALL_STAGING = YES
+
+define NVIDIA_MODPROBE_BUILD_CMDS

package/nvidia-modprobe/nvidia-modprobe.mk line 25

Quoted 10 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +10 -0
+     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

There is a Makefile why not using it ?
Ok it want to install the man pages but it should be easy to fix it.

The makefile was not working correctly and doing a lot of extra stuff we don't need.

Quoted 8 lines

Why is storing the simplified build commands in the makefile via a patch more clear / easy to maintain than directly in the Buildroot makefiles?

If necessary, I will re-format this into the makefile via a patch for the next revision. But this definitely works fine as-is and we are unlikely to need a more complicated build script for this package in the future.

It was not clear why you don't use the Makefile provided by Nvidia. Indeed the build is ok as is but we should use the Makefile provided by the package if possible. I'm ok to keep as is if the Makefile provided by Nvidia doesn't work with Buildroot.

Note: there are some examples of packages installing a Makefile instead of calling gcc from package.mk:

$ find package/ -name Makefile
package/ramsmp/Makefile
package/dhrystone/Makefile
package/ramspeed/Makefile

For simple program like fan-ctrl there is no Makefile:
package/fan-ctrl/fan-ctrl.mk

Quoted 17 lines
Quoted 16 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 38

Quoted 13 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +12 -0
+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

Same, we really don't want to maintain the gcc command line and the list of installed files. The Makefile must do it for us :)

Quoted 2 lines

Why? The list won't change. How is storing it in a patch file easier to maintain than in this makefile?

How do you know that this list won't change when the package will be updated to a newer version ?

Usually we prefer using:
make -C $(@D) DEST_DIR=$(STAGING_DIR) install

Quoted 10 lines
Quoted 8 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 43

Quoted 6 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +5 -0
+
+define NVIDIA_MODPROBE_INSTALL_TARGET_CMDS
+     $(INSTALL) -m 0755 $(@D)/bin/nvidia-modprobe \
+             $(TARGET_DIR)/usr/bin/nvidia-modprobe
+endef

Same.

??

Usually we prefer using:
make -C $(@D) DEST_DIR=$(TARGET_DIR) install

The headers installed are removed by Buildroot during target-finalize.

Best regards,
Romain

Quoted 4 lines

Best,
Christian

#30 lore raw

PATCH v4 1/5 package/nvidia-modprobe: new package

Quoted 24 lines · Romain Naour

Hello Christian,

Le 21/11/2020 ? 21:32, Christian Stewart a ?crit?:

Quoted 21 lines

Hi Romain,

On Sat, Nov 21, 2020 at 2:19 AM Romain Naour <[email protected]> wrote:

[snip]

Quoted 6 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 9

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_VERSION = 450.57
+NVIDIA_MODPROBE_SITE = $(call github,NVIDIA,nvidia-modprobe,$(NVIDIA_MODPROBE_VERSION))
+NVIDIA_MODPROBE_LICENSE = GPL-2

The license should use identifier like GPL-2.0 or GPL-2.0+. Here it should be GPL-2.0.

Ok, noted.

Quoted 5 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 12

Quoted 3 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_LICENSE_FILES = COPYING
+
+NVIDIA_MODPROBE_DEPENDENCIES = host-pkgconf

Why ? the binary is build by using gcc directly without any build system.

Quoted 25 lines
Quoted 2 lines

At one point I had errors about pkgconf, so I added the dependency. Will try building it without the dependency and see if it works.

I tried without host-pkgconf and nvidia-modprobe build.

Quoted 20 lines
Quoted 17 lines
Quoted 4 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +3 -0
+NVIDIA_MODPROBE_INSTALL_STAGING = YES
+
+define NVIDIA_MODPROBE_BUILD_CMDS

package/nvidia-modprobe/nvidia-modprobe.mk line 25

Quoted 10 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +10 -0
+     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

There is a Makefile why not using it ?
Ok it want to install the man pages but it should be easy to fix it.

The makefile was not working correctly and doing a lot of extra stuff we don't need.

I double-checked, and indeed it's not working correctly. But actually, only
because it tries to generate the manpages with a program compiled for the target. It's easily solved with

Quoted 3 lines
Quoted 3 lines

Why is storing the simplified build commands in the makefile via a patch more clear / easy to maintain than directly in the Buildroot makefiles?

As indicated by Romain, it's more maintainable to reuse the existing Makefile
than having to update the source file list when it changes.

That said, if the Makefile needs to be patched, and the patch is not
upstreamable, then it's OK to explicitly have the build command in the Buildroot .mk file.

Quoted 14 lines
Quoted 5 lines

If necessary, I will re-format this into the makefile via a patch for the next revision. But this definitely works fine as-is and we are unlikely to need a more complicated build script for this package in the future.

It was not clear why you don't use the Makefile provided by Nvidia. Indeed the build is ok as is but we should use the Makefile provided by the package if possible. I'm ok to keep as is if the Makefile provided by Nvidia doesn't work with Buildroot.

Note: there are some examples of packages installing a Makefile instead of calling gcc from package.mk:

Quoted 7 lines
$ find package/ -name Makefile
package/ramsmp/Makefile
package/dhrystone/Makefile
package/ramspeed/Makefile

For simple program like fan-ctrl there is no Makefile:
package/fan-ctrl/fan-ctrl.mk

I don't think for this one a separate Makefile is warranted.

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 37

Quoted 13 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +11 -0
+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

Why do you install these to staging? There is no library installed to staging,
and the upstream Makefile also doesn't install these, so they would seem to be internal headers...

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

+endef

Same, we really don't want to maintain the gcc command line and the list of installed files. The Makefile must do it for us :)

Quoted 8 lines
Quoted 2 lines

Why? The list won't change. How is storing it in a patch file easier to maintain than in this makefile?

How do you know that this list won't change when the package will be updated to a newer version ?

Usually we prefer using:
make -C $(@D) DEST_DIR=$(STAGING_DIR) install

That one definitely won't work because it also installs man pages which can't
be generated, and it tries to strip the binary with the wrong strip program.

Regards,
Arnout

Quoted 29 lines
Quoted 9 lines
Quoted 7 lines

package/nvidia-modprobe/nvidia-modprobe.mk line 43

Quoted 5 lines
package/nvidia-modprobe/nvidia-modprobe.mk new file +5 -0
+
+define NVIDIA_MODPROBE_INSTALL_TARGET_CMDS
+     $(INSTALL) -m 0755 $(@D)/bin/nvidia-modprobe \
+             $(TARGET_DIR)/usr/bin/nvidia-modprobe
+endef

Same.

??

Usually we prefer using:
make -C $(@D) DEST_DIR=$(TARGET_DIR) install

The headers installed are removed by Buildroot during target-finalize.

Best regards,
Romain

Quoted 4 lines

Best,
Christian

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#31 lore raw

PATCH v4 1/5 package/nvidia-modprobe: new package

In reply to Christian Stewart
Quoted 6 lines · Christian Stewart

nvidia-modprobe package adds a utility and headers for probing the NVIDIA hardware at runtime.

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

In the end, I applied to master but with many changes:

[Arnout:
- use upstream Makefile instead of building directly;
- don't install to staging;
- remove dependency on host-pkgconf;
- correct license to GPL-2.0;
- remove dependency on threads and glibc;
- add dependency on MMU.]

Could you re-test what was applied to master, and send a follow-up that fixes
it if I made a mistake?

Regards,
Arnout

Quoted 101 lines
---
 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
package/Config.in +1 -0
index 016a99ed1a..fa1b5d35e9 100644
@@ -502,6 +502,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/nvme/Config.in"
 	source "package/ofono/Config.in"
 	source "package/on2-8170-modules/Config.in"
package/nvidia-modprobe/Config.in new file +12 -0
new file mode 100644
index 0000000000..35953a33d4
@@ -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
package/nvidia-modprobe/nvidia-modprobe.hash new file +3 -0
new file mode 100644
index 0000000000..99908680f0
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 396b4102d3075a2dee3024652fae206a1b38ace54b8efb1e2c20757a11ec19f1  nvidia-modprobe-450.57.tar.gz
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
package/nvidia-modprobe/nvidia-modprobe.mk new file +45 -0
new file mode 100644
index 0000000000..7eeee6716c
@@ -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))