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
  • 相关阅读:
    程序设计实习课(0)资源链接
    解决clion2016.3不能支持搜狗输入法的问题
    四元数运动学笔记(5)IMU驱动的运动误差方程
    四元数运动学笔记(4)旋转的雅克比矩阵
    四元数运动学笔记(3)四元数和旋转相关的约定表述
    四元数运动学笔记(2)旋转向量,旋转矩阵和四元数的关系
    单应矩阵,基本矩阵,本质矩阵
    ROS标定IDS相机
    四元数运动学笔记(1)旋转的表示
    IMU Noise Model
  • 原文地址:https://www.cnblogs.com/wjoyxt/p/4981743.html
Copyright © 2011-2022 走看看