zoukankan      html  css  js  c++  java
  • PXE

    PXE是什么

    preboot excution environment即预启动执行环境

    在CentOS上的部署

    • dhcp (ip/netmask, gw, dns; filename, next-server;)
    • tftp server (bootloader, kernel, initrd)
    • kickstart

    配置tftp server

    端口是:69/udp

    CentOS 6:
    	chkconfig  tftp  on
    	service  xinetd restart
    	
    CentOS 7:
    	systemctl  start  tftp.socket
    

    默认的文件根目录:/var/lib/tftpboot/

    dhcp server:

    配置示例

    option domain-name "magedu.com";
    option routers 192.168.10.9;
    option domain-name-servers 172.18.0.1;
    default-lease-time 43200;
    max-lease-time 86400;
    log-facility local7;
    subnet 192.168.10.0 netmask 255.255.255.0 {
        range 192.168.10.101 192.168.10.120;
        filename "pxelinux.0";
        next-server 192.168.10.9;
    } 
    

    配置PXE环境

    CentOS 7

    yum -y install syslinux
    cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
    cp /media/cdrom/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot
    cp /usrshare/systelinux/{chain.c32,mboot.c32,menu.c32,memdisk} /var/lib/tftpboot
    mkdir /var/lib/tftpboot/pxelinux.cfg/
    vim /var/lib/tftpboot/pxelinux.cfg/default
        default menu.c32
        prompt 5
        timeout 30
        MENU TITLE CentOS 7 PXE Menu
    
        LABEL linux
        MENU LABEL Install CentOS 7 x86_64
        KERNEL vmlinuz
        APPEND initrd=initrd.img inst.repo=http://192.168.10.9/centos/7/x86_64
        LABEL linux_autoinst
        MENU LABEL Install CentOS 7 x86_64 auto
        KERNEL vmlinuz
        APPEND initrd=initrd.img inst.repo=http://192.168.10.9/centos/7/x86_64 ks=http://192.168.10.9/kickstarts/centos7.cfg            
    

    CentOS 6

    yum -y install syslinux
    cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
    cp /media/cdrom/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/
    cp /media/cdrom/isolinux/{boot.msg,vesamenu.c32,splash.png} /var/lib/tftpboot
    mkdir /var/lib/tftpboot/pxelinux.cfg/       
    cp /media/cdrom/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
    

    内容如下所示

    display boot.msg
    menu background splash.jpg
    menu title Welcome to CentOS 6.7 MageEdu!
    menu color border 0 #ffffffff #00000000
    menu color sel 7 #ffffffff #ff000000
    menu color title 0 #ffffffff #00000000
    menu color tabmsg 0 #ffffffff #00000000
    menu color unsel 0 #ffffffff #00000000
    menu color hotsel 0 #ff000000 #ffffffff
    menu color hotkey 7 #ffffffff #ff000000
    menu color scrollbar 0 #ffffffff #00000000
    label autoinst
    menu label ^Auto Install CentOS
    menu default
    kernel vmlinuz
    append initrd=initrd.img ks=ftp://192.168.10.16/pub/centos6.cfg
    label linux
    menu label ^Install or upgrade an existing system
    kernel vmlinuz
    append initrd=initrd.img
    label vesa
    menu label Install system with ^basic video driver
    kernel vmlinuz
    append initrd=initrd.img nomodeset
    label rescue
    menu label ^Rescue installed system
    kernel vmlinuz
    append initrd=initrd.img rescue
    label local
    menu label Boot from ^local drive
    localboot 0xffff
    label memtest86
    menu label ^Memory test
    kernel memtest
    append -
    
  • 相关阅读:
    Python使用selenium(二)
    自动化测试
    测试要求
    测试用例编写
    求职杂谈
    不会交谈的测试员,果然不是一个好的测试员
    浅谈微信小程序测试
    python 匿名函数lambda的用法
    python __xx__的定义和用处
    看django的感受
  • 原文地址:https://www.cnblogs.com/xuelong3/p/7628070.html
Copyright © 2011-2022 走看看