3.2. 系统带有 bios 固件


ISOLINUX 引导装载程序用于带有 BIOS 固件的系统。

图 3.1. ISOLINUX 引导菜单

引导介质上的 isolinux/isolinux.cfg 配置文件包含设置颜色模式和菜单结构(实体和子菜单)的指令。

在配置文件中,Red Hat Enterprise Linux 的默认菜单条目(Test this media & install Red Hat Enterprise Linux 9)定义在以下块中:

label check
  menu label Test this ^media & install Red Hat Enterprise Linux 9.
  menu default
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-9-BaseOS-x86_64 rd.live.check
quiet
Copy to Clipboard Toggle word wrap

其中:

  • menu label - 确定菜单中如何命名条目。^ 字符确定其键盘快捷键( m 键)。
  • menu default - 提供默认的选择,即使它不是列表中的第一个选项。
  • kernel - 加载安装程序内核。在大多数情况下不应该更改它。
  • append - 包含额外的内核选项。initrd=inst.stage2 选项是必需的,您还可以添加其他选项。

    有关适用于 Anaconda 的选项的详情,请参考 引导选项的类型

    一个值得注意的选项是 inst.ks=,它允许您指定 Kickstart 文件的位置。您可以将 Kickstart 文件放在引导 ISO 镜像上,并使用 inst.ks= 选项指定它的位置;例如,您可以将 kickstart.ks 文件放在镜像的根目录中,并使用 inst.ks=hd:LABEL=RHEL-9-BaseOS-x86_64:/kickstart.ks

    您还可以使用您系统上 dracut.cmdline(7) 手册页中列出的 dracut 选项 。

    重要

    当使用磁盘标签来指向特定驱动器时(如 inst.stage2=hd:LABEL=RHEL-9-BaseOS-x86_64 选项中所示),将所有空格替换为 \x20

菜单条目定义中没有包括的其它重要选项有:

  • timeout - 确定在自动使用默认菜单条目之前显示引导菜单的时间。默认值为 600,这意味着菜单显示 60 秒。将此值设为 0 可禁用 timeout 选项。

    注意

    在执行无头安装时,将 timeout 设为低值(如 1 )非常有用。这有助于避免等待默认超时完成。

  • menu beginmenu end - 确定 submenu 块的开头和结尾,允许您添加额外的选项,如在子菜单中进行故障排除和分组。包含两个选项(一个用来继续,一个用来回到主菜单)的简单子菜单类似如下:

    menu begin ^Troubleshooting
      menu title Troubleshooting
    
    label rescue
      menu label ^Rescue a Red Hat Enterprise Linux system
      kernel vmlinuz
      append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-9-BaseOS-x86_64 rescue quiet
    
    menu separator
    
    label returntomain
      menu label Return to ^main menu
      menu exit
    
    menu end
    Copy to Clipboard Toggle word wrap

    子菜单条目的定义类似于普通的菜单条目,但在菜单 menu beginmenu end 语句之间分组。第二个选项中的 menu exit 行会退出子菜单,并返回到主菜单。

  • menu background - 菜单背景可以是纯色(请参见下面的 menu color ),也可以是 PNG、JPEG 或 LSS16 格式的图像。在使用图像时,请确保其尺寸与使用 set resolution 语句设置的分辨率相对应。默认尺寸是 640x480。
  • menu color - 确定菜单元素的颜色。完整格式为:

    menu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadowmenu color element ansi foreground background shadow
    Copy to Clipboard Toggle word wrap

    这个命令最重要的部分包括:

  • element - 决定颜色将应用到哪些元素。
  • foreground and background - 决定实际颜色。

    颜色是使用十六进制格式的 #AARRGGBB 表示法描述的,来确定透明度:

  • 00,完全透明。
  • ff 完全不透明。
  • menu helptextfile - 创建菜单条目,当选择它时,会显示帮助文本文件。
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat