title | parent | nav_order |
---|---|---|
Configuration |
API |
2 |
The Image Customizer is configured using a YAML (or JSON) file.
The top level type for the YAML file is the config type.
-
If partitions were specified in the config, customize the disk partitions.
Otherwise, if the resetPartitionsUuidsType value is specified, then the partitions' UUIDs are changed.
-
Override the
/etc/resolv.conf
file with the version from the host OS. -
Update packages:
-
Remove packages (removeLists, remove)
-
Update base image packages (updateExistingPackages).
-
Install packages (installLists, install)
-
Update packages (updateLists, update)
-
-
Update hostname. (hostname)
-
Copy additional files. (additionalFiles)
-
Copy additional directories. (additionalDirs)
-
Add/update users. (users)
-
Enable/disable services. (services)
-
Configure kernel modules. (modules)
-
Write the
/etc/image-customizer-release
file. -
Write the image history file.
-
If the bootloader resetType is set to
hard-reset
, then reset the boot-loader.If the bootloader resetType is not set, then append the extraCommandLine value to the existing
grub.cfg
file. -
Update the SELinux mode. mode
-
If (overlays) are specified, then add the overlay driver and update the fstab file with the overlay mount information.
-
If a (verity) device is specified, then add the dm-verity dracut driver and update the grub config.
-
Regenerate the initramfs file (if needed).
-
Run (postCustomization) scripts.
-
Restore the
/etc/resolv.conf
file. -
If SELinux is enabled, call
setfiles
. -
Run finalize image scripts. (finalizeCustomization)
-
If --shrink-filesystems is specified, then shrink the file systems.
-
If a (verity) device is specified, then create the hash tree and update the grub config.
-
If the output format is set to
iso
, copy additional iso media files. (iso) -
If --output-pxe-artifacts-dir is specified, then export the ISO image contents to the specified folder.
The /etc/resolv.conf
file is overridden during customization so that the package
installation and customization scripts can have access to the network.
Near the end of customization, the /etc/resolv.conf
file is restored to its original
state.
However, if the /etc/resolv.conf
did not exist in the base image and
systemd-resolved
service is enabled, then the /etc/resolv.conf
file is symlinked to
the /run/systemd/resolve/stub-resolv.conf
file. (This would happen anyway during
first-boot. But doing this during customization is useful for verity enabled images
where the filesystem is readonly.)
If you want to explicitly set the /etc/resolv.conf
file contents, you can do so within
a finalizeCustomization script, since those scripts run
after the /etc/resolv.conf
is deleted.
If you wish to replace a package with conflicting package, then you can remove the existing package using remove and then install the new package with install.
Example:
os:
packages:
remove:
- kernel
install:
- kernel-uvm
- config type
- storage
- iso (iso type)
- pxe (pxe type)
- os (os type)
- bootloader (bootloader type)
- hostname
- kernelCommandLine (kernelCommandLine type)
- packages (packages type)
- additionalFiles (additionalFile type)
- additionalDirs (dirConfig type)
- users (user type)
- selinux (selinux type)
- services (selinux type)
- modules (module type)
- overlays (overlay type)
- uki (uki type)
- imageHistory
- scripts (scripts type)
- previewFeatures type