NVIDIA Build-FS Architecture

NVIDIA Build-FS tool is a Python program that takes in a json CONFIG file as input and outputs an ext4 filesystem image.

NVIDIA Build-FS parses the input CONFIG file 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 implementation varies depending on the OS.

OS

Linux

pre-build

  1. Setup binfmts for executing different arch binaries.
  2. Extract base filesystem.
  3. Update Mirrors in the target filesystem with values provided in the input CONFIG.
  4. Update resolv.conf of target filesystem with host's resolv.conf.
  5. Run preinstall scripts.

build

  1. Generate comprehensive list of Debian packages to be installed.
  2. Install Debian packages using package manager (apt).
  3. Create users/groups and update user memberships.
  4. Edit Hostname of the generated filesystem image.
  5. Execute CopyTarget scripts.

post-build

  1. Restore target filesystem mirrors to original in the target filesystem.
  2. Restore target filesystem resolv.conf to original in target filesystem.
  3. Run postinstall scripts.
  4. Generate MANIFEST.
  5. Copy MANIFEST into the target filesystem for reference

process-output

Create chosen target filesystems outputs:

  1. Create ext4 filesystem image
  2. Create tarball (compressed archive) of the filesystem.

All Build-FS 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.