5.16. Kickstart file injection in an ISO image


You can use the [customizations.installer] blueprint customization to add your own Kickstart file in your builds for ISO installers, such as image installer, and gain more flexibility when building ISO images for bare metal deployments.

警告

Booting the ISO on a machine with an existing operating system or data can be destructive, because the Kickstart is configured to automatically reformat the first disk on the system.

You can choose the following options to add your own Kickstart file:

  • Setting all values during the installation process.
  • Enabling the unattended = true field in the Kickstart, and getting a fully unattended installation with defaults.
  • Injecting your own Kickstart by using the Kickstart field. This can result in either a fully unattended installation if you specify all required fields, or the installation program prompts you for some fields that might be missing.

    The Anaconda installer ISO image types support the following blueprint customization:

    [customizations.installer]
    unattended = true
    sudo-nopasswd = ["user", "%wheel"]

    unattended: Creates a Kickstart file that fully automates the installation. This includes setting the following options by default:

  • text display mode
  • en_US.UTF-8 language and locale
  • us keyboard layout
  • UTC time zone
  • zerombr, clearpart, and autopart to automatically wipe and partition the first disk
  • network options to enable dhcp and auto-activation

The following is an example:

liveimg --url file:///run/install/repo/liveimg.tar.gz
lang en_US.UTF-8
keyboard us
timezone UTC
zerombr
clearpart --all --initlabel
text
autopart --type=plain --fstype=xfs --nohome
reboot --eject
network --device=link --bootproto=dhcp --onboot=on --activate

sudo-nopasswd: Adds a snippet to the Kickstart file that, after installation, creates drop-in files in /etc/sudoers.d to allow the specified users and groups to run sudo without a password. The groups must be prefixed with %. For example, setting the value to ["user", "%wheel"] creates the following Kickstart %post section:

%post
echo -e "user\tALL=(ALL)\tNOPASSWD: ALL" > "/etc/sudoers.d/user"
chmod 0440 /etc/sudoers.d/user
echo -e "%wheel\tALL=(ALL)\tNOPASSWD: ALL" > "/etc/sudoers.d/%wheel"
chmod 0440 /etc/sudoers.d/%wheel
restorecon -rvF /etc/sudoers.d
%end

As an alternative, you can include a custom Kickstart by using the following customization:

[customizations.installer.kickstart]
contents = """
text --non-interactive
zerombr
clearpart --all --initlabel --disklabel=gpt
autopart --noswap --type=lvm
network --bootproto=dhcp --device=link --activate --onboot=on
"""

image-builder automatically adds the command that installs the system: liveimg, if it is relevant for the image-installer image type. You cannot use the [customizations.installer.kickstart] customization in combination with any other installer customizations.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部