NVIDIA DRIVE OS 5.1 Linux SDK Developer Guide 5.1.15 Release |
Note: | Prior to installing NVIDIA Build-Kit, ensure that NVIDIA DRIVE OS Linux SDK is installed on the system. A compatible version of NVIDIA DRIVE OS must be installed corresponding to the version of NVIDIA Build-Kit to be installed. |
Note: | Prior to installing NVIDIA Build-Kit, ensure that NVIDIA CopyTarget is installed on the system. A compatible version of NVIDIA CopyTarget must be installed corresponding to the version of NVIDIA Build-Kit to be installed. For installation instructions, see Installing CopyTarget. |
OS | pre-build | build | post-build | process-output |
Linux | Setup binfmts for executing different arch binaries. Extract base filesystem. Update Mirrors in the target filesystem with values provided in the CONFIG.json. Update resolv.conf of target filesystem with host's resolv.conf. Run preinstall scripts. | Generate comprehensive list of Debian packages to be installed. Generate MANIFEST. Install Debian packages using package manager (apt). Create users/groups and update user memberships. Execute CopyTarget scripts, if any. | Run postinstall scripts. Restore target filesystem mirrors to original in the target filesystem. Restore target filesystem resolv.conf to original in target filesystem. | Create chosen output target filesystems. Create ext4 filesystem image Create tarball of filesystem. |
Short Option | Long Option | Defaults | Required | Description |
-h | --help | N/A | No | Show help message and exit. |
-v | --version | N/A | No | Print version and exit. |
-i JSON_PATH | --input=JSON_PATH | No defaults | Yes | Specifies <JSON_PATH> as the absolute path to NVIDIA Build-Kit CONFIG file. |
-o OUTPUT_FOLDER | --output=OUTPUT_FOLDER | ${PWD} | No, but recommended. | Specifies <OUTPUT_FOLDER> as the absolute path to folder for output. |
-w | --nv-workspace=<NV_WORKSPACE> | - | No | Specifies <NV_WORKSPACE> as the absolute path to workspace location; this is the path to the location of NVIDIA DRIVE OS. |
--create-tar=<CREATE_TAR> | no | No | Specifies to create filesystem tarball compressed as BunZip2. | |
--create-image=<CREATE_IMAGE> | yes | No | Specifies to create ext4 filesystem image. | |
--copytarget-source-type=<COPYTARGET_SOURCE_TYPE> | Pdk_sdk_installed_path | No | Specifies the type of source path in the copytarget manifest, from which files must be copied to the target filesystem directory. For more information, see CopyTarget. |
Note: | Defaults are used if options aren't used in the NVIDIA Build-Kit command line. |
Forbidden Variables | Section | Value | Default | Use case |
REQUIRED_VARIABLES | all | Comma separated variable names | - | Checks if the variables names in value are defined, exits the tool if it isn't. |
QEMU_PATH | common, linux | Path to qemu-aarch64-static binary | /usr/bin/ | This variable controls the path to qemu-aarch64-static binary used for chrooting into the Linux filesystem. |
BUILD_KIT_DIR | all | Path to NVIDIA Build-Kit directory | /opt/nvidia/driveos/<RELEASE>/filesystems/build-kit | Helper scripts for installing packages inside chroot environment are copied from ${BUILD_KIT_DIR}/helpers Mirror setup scripts for setting up Nvidia repositories and downloading Nvidia Packages are copied from ${BUILD_KIT_DIR}/mirror-setup |
COPYTARGET | all | Path to Copytarget binary | /opt/nvidia/driveos/<RELEASE>/filesystems/copytarget/copytarget.py | This variable specifies the copytarget binary to be executed for processing copytarget yaml files. |
PYTHON3 | all | Path to python3 binary | /usr/bin/python3 | This variable specifies the python binary that should be used for invoking the copytarget.py tool. |
Variable | Description | PreInstall Scripts | PostInstall Scripts |
WORK_DIR | Assigned value of the path to NVIDIA Build-Kit's workspace. | Available | Available |
FILESYSTEM_WORK_DIR | Assigned value of the path to target filesystem directory located on host. | Available | Available |
Field | Values | Required | Default | Syntax | Description |
OS | enum[linux] | Yes | - | "OS" : "<OS>" | Specifies "linux" for generating Linux target filesystem image. |
Base | Valid UNIX dirpath/ Valid UNIX filepath If a file, the filename must have an extension .img, or .tar.bz2. | Yes | - | "Base" : "<filepath-to-base-filesystem>" | Specifies the path of the target filesystem to be used as input and to be built on top of. The file pointed to by this tag must either be: A folder A mountable image file with the extension .img in the filename A bzip compressed tar file with the extension .tar.bz2 in the filename The filename must have an extension of .img or .tar.bz2; and be properly encoded in the compatible format. This is important as NVIDIA Build-Kit refers to the extension to determine the type of object being referred to. |
Output | Valid UNIX filename without extension. | Yes | - | "Output" : "<filename-without-extension>" | |
PreInstalls | Key content: Valid UNIX filepath to a BASH script. Value type: String Value content: enum[host, target, target_copy] | No | None | "PreInstalls" : { "<Bash-Script-#1>": "<host, target, target_copy>" "<Bash-Script-#2>": "<host, target, target_copy>" ... "<Bash-Script-#n>": "<host, target, target_copy>" }, | Specifies a list of zero, one, or more BASH scripts to be executed on the host or virtualized target during the Pre-Build stage. For each array element, the value of the element specifies whether the specific script is to be executed on the host or virtualized target. A value of: "host" is the indicator to execute existing BASH script on the host. "target" is the indicator to execute existing BASH script on the virtualized target. "target_copy" is the indicator to - copy existing BASH script on the host to /tmp/ of the target filesystem. - execute the script in /tmp/ on the virtualized target. - remove the script in /tmp/ of the target filesystem. Host BASH scripts are useful for setting up mirrors or updating DNS servers. The BASH scripts listed are executed in the order specified. The error code returned by each BASH script is validated, and NVIDIA Build-Kit will terminate upon the first error and report a message for debugging. |
CopyTargets | Items type: String Items content: Valid UNIX filepaths to CopyTarget BASH scripts or MANIFESTS. or Items type: dict Items content: { "Manifest": "<path to copytarget yaml/script> (String)", (Required) "NvWorkspace": "<path from which files listed in copytarget are copied> (String)", (Optional) "SourceType": "<Copytarget source type> (String)", (Optional) "Args": { (Optional) "Add": "<args to be added from copytarget cmdline> (String)", (Optional) "Del": "<args to be deleted from copytarget cmdline> (Str)" (Optional) } } | No | None | "CopyTargets" : [ "<CopyTarget-MANIFEST-#1>", "<CopyTarget-MANIFEST-#2>", { "Manifest" : "<CopyTarget-MANIFEST-#3", "NvWorkspace": "<Overridden-Path>", "SourceType": "<Overridden-Source-Type>", "Args": { "Add": "Add/Update Default Args", "Del": "Delete from Default Args" } }, ... "<CopyTarget-MANIFEST-#n>", ] | Specifies a list of zero, one, or more CopyTarget to be executed on the host during Build stage. For more information, see CopyTarget. The list of CopyTarget are executed in the order specified. Note: If item type is dict, to not override certain fields, do not specify the field in the dict. |
PostInstalls | Key content: Valid UNIX filepath to a BASH script. Value type: String Value content: enum[host, target, target_copy] | No | None | "PostInstalls" : { "<Bash-Script-#1>": "<host, target, target_copy>" "<Bash-Script-#2>": "<host, target, target_copy>" ... "<Bash-Script-#n>": "<host, target, target_copy>" }, | Specifies a list of zero, one, or more BASH scripts to be executed on the host or virtualized target during the Post-Build stage. For each array element, the value of the element specifies whether the specific script is to be executed on the host or virtualized target. A value of: "host" is the indicator to execute existing BASH script on the host. "target" is the indicator to execute existing BASH script on the virtualized target. "target_copy" is the indicator to - copy existing BASH script on the host to /tmp/ of the target filesystem. - execute the script in /tmp/ on the virtualized target. - remove the script in /tmp/ of the target filesystem. The BASH scripts listed are executed in the order specified. The error code returned by each BASH script is validated, and NVIDIA Build-Kit will terminate upon the first error and report a message for debugging. |
FilesystemCleanup | Items type: String Items content: Valid UNIX filepaths | No | None | "FilesystemCleanup" : [ "<Target-File-#1>", "<Target-File-#2>", ... "<Target-File-#n>", ] | Specifies a list of zero, one, or more target files to be deleted as part of Post-Build stage. If a file is specified but could not be found, an error will be reported. |
ImageSize | 64-bit Unsigned Integer enclosed in double quotes. | No | 8589934592 | "ImageSize" : "<Target-Filesystem-Image-Size>" | The size of the partition to which the current image will be expanded to (defaults to 8GB). This is required for determining values Filesystem Metadata values like journal size, inode_size, inode_byte_ratio. This will help create the required number of inodes and journal in the smaller filesystem image generated, considering the image file expansion. |
FilesystemType | No | standard | "FilesystemType": "<FilesystemType>" | Specifies the type of filesystem to be created for the particular CONFIG. This option is forwarded to copytarget while executing the copytarget manifests, and instructs copytarget whether to copy the file, based on rules written inside the copytarget manifest. For more information, see CopyTarget. | |
Mirrors | Items type: String Items content: Valid Debian mirrors | No | None | "Mirrors" : [ <Debian-mirror-#1>, <Debian-mirror-#2>, ... <Debian-mirror-#n>, ] | Specifies zero, one, or more Debian mirrors hosting Debians specified in DebianPackages. Ensure these mirror values adhere to the package manager's syntax of mirrors. Ordering of Debian mirrors are preserved. |
Users | Key content: Valid UNIX username requirements Value type: Array with length=2 Value content: [UID(String), passwd(String)] Where UID must be a valid UNIX user identifier and password must be a valid UNIX password. | No | None | "Users" : { "<Username-#1>": ["<User-Identifier-#1>", "<Password-#1>"], "<Username-#2>": ["<User-Identifier-#2>", "<Password-#2>"], ... "<Username-#n>": ["<User-Identifier-#n>", "<Password-#n>"], } | Specifies a list of zero, one, or more users to be added to the target filesystem. Ensure usernames, user identifiers, and user passwords are valid UNIX standards. User identifier is recommended to be above 1000, and not conflicting with existing user identifiers; otherwise, conflicting user identifiers will be reported as an error. For each tuple in the JSON array, a user with the username defined in the key will be added to target filesystem and assigned a user identifier of the value in the first element of the tuple, while the user's password will be set as the value of second element of the tuple. Ordering of users to be added is preserved. |
Groups | Key content: Valid UNIX groupname Value type: String Value content: Valid UNIX group identifier | No | None | "Groups" : { "<Groupname-#1>": "<Group-Identifier-#1>", "<Groupname-#2>": "<Group-Identifier-#2>", ... "<Groupname-#n>": "<Group-Identifier-#n>", } | Specifies a list of zero, one, or more groups to be added to the target filesystem. Ensure groupnames and group identifiers are valid UNIX standards. Group identifier is recommended to be above 1000, and not conflicting with existing group identifiers; otherwise, conflicting user identifiers will be reported as an error. For each array element in the JSON array, a group with the groupname defined in the key will be added to target filesystem and assigned a group identifier of the value of the array element. Ordering of groups to be added is preserved. |
Memberships | Key content: valid UNIX username Value type: Array Value content: [ group1(String),...., groupN(String) ] Where group* must be a valid UNIX groupname or group identifier. | No | None | "Memberships" : { "<User-#1-name-or-identifier>": [ "<Group-#1-membership-group-name-or-identifier-#1>", "<Group-#1-membership-group-name-or-identifier-#2>", ... "<Group-#1-membership-group-name-or-identifier-#n>", ], "<User-#2-name-or-identifier>": [ "<Group-#2-membership-group-name-or-identifier-#1>", "<Group-#2-membership-group-name-or-identifier-#2>", ... "<Group-#2-membership-group-name-or-identifier-#n>", ], ... "<User-#n-name-or-identifier>": [ "<Group-#n-membership-group-name-or-identifier-#1>", "<Group-#n-membership-group-name-or-identifier-#2>", ... "<Group-#n-membership-group-name-or-identifier-#n>", ], } | Specifies a list of zero, one, or more group memberships to be added to the target filesystem. Ensure groupnames and group identifiers are valid UNIX standards. For each array element in the JSON array, a membership will be created between the group name or identifier as specified in the key to each of the group name(s) and/or identifier(s) in the list specified as the array element value. Ordering of memberships to be added is preserved. |
DebianPackages | Items type: String Items content: Valid Debian package names. | No | None | "DebianPackages" : [ "<Debian-Package-#1[=Debian-Package-#1-Version]>", "<Debian-Package-#2[=Debian-Package-#1-Version]>", ... "<Debian-Package-#n[=Debian-Package-#1-Version]>", ] | Specifies a list of zero, one, or more Debian packages to be installed on target filesystem during Build stage. Each Debian package can be accompanied by a valid corresponding package version but is entirely optional. If no package version is specified, the latest version as reported by the Debian mirror will be acquired and installed If the list of Debians and or the specified versions conflict, an error will be reported. |
Hostname | Valid UNIX hostname | No | None | "HostName": "<UNIX hostname>" | Host name of the target filesystem is updated to the one specified as the value for HostName. If HostName Field is not present in the CONFIG, the host name of the Base filesystem is preserved. |
Error | Variable values |
No value for NV_WORKSPACE provided with the -w option. | N/A |
NV_WORKSPACE: '<path>' doesn't exist. | path: Value provided after -w in Build-Kit command line. |
No CONFIG provided with the '-i' option. | N/A |
CONFIG file: '<json_file>' doesn't exist. | json_file: Value provided after -i in Build-Kit command line. |
<config_os> is not supported. | config_os: Value of "OS" tag in the Build-Kit CONFIG file. |
<variable> is not defined. | variable: Any required Build-Kit environment variable. |
Command returned non-zero error code: <cmd_string> | cmd_string: Command line used to execute binary outside Build-Kit python scripts. |
Unsupported execution location: '<run_target>'. Expecting a value from the list: [host, target, target_copy] | run_target: Runtime target configured for Pre-Install/ Post-Install scripts. |
Unknown Base file format: '<base>', Please provide Base in a Build-Kit supported format. | base: Value of "Base" tag in the Build-Kit CONFIG file. |
Required Field: '<field>' absent from input CONFIG file: '<config>'. | field: Field is one of the required fields of Build-Kit CONFIG. (See NVIDIA Build-Kit CONFIG Semantics for more information). config: Input CONFIG file provided to Build-Kit. |
<field>: Value is not a string in the input CONFIG file: '<config>'. | field: Field is one of the required fields of Build-Kit CONFIG. (See NVIDIA Build-Kit CONFIG Semantics for more information). config: Input CONFIG file provided to Build-Kit. |
<field>: Value is not a list in the input CONFIG file: '<config> | field: Field is one of the required fields of Build-Kit CONFIG. (See NVIDIA Build-Kit CONFIG Semantics for more information). config: Input CONFIG file provided to Build-Kit. |
<field>: Value is not a dict in the input CONFIG file: '<config> | field: Field is one of the required fields of Build-Kit CONFIG. (See NVIDIA Build-Kit CONFIG Semantics for more information). config: Input CONFIG file provided to Build-Kit. |
FileNotFoundError: [Errno 2] No such file or directory: '<file>' | file: Missing file in the host system where Build-Kit is running. |
Usage: build_kit.py [options] build_kit.py: error: no such option: <incorrect_option> | incorrect_option: Incorrect option provided in Build-Kit command line |
Usage: build_kit.py [options] build_kit.py: error: option --create-tar: invalid choice: '<val>' (choose from 'yes', 'no') | val: Value provided to --create-tar option. |
Usage: build_kit.py [options] build_kit.py: error: option --create-image: invalid choice: '<val>' (choose from 'yes', 'no') | val: Value provided to --create-image option. |