32.8. 如何使 Kickstart 文件可用


kickstart 文件必须位于以下几个位置之一:
  • 在可移动介质上,如软盘、光盘或 U 盘上。
  • 在硬盘上
  • 在网络中
通常将 kickstart 文件复制到可移动介质引导或硬盘里,或在网络中提供。基于网络的方法使用最普遍,因为多数 kickstart 安装是在联网的计算机中执行的。
以下小节深入探讨了在哪里放置 kickstart 文件的问题。

32.8.1. 创建 kickstart 引导介质

If you want to modify boot media provided by Red Hat to include a Kickstart file and automatically load it during boot, follow the procedure below. Note that this procedure will only work on AMD and Intel systems (x86 and x86_64). Additionally, this procedure requires the genisoimage and isomd5sum packages; these packages are available on Red Hat Enterprise Linux, but if you use a different system, you may need to adjust the commands used.

注意

Diskette-based booting is no longer supported in Red Hat Enterprise Linux. Installations must use CD-ROM or flash memory products for booting. However, the kickstart file may still reside on a diskette's top-level directory, and must be named ks.cfg. Separate boot media will be required.

过程 32.1. Including a Kickstart File on Boot Media

Before you start the procedure, make sure you have downloaded a boot ISO image (boot.iso or binary DVD) as described in 第 1 章 获取 Red Hat Enterprise Linux, and that you have created a working Kickstart file.
  1. Mount the ISO image you have downloaded:
    # mount /path/to/image.iso /mnt/iso
  2. Extract the ISO image into a working directory somewhere in your system:
    # cp -pRf /mnt/iso /tmp/workdir
  3. Unmount the mounted image:
    # umount /mnt/iso
  4. The contents of the image is now placed in the iso/ directory in your working directory. Add your Kickstart file (ks.cfg) into the iso/ directory:
    # cp /path/to/ks.cfg /tmp/workdir/iso
  5. Open the isolinux/isolinux.cfg configuration file inside the iso/ directory. This file determines all the menu options which appear in the boot menu. A single menu entry is defined as the following:
    label linux
      menu label ^Install or upgrade an existing system
      menu default
      kernel vmlinuz
      append initrd=initrd.img
    
    Add the ks= boot option to the line beginning with append. The exact syntax depends on how you plan to boot the ISO image; for example, if you plan on booting from a CD or DVD, use ks=cdrom:/ks.cfg. A list of possible sources and the syntax used to configure them is available in 第 28.4 节 “使用 Kickstart 进行自动安装”.
  6. Use genisoimage in the iso/ directory to create a new bootable ISO image with your changes included:
    # genisoimage -U -r -v -T -J -joliet-long -V "RHEL-6" -volset "RHEL-6" -A "RHEL-6" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -o ../NEWISO.iso .
    This comand will create a file named NEWISO.iso in your working directory (one directory above the iso/ directory).

    重要

    If you use a disk label to refer to any device in your isolinux.cfg (e.g. ks=hd:LABEL=RHEL-6/ks.cfg, make sure that the label matches the label of the new ISO you are creating. Also note that in boot loader configuration, spaces in labels must be replaced with \x20.
  7. Implant a md5 checksum into the new ISO image:
    # implantisomd5 ../NEWISO.iso
After you finish the above procedure, your new image is ready to be turned into boot media. Refer to 第 2 章 创建介质 for instructions.
要执行使用笔型(pen-based)闪存设备的 kickstart 安装,kickstart 文件的名字必须为 ks.cfg 且必须位于闪存设备的顶层目录里。kickstart 文件应在不同的闪存中作为引导介质使用。
要开始 Kickstart 安装,请使用生成的引导介质引导该系统,并使用 ks= 引导选项指定包含 USB 驱动器的设备。有关 ks= 引导选项的详情请查看 第 28.4 节 “使用 Kickstart 进行自动安装”
有关使用 rhel-variant-version-architecture-boot.iso 映像文件创建引导 USB 介质的步骤请参考 第 2.2 节 “创建最小引导介质”。可在 Red Hat 客户门户的软件 & 下载中心下载该映像文件。

注意

可以创建用于引导的 USB 闪盘,但是这主要依赖于系统的 BIOS 设置。请咨询硬件供应商,查看系统是否支持引导至其他设备。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.