mirror of
				https://github.com/lingble/meta-tegra.git
				synced 2025-10-31 04:18:06 +00:00 
			
		
		
		
	 025838d593
			
		
	
	025838d593
	
	
	
		
			
			The list of files in the csf for v4l-utils does not match the list in /etc/nvidia-container-runtime/host-files-for-container.d/l4t.csv on a Jetpack 4.4 based stock NVIDIA image. This is problematic for the libv4l2rds libraries when attempting to install v4l-utils in a container. The install works fine if the container is running on an NVIDIA image, but when running on OE4T you see an error message: ``` unable to make backup link of './usr/lib/aarch64-linux-gnu/libv4l2rds.so.0.0.0' before installing new version: Invalid cross-device link ``` To avoid this, add support for removing container runtime files in the container-runtime-csv class using a glob pattern, and use this pattern to avoid placing libv4l2rds in the container runtime.
		
			
				
	
	
		
			71 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| CONTAINER_CSV_FILES ??= "${libdir}/*.so*"
 | |
| CONTAINER_CSV_EXCLUDE_FILES ??= ""
 | |
| CONTAINER_CSV_BASENAME ??= "${PN}"
 | |
| CONTAINER_CSV_PKGNAME ?= "${CONTAINER_CSV_BASENAME}-container-csv"
 | |
| CONTAINER_CSV_EXTRA ??= ""
 | |
| 
 | |
| python populate_container_csv() {
 | |
|     import os
 | |
|     import glob
 | |
|     globs = (d.getVar('CONTAINER_CSV_FILES') or '').split()
 | |
|     if len(globs) == 0:
 | |
|         return
 | |
|     root = d.getVar('D')
 | |
|     entries = set()
 | |
|     oldcwd = os.getcwd()
 | |
|     os.chdir(root)
 | |
|     for csvglob in globs:
 | |
|         if os.path.isabs(csvglob):
 | |
|             csvglob = '.' + csvglob
 | |
|         if not csvglob.startswith('./'):
 | |
|             csvglob = './' + csvglob
 | |
|         globbed = glob.glob(csvglob)
 | |
|         if globbed and globbed != [ csvglob ]:
 | |
|             entries.update([entry[2:] for entry in globbed])
 | |
|         else:
 | |
|             entries.update([csvglob[2:]])
 | |
|     excludeglobs = (d.getVar('CONTAINER_CSV_EXCLUDE_FILES') or '').split()
 | |
|     for csvglob in excludeglobs:
 | |
|         if os.path.isabs(csvglob):
 | |
|             csvglob = '.' + csvglob
 | |
|         if not csvglob.startswith('./'):
 | |
|             csvglob = './' + csvglob
 | |
|         globbed = glob.glob(csvglob)
 | |
|         if globbed and globbed != [ csvglob ]:
 | |
|             for entry in globbed:
 | |
|                 entries.discard(entry[2:])
 | |
|         else:
 | |
|             for entry in globbed:
 | |
|                 entries.discard(csvglob[2:])
 | |
|     csvlines = (d.getVar('CONTAINER_CSV_EXTRA') or '').split('\n')
 | |
|     for entry in entries:
 | |
|         if os.path.isdir(entry):
 | |
|             csvtype = "dir"
 | |
|         elif os.path.islink(entry):
 | |
|             csvtype = "sym"
 | |
|         elif os.path.isfile(entry):
 | |
|             csvtype = "lib"
 | |
|         else:
 | |
|             bb.warn("Unrecognized file type for container CSV: {}".format(entry))
 | |
|             continue
 | |
|         csvlines.append("{}, /{}".format(csvtype, entry))
 | |
| 
 | |
|     os.chdir(oldcwd)
 | |
|     csvfiledir = os.path.join(root, d.getVar('sysconfdir')[1:], 'nvidia-container-runtime',
 | |
|                               'host-files-for-container.d')
 | |
|     bb.utils.remove(csvfiledir, recurse=True)
 | |
|     bb.utils.mkdirhier(csvfiledir)
 | |
|     csvfile = os.path.join(csvfiledir, d.getVar('PN') + '.csv')
 | |
|     with open(csvfile, 'w', encoding='utf-8') as outf:
 | |
|         outf.write('\n'.join(sorted(csvlines)) + '\n')
 | |
|     os.chmod(csvfile, 0o644)
 | |
| }
 | |
| 
 | |
| CONTAINERCSVFUNC = ""
 | |
| CONTAINERCSVFUNC_tegra = "populate_container_csv"
 | |
| do_install[postfuncs] += "${CONTAINERCSVFUNC}"
 | |
| 
 | |
| PACKAGES_prepend_tegra = " ${CONTAINER_CSV_PKGNAME} "
 | |
| FILES_${CONTAINER_CSV_PKGNAME} = "${sysconfdir}/nvidia-container-runtime"
 | |
| RDEPENDS_${PN}_append_tegra = " ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${CONTAINER_CSV_PKGNAME}', '', d)}"
 |