NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux SDK

Developer Guide
5.1.15 Release


 
NVIDIA Build-Kit
 
Installing NVIDIA Build-Kit
Editing NVIDIA Build-Kit CONFIG
Executing NVIDIA Build-Kit Wwith the Updated CONFIG
Flashing the Customized Target Filesystem
NVIDIA Build-Kit Architecture
Command Line Arguments
Environment Configuration
CONFIG Semantics
Errors
Examples
NVIDIA Build-Kit is a tool for creating and customizing Linux filesystems. It is a common filesystem interface tool for automotive programs. NVIDIA Build-Kit:
Supports target filesystem image and tarball (uncompressed archive).
Supports upstream mirrors.
Supports target filesystem users, groups and memberships.
Supports pre/post install scripts.
Generates the manifest file.
Prerequisites
Refer to requirements specified in the SDK Manager System Requirements.
Installing NVIDIA Build-Kit
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.
1. Download nvidia-driveos-<release>-build-kit.deb.
2. Install Debian package nvidia-driveos-<release>-build-kit.deb using the apt package manager.
3. NVIDIA Build-Kit is installed to /opt/nvidia/driveos/5.1.15.0/filesystems/build-kit/.
The following example is a walkthrough to install NVIDIA Build-Kit from a BASH terminal.
# Change directory to the location where nvidia-driveos-5.1.15.0-build-kit.deb has been downloaded to. In this example, the Debian has been downloaded to ~/Downloads/.
nvidia@nvidia:~$ cd ~/Downloads/
# Install NVIDIA Build-Kit.
nvidia@nvidia:~/Downloads/$ sudo apt install ./nvidia-driveos-5.1.15.0-build-kit.deb
# Verify NVIDIA Build-Kit has been installed successfully using the --version command argument. The version reported should match that which has been installed; in this example, NVIDIA Build-Kit version 9 has been installed.
nvidia@nvidia:~/Downloads/$ /opt/nvidia/driveos/5.1.15.0/filesystems/build-kit/bin/build_kit.py --version
Build-Kit Version: 9
Editing NVIDIA Build-Kit CONFIG
NVIDIA Build-Kit does not come with any predefined CONFIG or MANIFEST. Any predefined MANIFEST and the associated user CONFIG are downloaded and installed as part of NVIDIA DRIVE OS.
NVIDIA Build-Kit does come with a default basic CONFIG template you can build upon. The default CONFIG template has nothing defined and produces no result when executed with NVIDIA Build-Kit, but acts as a starting point for you to learn.
The default CONFIG template is located within the configs/ directory of the installation location of NVIDIA Build-Kit, which is usually located at /opt/nvidia/driveos/<release>/filesystems/build-kit/configs/. Within the directory, you can find the default CONFIG template, nvidia-driveos-build-kit-user-rfs.CONFIG.json.
This example walkthrough edits the default CONFIG template; however, if you wish, you may use your own or one of the NVIDIA DRIVE OS manifests or configurations for customization. This simple example installs the Debian vim, but any other Debian can be used. Open a BASH terminal and issue the following commands:
# Edit default CONFIG template using an editor of your choice, we chose vim for simplicity.
nvidia@nvidia:~$ vim /opt/nvidia/driveos/5.1.15.0/filesystems/build-kit/configs/nvidia-driveos-build-kit-user-rfs.CONFIG.json
# Once the file has been open for edit, update the section "DebianPackages" and add the entry "vim" as shown.
"DebianPackages":
[
"vim"
]
# Also update the section Mirrors as shown below, with the Ubuntu mirror from which "vim" Debian package can be obtained.
"Mirrors":
[
"deb http://ports.ubuntu.com/ubuntu-ports/ bionic main universe restricted"
]
# Once the changes have been made, commit your changes by saving the file.
# If you wish to have other changes, refer to section "NVIDIA Build-Kit CONFIG Semantics" for additional details of NVIDIA Build-Kit CONFIG semantics.
You have edited your first NVIDIA Build-Kit CONFIG successfully. The following sections describe how to generate an image and flash your image to the target platform.
Executing NVIDIA Build-Kit Wwith the Updated CONFIG
You can invoke NVIDIA Build-Kit to produce a filesystem image. Continuing from the example in the previous section, in the existing or newly opened BASH terminal, execute the following walkthrough commands:
sudo /opt/nvidia/driveos/5.1.15.0/filesystems/build-kit/bin/build_kit.py -w ~/driveos/ -i /opt/nvidia/driveos/5.1.15.0/filesystems/build-kit/configs/nvidia-driveos-build-kit-user-rfs.CONFIG.json -o output/
Note: In this example, NVIDIA DRIVE OS is installed to ~/driveos/; if NVIDIA DRIVE OS is installed to another directory, ensure that NVIDIA Build-Kit is pointed to the appropriate workspace location.
A filesystem image named nvidia-driveos-build-kit-rfs-user.img (the default name specified in the default CONFIG template, but you can change the name) is generated under the output/ directory. The filesystem image can be deployed and used to flash onto the target platform.
Flashing the Customized Target Filesystem
1. Update the symlink of drive-t186ref-linux/targetfs.img to point to your customized target filesystem image.
2. Enable image flashing. See use_rootfs_img instructions.
3. Flash the target. See the Flashing.
nvidia@nvidia:~$ sudo mkdir -p ${PDK_INSTALL_DIR}/drive-t186ref-linux/targetfs-images/
nvidia@nvidia:~$ sudo mv output/nvidia-driveos-build-kit-rfs-user.img ${PDK_INSTALL_DIR}/drive-t186ref-linux/targetfs-images/
nvidia@nvidia:~$ sudo rm -f ${PDK_INSTALL_DIR}/drive-t186ref-linux/targetfs.img
nvidia@nvidia:~$ sudo ln -sf targetfs-images/nvidia-driveos-build-kit-rfs-user.img ${PDK_INSTALL_DIR}/drive-t186ref-linux/targetfs.img
# Where PDK_INSTALL_DIR, is the DRIVE OS Installation Directory.
NVIDIA Build-Kit Architecture
NVIDIA Build-Kit tool is a Python program that takes in a json CONFIG file as input and outputs a filesystem image.
NVIDIA Build-Kit parses an input CONFIG file of type JSON, to determine the target OS desired and initializes OS specific class objects to process the filesystem creation process.
The filesystem creation process contains four stages, which are:
Pre-build
Build
Post-build
Process-output
These stages are present for all supported operating systems, but the commands vary depending on the OS.
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.
All Build-Kit helper scripts/temporary files used in the process of generating the filesystem image are stored under the /tmp/ directory of the target filesystem during its required lifetime, and are deleted before the final target filesystem image is created.
Command Line Arguments
These options are available when you execute build_kit.py.
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.
Environment Configuration
The /opt/nvidia/driveos/<release>/filesystems/build-kit/build-kit.config file controls the execution environment of NVIDIA Build-Kit.
It is a json file with fields:
common
Variables defined in this field are always present in the tool's execution environment.
linux
Variables defined in this field are defined if NVIDIA Build-Kit CONFIG has OS set to linux. For more information, see CONFIG semantics.
These sections define the environment variables required for proper functioning of the NVIDIA Build-Kit tool. The following variables must not be defined in the environment configuration file. These variables are unset in the program's environment if defined in the shell environment where Build-Kit is executed.
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.
The following table lists out available environment variables that can be used throughout NVIDIA Build-Kit and at which specific location. If a particular variable is not available for use, an indicator is marked in this table.
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
 
