Chapter 7. Managing kernel command-line parameters with UKI


Unified Kernel Image (UKI) combines the kernel, initial RAM disk (initrd), and boot command line into a single executable binary.

7.1. Understanding kernel command-line parameters with UKI

With UKI, systemd-boot, specifically systemd-stub, handles the kernel command-line parameters. The UKI delivered by Red Hat includes the basic kernel command-line parameter console=tty0 console=ttyS0.

You can add additional kernel command-line parameters by using UKI add-ons. Alternatively, you can generate your own UKI to contain any arguments you require.

Important

Secure Boot revokes improperly signed UKIs and add-ons. These signatures can also alter PCR measurements of TPM which can potentially affect boot sequence.

7.2. Understanding boot entries

You manage boot entries directly in UEFI NVRAM. This means they are no longer stored on disk. You can use tools such as kernel-bootcfg or efibootmgr to alter boot entries directly.

The following is an example of a boot entry:

Boot0001* redhat	HD(1,GPT,9192a707-8768-4c9f-bb11-fdd7c7e307e7,0x800,0x100000)/\EFI\redhat\shimx64.efi\EFI\Linux\ffffffffffffffffffffffffffffffff-6.12.0-174.el10.x86_64.efi

7.3. Acquire UKI add-ons to add kernel command-line parameters

To add kernel command-line parameters, you can acquire officially signed add-ons delivered by Red Hat in the kernel-uki-virt-addons packages. These add-ons are signed by the same certificates as their associated UKIs. The default installation path is /lib/modules/$(uname -r)/vmlinuz-virt.efi.extra.d/.

Note

You must copy these add-ons to the appropriate locations for them to take effect.

If you need add-ons other than these or prefer signing them on your own, you can create them with tools such as systemd-ukify or dracut.

Procedure

  • Create a new add-on:

    # ukify build --cmdline "emergency" --output emergency.unsigned.addon.efi

7.4. Changing kernel command-line parameters for all boot entries

To change kernel command-line parameters for all boot entries, add the UKI add-ons to the global add-ons directory /boot/efi/loader/addons/.

Prerequisites

  • You have root permissions on the system.
  • You have .addon.efi file.

Procedure

  1. Copy the add-on file to the /boot/efi/loader/addons/ directory:

    # cp <my-addon>.addon.efi /boot/efi/loader/addons/
  2. Reboot the system:

    # reboot

Verification

  • Verify the new parameter depends on the type of the added add-on. For example, check the kernel command line:

    # cat /proc/cmdline

7.5. Changing kernel command-line parameters for a single UKI

To change kernel command-line parameters for a single UKI, manage the add-ons on a per-UKI basis. The revocation mechanism applies to UKI and its associated add-ons locally.

By default, UKIs are located at the following path:

/boot/efi/EFI/Linux/<machine_id>-<kernel_version>.efi

The effective add-ons designated to this UKI are located at the following path:

/boot/efi/EFI/Linux/<machine_id>-<kernel_version>.efi.extra.d/

Prerequisites

  • You have root permissions on the system.
  • You have .addon.efi file.

Procedure

  1. Identify the running kernel version and machine ID:

    # uname -r
    # cat /etc/machine-id
  2. Copy the add-on file to the specific directory associated with the UKI:

    # cp <my-addon>.addon.efi /boot/efi/EFI/Linux/<machine_id>-<kernel_version>.efi.extra.d/
  3. Reboot the system:

    # reboot

Verification

  • Verify the new parameter depends on the type of the added add-on. For example, check the kernel command line:

    # cat /proc/cmdline
Note

When you update the kernel-uki-virt package, the system installs a new UKI version. The update also copies the currently effective add-ons to the directory for the new UKI, provided that the kernel-uki-virt-addons package is installed at the same time. This happens automatically, for example, when you run dnf update.

7.6. Creating UKI to contain customized kernel command-line parameters

To customize the Linux kernel, initial RAM disk, or initrd, and kernel command-line parameters, you can create your own UKI by using tools such as systemd-ukify or dracut.

Procedure

  • For example, to create a custom UKI by using systemd-ukify:

    # ukify build --initrd /boot/initramfs-$(uname -r).img --linux /lib/modules/$(uname -r)/vmlinuz --uname $(uname -r) --cmdline "console=tty0 console=ttyS0 emergency" --output uki.unsigned.efi
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동