• 【Linux】U盘安装的cfg引导文件配置


    两个导引文件
    isolinux.cfg文件

    default vesamenu.c32
    timeout 600
    
    display boot.msg
    
    # Clear the screen when exiting the menu, instead of leaving the menu displayed.
    # For vesamenu, this means the graphical background is still displayed without
    # the menu itself for as long as the screen remains in graphics mode.
    menu clear
    menu background splash.png
    menu title CentOS 7
    menu vshift 8
    menu rows 18
    menu margin 8
    #menu hidden
    menu helpmsgrow 15
    menu tabmsgrow 13
    
    # Border Area
    menu color border * #00000000 #00000000 none
    
    # Selected item
    menu color sel 0 #ffffffff #00000000 none
    
    # Title bar
    menu color title 0 #ff7ba3d0 #00000000 none
    
    # Press [Tab] message
    menu color tabmsg 0 #ff3a6496 #00000000 none
    
    # Unselected menu item
    menu color unsel 0 #84b8ffff #00000000 none
    
    # Selected hotkey
    menu color hotsel 0 #84b8ffff #00000000 none
    
    # Unselected hotkey
    menu color hotkey 0 #ffffffff #00000000 none
    
    # Help text
    menu color help 0 #ffffffff #00000000 none
    
    # A scrollbar of some type? Not sure.
    menu color scrollbar 0 #ffffffff #ff355594 none
    
    # Timeout msg
    menu color timeout 0 #ffffffff #00000000 none
    menu color timeout_msg 0 #ffffffff #00000000 none
    
    # Command prompt text
    menu color cmdmark 0 #84b8ffff #00000000 none
    menu color cmdline 0 #ffffffff #00000000 none
    
    # Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.
    
    menu tabmsg Press Tab for full configuration options on menu items.
    
    menu separator # insert an empty line
    menu separator # insert an empty line
    
    label linux
      menu label ^Install AISA
      menu default
      kernel vmlinuz
      append vga=normal initrd=initrd.img inst.ks=hd:LABEL=AISA:/isolinux/ks.cfg inst.stage2=hd:LABEL=AISA ramdisk_size=65536 net.ifnames=0 biosdevname=0  ipv6.disable=1 rdloaddriver=igb nomodeset xdriver=vesa brokenmoudles=ast quiet
    
    menu end
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67

    下半部分是需要修改的,此外还删除了一些多余的选项,这些选项将会指引到安装何种系统上;
    照着这个改吧,反正要注意这个AISA也要改对了

    label linux
      menu label ^Install AISA
      menu default
      kernel vmlinuz
      append vga=normal initrd=initrd.img inst.ks=hd:LABEL=AISA:/isolinux/ks.cfg inst.stage2=hd:LABEL=AISA ramdisk_size=65536 net.ifnames=0 biosdevname=0  ipv6.disable=1 rdloaddriver=igb nomodeset xdriver=vesa brokenmoudles=ast quiet
    
    menu end
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    其中指向了了另一个引导文件是ks.cfg

    ks.cfg文件,有删改避免泄漏

    # File Managed by Puppet
    
    install  			# ==系统安装阶段==
    lang en_US.UTF-8	# 设置系统语言
    keyboard us			# 设置键盘
    skipx				# 
    text				
    reboot
    rootpw --iscrypted $1$xxxxxx$eeee	# 设置密码
    authconfig --enableshadow --enablemd5	
    selinux --disabled
    timezone Asia/Shanghai	# 设置时区
    
    %packages	# ==需要的安装包==
    @core
    @base
    @mail-server
    -dovecot
    -system-config-httpd
    -system-config-printer-gui
    -system-config-nfs
    -system-config-samba
    -ivtv-firmware
    @Development tools
    ncurses-devel
    ntp
    %end			# ==所需的安装包范围结束==
    
    %post --nochroot --log=/mnt/sysimage/root/ks-post.log  # ==拷贝文件必须在这个阶段==
    #!/bin/sh
    server_file=/mnt/install/repo/software/server.zip	# U盘目录一定是这/mnt/install/repo/
    if [ -e ${server_file} ]; then
      cp -f ${server_file} /mnt/sysimage/root/
    else
      echo "server.zip not exist!"
    fi
    
    mgr_file=/mnt/install/repo/software/mgr.zip
    if [ -e ${mgr_file} ]; then
      cp -f ${mgr_file} /mnt/sysimage/root/
    else
      echo "mgr.zip not exist!"
    fi
    
    %end 	# ==拷贝文件阶段结束==
    
    
    %post  # 安装阶段,在这里写安装的那些命令
    #!/bin/sh
    
    sed -i 's/net.ifnames=0/net.ifnames=0 rdloaddriver=igb/g' /etc/default/grub
    sed -i 's/crashkernel=auto/crashkernel=128M/g' /etc/default/grub
    grub2-mkconfig -o /boot/grub2/grub.cfg
     
    
    systemctl disable systemd-networkd-wait-online.service
    systemctl disable multipathd.service
    
    if [ -e /root/server.zip ]; then
      unzip -d /root/install -PrdN06360Ndr /root/server.zip
      rm -f /root/server.zip
    else
     echo "/root/server.zip not exist!"
    fi
    
    if [ -e /root/mgr.zip ]; then
      unzip -d /root/install -PrdN06360Ndr /root/mgr.zip 
      rm -f /root/mgr.zip
    fi
    
    
    set -x -v -e
    exec < /dev/tty3 > /dev/tty3
    chvt 3
    (
     echo
     export PATH=/usr/local/bin:$PATH
    
     if [ -d /root/install/ ]; then
       chmod 777 /root/install/kylin_install.sh
       echo "* * * * * root source ~/.bashrc && nohup /root/install/kylin_install.sh >> /root/install_detail 2>&1 &" > /etc/crontab
     else
       echo "/root/install/ not exist"
     fi
     
    ) 2>&1 | tee /root/post-kickstart.log
    
    %end
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
  • 相关阅读:
    window的addEventListener和removeEventListener方法的使用踩雷
    多线程---进阶
    linux中的kill 终止进程
    webpack-cli 在 webpack 打包中的作用
    SSM保姆级从创建项目到使用,包括事务和设置回滚
    2.4.1 用户态协议栈设计实现
    Adaptive AUTOSAR RTA-VRTE工具链介绍
    如何在不依靠工资收入的情况下赚到一万元?
    微信小程序封装请求API-promise格式
    范畴论(Category Theory)的基本介绍
  • 原文地址:https://blog.csdn.net/qq_39057568/article/details/134471482