zoukankan      html  css  js  c++  java
  • cobbler之ks文件编辑

    kickstart文件的组成部分:

       命令段:用于配置系统

       软件包:指定要安装的程序包及程序包组

           %packages 标识

             @Base:使用@指定包组

              lftp:直接写程序包名

             注意:软件包段每个软件包和包组每行只能写一个 

                注意:在程序包前加-,不安装相关包

           %end :软件包结束

       脚本段:

              %pre:安装过程开始前的预备脚本

                  所能执行的操作较小,它是一个首先的环境,因为其是仅有简装版的shell环境

              %post:所有的软件完成之后执行的脚本

               此时,具有完整意义上的shell环境,但并非所有命令都安装,先确保所有的程序包已经安装

              %end :结束

    示例文件:

    #platform=x86, AMD64, or Intel EM64T
    # System authorization information
    auth  --useshadow  --enablemd5
    # System bootloader configuration
    bootloader --location=mbr
    # Use text mode install
    text
    # Firewall configuration
    firewall --disable
    # Run the Setup Agent on first boot
    firstboot --disable
    # System keyboard
    keyboard us
    # System language
    lang en_US
    # Use network installation
    url --url=$tree
    #url --url="http://172.16.65.222/cobbler/ks_mirror/centos6.5-x86-64/"
    
    # If any cobbler repo definitions were referenced in the kickstart profile, include them here.
    $yum_repo_stanza
    # Network information
    #network  --bootproto=dhcp --device=eth0 --onboot=on
    network --bootproto=static --device=eth0  --ip=172.16.65.111 --netmask=255.255.255.0 --gateway=172.16.65.1 --nameserver=8.8.8.8 --hostname=mycentos --onboot=on
    # System bootloader configuration
    bootloader --location=mbr
    # Reboot after installation
    reboot
    
    #Root password
    rootpw --iscrypted $default_password_crypted
    # SELinux configuration
    selinux --disabled
    # Do not configure the X Window System
    skipx
    key --skip
    # Installation logging level
    logging --level=info
    # System timezone
    timezone  Asia/Shanghai
    # Install OS instead of upgrade
    install
    # Clear the Master Boot Record
    zerombr
    # Allow anaconda to partition the system as needed
    #autopart
    
    %include /tmp/partition.ks
    
    %pre
    #!/bin/sh
    act_mem=`cat /proc/meminfo | grep MemTotal | awk '{printf("%d",$2/1024)}'`
    cat >> /tmp/partition.ks  << END
    clearpart --all
    part swap --bytes-per-inode=4096 --fstype="swap" --size=${act_mem}
    part /boot --bytes-per-inode=4096 --asprimary  --fstype="ext4" --size=200
    part / --bytes-per-inode=4096 --fstype="ext4" --grow --size=1 
    END
    %end
    
    
    %packages
    @base
    @core
    @chinese-support
    @development
    @ruby-runtime
    git
    ntp
    lrzsz
    %end
    
    %post
    ntpdate cn.pool.ntp.org
    hwclock --systohc
    chkconfig acpid off
    chkconfig atd off
    chkconfig autofs off
    chkconfig bluetooth off
    chkconfig cpuspeed off
    chkconfig firstboot off
    chkconfig gpm off
    chkconfig haldaemon off
    chkconfig hidd off
    chkconfig ip6tables off
    chkconfig iptables off
    chkconfig isdn off
    chkconfig messagebus off
    chkconfig nfslock off
    chkconfig pcscd off
    chkconfig portmap off
    chkconfig rpcgssd off
    chkconfig rpcidmapd off
    chkconfig yum-updatesd off
    chkconfig sendmail off
    #cd /root
    #wget http://172.16.65.222/cobbler/ks_mirror/config/autoip.sh
    #sh /root/autoip.sh
    
    %end
  • 相关阅读:
    ionic2里面Angular2运用canvas画图
    前端css禁止复制页面上的文本
    原生JS检测浏览器安装的插件
    javascript 里面的 匿名函数自执行方法!
    软件质量保证体系是什么 国家标准中与质量保证管理相关的几个标准是什么?他们的编号和全称是什么?
    软件产品质量特性是什么?
    软件测试的策略是什么?
    软件测试分为几个阶段 各阶段的测试策略和要求是什么?
    软件测试各个阶段通常完成什么工作?各个阶段的结果文件是什么?包括什么内容?
    什么是软件测试?软件测试的目的与原则
  • 原文地址:https://www.cnblogs.com/wjoyxt/p/4981743.html
Copyright © 2011-2022 走看看