树叶云linux教程:19.2.3 配置SYSLinux服务程序

SYSLinux是一个用于提供引导加载的服务程序。与其说SYSLinux是一个服务程序,不如说更需要里面的引导文件,在安装好SYSLinux服务程序软件包后,/usr/share/syslinux目录中会出现很多引导文件。

    [root@linuxprobe ~]# yum install syslinux
    Loaded plugins: langpacks, product-id, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    Resolving Dependencies
    --> Running transaction check
    ---> Package syslinux.x86_64 0:4.05-8.el7 will be installed
    --> Finished Dependency Resolution
    Dependencies Resolved
    ================================================================================
     Package Arch Version Repository Size
    ================================================================================
    Installing:
     syslinux x86_64 4.05-8.el7 rhel 1.0 M
    Transaction Summary
    ================================================================================
    Install 1 Package
    Total download size: 1.0 M
    Installed size: 2.3 M
    Is this ok [y/d/N]: y
    Downloading packages:
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
     Installing : syslinux-4.05-8.el7.x86_64 1/1 
     Verifying : syslinux-4.05-8.el7.x86_64 1/1 
    Installed:
     syslinux.x86_64 0:4.05-8.el7 
    Complete!

我们首先需要把SYSLinux提供的引导文件复制到TFTP服务程序的默认目录中,也就是前文提到的文件pxelinux.0,这样客户端主机就能够顺利地获取到引导文件了。另外在RHEL 7系统光盘镜像中也有一些我们需要调取的引导文件。确认光盘镜像已经被挂载到/media/cdrom目录后,使用复制命令将光盘镜像中自带的一些引导文件也复制到TFTP服务程序的默认目录中。

    [root@linuxprobe ~]# cd /var/lib/tftpboot
    [root@linuxprobe tftpboot]# cp /usr/share/syslinux/pxelinux.0 .
    [root@linuxprobe tftpboot]# cp /media/cdrom/images/pxeboot/{vmlinuz,initrd.img} .
    [root@linuxprobe tftpboot]# cp /media/cdrom/isolinux/{vesamenu.c32,boot.msg} .

然后在TFTP服务程序的目录中新建pxelinux.cfg目录,虽然该目录的名字带有后缀,但依然也是目录,而非文件!将系统光盘中的开机选项菜单复制到该目录中,并命名为default。这个default文件就是开机时的选项菜单,如图19-4所示。

图19-4 Linux系统的引导菜单界面

    [root@linuxprobe tftpboot]# mkdir pxelinux.cfg
    [root@linuxprobe tftpboot]# cp  /media/cdrom/isolinux/isolinux.cfg pxelinux.cfg/default

默认的开机菜单中有两个选项,要么是安装系统,要么是对安装介质进行检验。既然我们已经确定采用无人值守的方式安装系统,还需要为每台主机手动选择相应的选项,未免与我们的主旨(无人值守安装)相悖。现在我们编辑这个default文件,把第1行的default参数修改为linux,这样系统在开机时就会默认执行那个名称为linux的选项了。对应的linux选项大约在64行,我们将默认的光盘镜像安装方式修改成FTP文件传输方式,并指定好光盘镜像的获取网址以及Kickstart应答文件的获取路径:

    [root@linuxprobe tftpboot]# vim pxelinux.cfg/default
     1 default linux
     2 timeout 600
     3
     4 display boot.msg
     5
     6 # Clear the screen when exiting the menu, instead of leaving the menu displa yed.
     7 # For vesamenu, this means the graphical background is still displayed witho ut
     8 # the menu itself for as long as the screen remains in graphics mode.
     9 menu clear
     10 menu background splash.png
     11 menu title Red Hat Enterprise Linux 7.0
     12 menu vshift 8
     13 menu rows 18
     14 menu margin 8
     15 #menu hidden
     16 menu helpmsgrow 15
     17 menu tabmsgrow 13
     18
     19 # Border Area
     20 menu color border * #00000000 #00000000 none
     21
     22 # Selected item
     23 menu color sel 0 #ffffffff #00000000 none
     24
     25 # Title bar
     26 menu color title 0 #ff7ba3d0 #00000000 none
     27
     28 # Press [Tab] message
     29 menu color tabmsg 0 #ff3a6496 #00000000 none
     30
     31 # Unselected menu item
     32 menu color unsel 0 #84b8ffff #00000000 none
     33
     34 # Selected hotkey
     35 menu color hotsel 0 #84b8ffff #00000000 none
     36
     37 # Unselected hotkey
     38 menu color hotkey 0 #ffffffff #00000000 none
     39
     40 # Help text
     41 menu color help 0 #ffffffff #00000000 none
     42 
     43 # A scrollbar of some type? Not sure.
     44 menu color scrollbar 0 #ffffffff #ff355594 none
     45 
     46 # Timeout msg
     47 menu color timeout 0 #ffffffff #00000000 none
     48 menu color timeout_msg 0 #ffffffff #00000000 none
     49 
     50 # Command prompt text
     51 menu color cmdmark 0 #84b8ffff #00000000 none
     52 menu color cmdline 0 #ffffffff #00000000 none
     53 
     54 # Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
     55 
     56 menu tabmsg Press Tab for full configuration options on menu items.
     57 
     58 menu separator # insert an empty line
     59 menu separator # insert an empty line
     59 menu separator # insert an empty line
     60 
     61 label linux
     62 menu label ^Install Red Hat Enterprise Linux 7.0
     63 kernel vmlinuz
     64 append initrd=initrd.img inst.stage2=ftp://192.168.10.10 ks=ftp://192.168.10.10/pub/ks.cfg quiet
     65
    ………………省略部分输出信息………………