CONFIG Semantics
This section details the semantics of the attributes available in NVIDIA Build-Kit CONFIG.
Due to JSON parsing, the last value for a duplicated attribute is the one taken; any previously declared value is overwritten.
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.
Errors
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.
 
Examples
To add users, groups, and memberships to the filesystem
This example demonstrates how to:
1. Add user "nvidia2" with identifier "1001" and password "driveos".
2. Add group "automotive" with identifier "2001".
3. Assign membership between user "nvidia2" and group "automotive".
{
"Users":
{
"nvidia2": ["1001", "driveos"]
},
"Groups":
{
"automotive": "2001"
},
"Memberships":
{
"nvidia2":
[
"automotive"
]
}
}
To install Debian packages from Ubuntu mirrors
This example demonstrates how to install Debian packages “vim” and “nano” from Ubuntu mirror "deb http://ports.ubuntu.com/ubuntu-ports/ bionic main universe restricted".
{
"Mirrors":
[
"deb http://ports.ubuntu.com/ubuntu-ports/ bionic main universe restricted"
],
"DebianPackages":
[
"vim",
"nano"
]
}
To copy files to the target filesystem
This example demonstrates how to:
Copy file "nvidia.txt" from host to target filesystem using CopyTarget.
The source file "nvidia.txt" is placed under "${WORK_DIR}".
The destination of file "nvidia.txt" is to be placed at "/home/nvidia/nvidia.txt".
The CopyTarget MANIFEST is placed at "${WORK_DIR}".
{
"CopyTargets":
[
"${WORK_DIR}/copytarget-nvidia.yaml"
]
}
The CopyTarget file copytarget-nvidia.yaml is used in the example below:
version: '1.4'
fileList:
- destination: /home/nvidia/nvidia.txt
source: nvidia.txt
perm: 644
owner: root
group: root
To run preinstall and postinstall scripts
This example demonstrates how to:
Setup and teardown target filesystem's nameserver using PreInstall and PostInstall BASH scripts, "preinstall.sh" and "postinstall.sh", respectively.
The PreInstall file "preinstall.sh" is placed under "${WORK_DIR}".
The PostInstall file "postinstall.sh" is placed under "${WORK_DIR}".
{
"PreInstalls":
{
"${WORK_DIR}/preinstall.sh": "target_copy"
},
"PostInstalls": {
"${WORK_DIR}/postinstall.sh": "target_copy"
}
}
The preinstall.sh script is used in the example below:
#!/bin/sh
echo "nameserver.nvidia.com" >> /etc/resolv.conf
The postinstall.sh script is used in the example below:
#!/bin/sh
sed -i "s/nameserver.nvidia.com//g" /etc/resolv.conf