Customize kernel, system settings, and services
Customize kernel arguments and real-time kernel support in RHEL images. You can configure system settings, including time zone, Network Time Protocol (NTP) servers, locale preferences, and firewall rules, and control which services start at boot time by using blueprint customizations.
Append a kernel argument Copy linkLink copied!
You can append arguments to the boot loader kernel command line. By default, RHEL image builder builds a default kernel into the image. However, you can customize the kernel by configuring it in the blueprint.
Before you begin Copy linkLink copied!
- You have created a blueprint.
Procedure Copy linkLink copied!
[customizations.kernel]
append = "<kernel_option>"
For example:
[customizations.kernel]
name = "kernel-debug"
append = "nosmt=force"
Build RHEL images by using the real-time kernel Copy linkLink copied!
Build a RHEL image by using the real-time kernel (kernel-rt). Override a repository by using .json from the /usr/share/image-builder/repositories/ directory to build an image that selects kernel-rt as the default kernel. Deploy the image to a system and use the real-time kernel features.
Before you begin Copy linkLink copied!
- Your system is registered, and RHEL is attached to a RHEL for Real Time subscription.
About this task Copy linkLink copied!
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- After booting a VM from the image, verify that the image correctly selected
kernel-rtas the default kernel.$ cat /proc/cmdlineBOOT_IMAGE=(hd0,got3)/vmlinuz-6.12.0-0.el10_0_.x86_64+rt...
Set time zone and NTP Copy linkLink copied!
You can customize your blueprint to configure the time zone and the Network Time Protocol (NTP).
Before you begin Copy linkLink copied!
- You have created a blueprint.
About this task Copy linkLink copied!
Both timezone and ntpservers attributes are optional strings. If you do not customize the time zone, the system uses Universal Time Coordinated (UTC). If you do not set NTP servers, the system uses the default distribution.
Procedure Copy linkLink copied!
timezone and the ntpservers you want:
[customizations.timezone]
timezone = "TIMEZONE"
ntpservers = "NTP_SERVER"
For example:
[customizations.timezone]
timezone = "US/Eastern"
ntpservers = ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"]
Customize the locale settings Copy linkLink copied!
You can customize the locale settings for your resulting system image. Both language and keyboard attributes are mandatory. The first language you add is the primary language, and the remaining languages are secondary.
Before you begin Copy linkLink copied!
- You have created a blueprint.
Procedure Copy linkLink copied!
Customize firewall Copy linkLink copied!
Set the firewall for the resulting system image. By default, the firewall blocks incoming connections, except for services that you explicitly enabled ports, such as sshd.
Before you begin Copy linkLink copied!
- You have created a blueprint.
About this task Copy linkLink copied!
If you do not want to use the [customizations.firewall] or [customizations.firewall.services], either remove the attributes or set them to an empty list []. If you only want to use the default firewall setup, you can omit the customization from the blueprint.
Procedure Copy linkLink copied!
Enable or disabling services Copy linkLink copied!
You can control which services to enable during boot time. Some image types have preset services that you cannot override to ensure the image works correctly.
Before you begin Copy linkLink copied!
- You have created a blueprint.
About this task Copy linkLink copied!
The [customizations.services] settings add to existing services in image templates but do not replace them.
Procedure Copy linkLink copied!
[customizations.services]
enabled = ["services"]
disabled = ["services"]
For example:
[customizations.services]
enabled = ["sshd", "cockpit.socket", "httpd"]
disabled = ["postfix", "telnetd"]