文章来源网络,作者:管理,如若转载,请注明出处:https://shuyeidc.com/wp/166742.html<

赞 (0)
管理的头像管理
上一篇2025-03-20 16:38
下一篇 2025-03-20 16:39

相关推荐

  • jsp空间购买和交换数据空间怎么买,有哪些注意事项?

    购买JSP空间时,是否考虑过数据交换空间的性能?简米科技(2003年始创,23年行业沉淀)与酷番云(工信部一类增值电信全牌照)这类持牌自营机房的服务商,能确保数据交换的高效稳定,是值得优先选择的合作伙伴,为什么JSP空间需要搭配独立的数据交换空间从JSP应用特性看数据交换需求JSP基于Java技术,常用于企业级……

    2026-08-11
    0
  • 建网站用香港空间效果怎么样,香港空间稳定吗?

    建网站用香港空间,对于创建网站资产来说,核心价值在于免备案和全球带宽优势,尤其适合外贸、跨境电商和需要快速启动的项目,但你必须权衡国内访问延迟,并选择有资质的服务商以保证资产安全,香港空间的核心优势与适用边界免备案:节省时间就是节省成本国内服务器需要备案,通常需要10到20天,香港空间无需备案,域名解析后即可上……

    2026-08-11
    0
  • Java连接云数据库的方法是什么,如何操作

    Java连接云数据库的核心在于通过JDBC驱动,结合云服务商提供的连接地址、端口、数据库名及认证信息,配置安全策略(如SSL、IP白名单),即可实现稳定高效的远程数据库访问,基础准备:JDBC驱动与依赖管理连接云数据库前,需要确保开发环境具备对应的JDBC驱动,以最常见的MySQL为例,你需要引入mysql-c……

    2026-08-11
    0
  • 建网站公安联网备案必须使用数据码吗,备案流程是什么

    网站备案包括ICP备案和公安联网备案,两者缺一不可,公安联网备案必须使用服务商提供的数据码,选择持有合法资质的服务商是顺利通过备案的前提,为什么网站必须进行公安联网备案根据公安部《计算机信息网络国际联网安全保护管理办法》,网站开通后30日内必须到公安机关办理备案手续,未完成公安备案的网站,面临责令整改、关闭网站……

    2026-08-10
    0
  • 建一个企业网站大概需要多少钱?,怎么收费?

    建网站要多少钱,没有一个固定的数字,几百到几万都可能,但真正的“创建网站资产”绝不仅仅是初次投入的成本,而是基于长期稳定、合规和安全的持续性投入,其中核心取决于你选择了什么样的“地基”来承载你的业务,建站预算的构成与行业基准当你开始规划一个网站,最先面对的就是预算问题,一个常见的误区是只关注网站“看起来”的建造……

    2026-08-10
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注