Creating a custom manifest¶
Create a custom Automotive Image Builder manifest file to build an AutoSD OS image. Use your manifest file to define the components and functionality of your image. A manifest file can be as simple as the following minimal manifest example:
name: minimal
content:
rpms: []
# Set a password so that you can log in to the system. Setting a
# password is not necessary to build the minimal image, but you
# cannot log in without configuring a password.
auth:
# "password"
root_password: $6$xoLqEUz0cGGJRx01$H3H/bFm0myJPULNMtbSsOFd/2BnHqHkMD92Sfxd.EKM9hXTWSmELG8cf205l6dktomuTcgKGGtGDgtvHVXSWU.
Copying files from the host into the image at build time¶
You can copy files from your host machine into the image during the build process. While several methods exist depending on your toolchain, using a simple custom manifest with the Automotive Image Builder (AIB) is the most direct and recommended approach.
To include artifacts or configurations in your build, use the source_path parameter within your manifest’s add_files section.
Be aware that source_path handles relative and absolute paths in specific ways.
Relative path¶
By default, source_path uses a relative path based on the directory that contains the manifest file.
Use this setup when you store build artifacts alongside the manifest.
Example:
If your manifest is at /home/user/<my-project>/simple-minimal.aib.yml and you want to include
/home/user/<my-project>/files/<my-file.md>, define your manifest like this:
content:
rpms: []
add_files:
- path: /usr/local/bin/<my-file.md>
source_path: /files/<my-file.md>
auth:
# "password"
root_password: $6$xoLqEUz0cGGJRx01$H3H/bFm0myJPULNMtbSsOFd/2BnHqHkMD92Sfxd.EKM9hXTWSmELG8cf205l6dktomuTcgKGGtGDgtvHVXSWU.
Absolute paths¶
If the files you want to include are stored outside the manifest’s directory, use an absolute path.
Begin the path with // so that source_path recognizes it as absolute.
Example:
To include a file from /home/user/<my-project>/files/<my-file.md>, your manifest would look like this:
content:
rpms: []
add_files:
- path: /usr/local/bin/<my-file.md>
source_path: //home/user/files/<my-file.md>
auth:
# "password"
root_password: $6$xoLqEUz0cGGJRx01$H3H/bFm0myJPULNMtbSsOFd/2BnHqHkMD92Sfxd.EKM9hXTWSmELG8cf205l6dktomuTcgKGGtGDgtvHVXSWU.
Sideloading from an arbitrary directory¶
To maximize flexibility, especially in CI/CD pipelines, use a variable for the source path in your manifest and provide its value on the command line.
In your manifest, define source_path using a variable like //$sideload_dir/:
Example:
content:
rpms: []
add_files:
- path: /etc/
source_path: //$sideload_dir/<my-file.md>
auth:
# "password"
root_password: $6$xoLqEUz0cGGJRx01$H3H/bFm0myJPULNMtbSsOFd/2BnHqHkMD92Sfxd.EKM9hXTWSmELG8cf205l6dktomuTcgKGGtGDgtvHVXSWU.
In your AIB command, use the --define flag to set the variable’s value:
!!! important
This documentation is in the process of being adjusted for the changes implemented in Automotive Image Builder 1.1.4.
In the meantime, to keep the sample commands in this documentation valid,
you must use the deprecated CLI, as shown in this example.
$ sudo aib-dev build-deprecated --define sideload_dir=/home/user/<my-project>/files --export qcow2 simple-minimal.aib.yml <my-image.qcow2>
This command copies /path-to/<my-project>/files/<my-file.md> from the host into the image’s /etc/ directory.
Next steps
Learn about configuring options and continue to customize your manifest by embedding RPM application packages and containerized applications.