CopyTarget File Operations#

CopyTarget supports a limited number of file operations and to have CopyTarget execute a particular operation, a combination of file attributes must be specified. Any invalid combination is raised as an error by CopyTarget and an error message with a pointer to the offending file attribute is presented to the user to resolve.

The following sections describe each of the valid operations and the required attributes to trigger the operation.

Copy#

Copy file from **${** NV_WORKSPACE**}/libraries/lib_nvidia.so** to **${TARGET_DIRECTORY}/usr/lib/lib_nvidia.so** with **ownership** **root:root** and **permission 0777;**where ${TARGET_DIRECTORY}is the target directory provided to CopyTarget, pdk_sdk_installed_path is the source type, and ${NV_WORKSPACE} is the workspace directory provided to CopyTarget.

Attribute

Requirement

Example

destination

Required.

/usr/lib/lib_nvidia.so

source

Required (unless an imported manifest already defines it).

pdk_sdk_installed_path: libraries/lib_nvidia.so

perm

Required (unless an imported manifest already defines it).

0777

owner

Required (unless an imported manifest already defines it).

root

group

Required (unless an imported manifest already defines it).

root

create_symlink

Can be absent (default is false) or must be set to false.

false

remove

Can be absent (default is false) or must be set to false.

false

Create Directory#

Create directory at ${TARGET_DIRECTORY}/ usr /lib/ nvidia with ownership root:root and permission 0777; where ${TARGET_DIRECTORY} is the target directory provided to CopyTarget.

Attribute

Requirement

Examples

destination

Required (must end with a trailing slash; otherwise, an error is reported).

/usr/lib/nvidia/

source

Must be absent.

perm

Required (unless an imported manifest already defines it).

0777

owner

Required (unless an imported manifest already defines it).

root

group

Required (unless an imported manifest already defines it).

root

create_symlink

Can be absent (default is false) or must be set to false.

false

remove

Can be absent (default is false) or must be set to false.

false

Update File Metadata#

Set file ${TARGET_DIRECTORY}/usr/lib/lib_nvidia.so with ownership nvidia:nvidia and permission 0644 ; where ${TARGET_DIRECTORY} is the target directory provided to CopyTarget.

Attribute

Requirement

Example

destination

Required.

/usr/lib/lib_nvidia.so

source

Must be absent.

perm

Required (unless an imported manifest already defines it).

0644

owner

Required (unless an imported manifest already defines it).

nvidia

group

Required (unless an imported manifest already defines it).

nvidia

create_symlink

Can be absent (default is false) or must be set to false.

false

remove

Can be absent (default is false) or must be set to false.

false

Update Directory Metadata#

Set directory ${TARGET_DIRECTORY}/ usr /lib/ nvidia with ownership nvidia:nvidia and permission 0644; where ${TARGET_DIRECTORY} is the target directory provided to CopyTarget.

Note

This operation is not recursive and only updates the metadata of ${TARGET_DIRECTORY}/usr/lib/nvidia/.

Attribute

Requirement

Example

destination

Required.

/usr/lib/nvidia/

source

Must be absent.

perm

Required (unless an imported manifest already defines it).

0644

owner

Required (unless an imported manifest already defines it).

nvidia

group

Required (unless an imported manifest already defines it).

nvidia

create_symlink

Can be absent (default is false) or must be set to false.

false

remove

Can be absent (default is false) or must be set to false.

false

Remove a File#

Remove file ${TARGET_DIRECTORY}/ usr /lib/lib_nvidia.so; where ${TARGET_DIRECTORY} is the target directory provided to CopyTarget.

Attribute

Requirement

Example

destination

Required.

/usr/lib/lib_nvidia.so

source

Should be absent.

perm

Should be absent (if specified, is ignored).

owner

Should be absent (if specified, is ignored).

group

Should be absent (if specified, is ignored).

create_symlink

Should be absent (default is false) or must be set to false.

Setting this to true causes an error to be thrown.

false

remove

Must be set to true. (unless an imported manifest already defines it).

true

Remove Empty Directory#

Remove empty directory ${TARGET_DIRECTORY}/ usr /lib/ nvidia / ; where ${TARGET_DIRECTORY} is the target directory provided to CopyTarget.

Attribute

Requirement

Example

destination

Required.

/usr/lib/nvidia/

source

Should be absent.

perm

Should be absent (if specified, is ignored).

owner

Should be absent (if specified, is ignored).

group

Should be absent (if specified, is ignored).

create_symlink

Must be set to false (unless an imported manifest already defines it).

Setting this to true causes an error to be thrown.

false

remove

Must be set to true (unless an imported manifest already defines it).

true