栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

ks应答文件模板

ks应答文件模板

模板
cat ks.cfg 


#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network  --bootproto=static --device=eno5 --gateway=192.168.1.254 --ip=192.168.1.118 --nameserver=114.114.114.114 --netmask=255.255.255.0 --ipv6=auto --activate  ##指定网卡静态IP信息
network  --bootproto=dhcp --device=eno6 --onboot=off --ipv6=auto
network  --bootproto=dhcp --device=eno7 --onboot=off --ipv6=auto
network  --bootproto=dhcp --device=eno8 --onboot=off --ipv6=auto
network  --hostname=localhost.localdomain

# Root password
rootpw --iscrypted $6$JEae7CpqKVn5//ec$qdY1Js76iK/VQMAXjJUkrBlzeBNnMr5sCphC3miskYW3pw2nokXhSaoIRggiS3eI2TRKGXM2EmKsiuyjRp4Do1    # 设置用户名和密码
# System services
services --disabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc --nontp  # 设置时区
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda   # 选择磁盘分区
# Partition clearing information
clearpart --none --initlabel
# Disk partitioning information
part swap --fstype="swap" --ondisk=sda --size=65536
part /boot --fstype="xfs" --ondisk=sda --size=500
part /tmp --fstype="xfs" --ondisk=sda --size=102400
part /opt --fstype="xfs" --ondisk=sda --size=1024
part /boot/efi --fstype="efi" --ondisk=sda --size=500 --fsoptions="umask=0077,shortname=winnt"
part /usr/local --fstype="xfs" --ondisk=sda --size=102400
part / --fstype="xfs" --ondisk=sda --size=102400
part /home --fstype="xfs" --ondisk=sda --size=51200
part /usr --fstype="xfs" --ondisk=sda --size=10240
part /var --fstype="xfs" --ondisk=sda --size=1 --grow   # 剩余全部给 /var下


%packages     # 安装软件应用
@^minimal    
@compat-libraries   
@core
@debugging
@development
kexec-tools

%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
reboot
拓展
  1. 更改三个文件,指定镜像标签和KS文件,都是在镜像挂载目录
vim EFI/BOOT/grub.cfg

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install CentOS 7' --class fedora --class gnu-linux --class gnu --class os {
  linuxefi /images/pxeboot/vmlinuz inst.ks=hd:LABEL=CentOS7:/ks.cfg  inst.stage2=hd:LABEL=CentOS7  quiet
  initrdefi /images/pxeboot/initrd.img
}




vim isolinux/isolinux.cfg

label linux
  menu label ^Install CentOS 7
  kernel vmlinuz
  menu default
  append initrd=initrd.img  inst.ks=hd:LABEL=CentOS7:/ks.cfg  inst.stage2=hd:LABEL=CentOS7  quiet

label check
  menu label Test this ^media & install CentOS 7
  menu default
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOSx207x20x86_64 rd.live.check quiet




vim isolinux/grub.conf

title Install CentOS 7
  findiso
  kernel @KERNELPATH@ @ROOT@ quiet inst.ks=cdrom:/ks.cfg
  initrd @INITRDPATH@

  1. 制作命令
genisoimage -joliet-long -V CentOS7 -o CentOS7.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -cache-inodes -T -eltorito-alt-boot -e images/efiboot.img -no-emul-boot /root/centos_install
# -o 指定镜像标签,和上面的配置文件里的一样,
# 打包的镜像也是这个名字,如***.iso  另外也可以加路径,指定生成到哪里

genisoimage -joliet-long -V CentOS7 -o CentOS7.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -cache-inodes -T -eltorito-alt-boot -e images/efiboot.img -no-emul-boot /root/centos_install

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/583700.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号