CentOS8手动编辑定制生成应答文件anaconda-ks.cfg

2024-04-10 01:32

本文主要是介绍CentOS8手动编辑定制生成应答文件anaconda-ks.cfg,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

CentOS8应答文件

记录了安装系统时的操作
可以用此为基础创建自定义应答文件

kickstart文件主要包括三个部分:

命令段,程序包段,脚本段

手动编辑定制生成应答文件

  • CentOS6和7中的图形化工具在CentOS8中没有了
  • 只能通过手动编辑并定制生成应答文件

拷贝系统中原生anaconda-ks.cfg

cp anaconda-ks.cfg ks8.cfg

编辑ks8.cfg应答文件

#version=RHEL8
ignoredisk --only-use=sda
autopart --type=lvm
# Partition clearing information
clearpart --none --initlabel
# Use graphical install
graphical
# Use CDROM installation media
cdrom
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8# Network information
network  --bootproto=dhcp --device=ens33 --ipv6=auto --activate
network  --hostname=localhost.localdomain
repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
# Root password
rootpw --iscrypted $6$0oNcn58oJTkyswqj$ZSA1obbRFFvijoTaiY.GJsBz1CBhIOWt7eEIC7jdZTUZbifpJnR1f8ekUJwc4RTVi/XY5xX/YmkcfFEllTWCZ.
# Run the Setup Agent on first boot
firstboot --enable
# Do not configure the X Window System
skipx
# System services
services --enabled="chronyd"
# System timezone
timezone America/New_York --isUtc%packages
@^server-product-environment
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
修改需要的项
#version=RHEL8
#ignoredisk --only-use=sda ## 分区信息改喽
ignoredisk --only-use=sda
zerombr
#autopart --type=lvm 
#autopart --type=lvm
#part / --fstype xfs --size 1 --grow --ondisk sda 可以实现根自动使用所有剩余空间
part / --fstype="xfs" --ondisk=sda --size=102400
part /data --fstype="xfs" --ondisk=sda --size=51200
part swap --fstype="swap" --ondisk=sda --size=2048
part /boot --fstype="ext4" --ondisk=sda --size=1024
# Partition clearing information
clearpart --none --initlabel
# Use graphical install
## graphical ## 图形化安装改喽
# Use text mode install
text
# Setup Firewall
selinux --disabled
firewall --disabled# Use CDROM installation media ## 安装介质改喽
## cdrom
# Use network installation
url --url="http://10.0.0.88/centos/8/os/x86_64/"
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8# Network information ## 网卡名改喽
network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network  --hostname=localhost.localdomain
## repo位置改喽
# repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
repo --name="AppStream" --baseurl=http://10.0.0.88/centos/8/os/x86_64/AppStream/
# Root password ## 密码改喽
## rootpw --iscrypted ## $6$0oNcn58oJTkyswqj$ZSA1obbRFFvijoTaiY.GJsBz1CBhIOWt7eEIC7jdZTUZbifpJnR1f8ekUJwc4RTVi/XY5xX/YmkcfFEllTWCZ.
rootpw --iscrypted $1$Zmb3GPCH$gNU/fyVaRKbqZeFATib3k/
# Run the Setup Agent on first boot
firstboot --enable
# Setup Booterloader
bootloader --append="net.ifnames=0" --location=mbr --boot-drive=sda
# Do not configure the X Window System
skipx
# System services ## 系统服务改喽
## services --enabled="chronyd"
services --disabled="chronyd"
# System timezone
timezone America/New_York --isUtc%packages
## @^server-product-environment ## 安装包先择,改喽
## kexec-tools
@^minimal-environment
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
yum -y install curl
curl 10.0.0.88/shell/newSet.sh | bash
curl 10.0.0.88/shell/sshpass.sh | bash
%end

汇总归一

ignoredisk --only-use=sda
zerombr
text
reboot
clearpart --all --initlabel
selinux --disabled
firewall --disabled
url --url=http://10.0.0.88/centos/8/os/x86_64/
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
network --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network --hostname=server8.timonium.co
bootloader --append="net.ifnames=0" --location=mbr --boot-drive=sdarootpw --iscrypted $1$Zmb3GPCH$gNU/fyVaRKbqZeFATib3k/
firstboot --enable
skipx
services --disabled="chronyd"
timezone Asia/Shanghai --isUtc --nontp
#autopart --type=lvm
#part / --fstype xfs --size 1 --grow --ondisk sda 可以实现根自动使用所有剩余空间
part / --fstype="xfs" --ondisk=sda --size=102400
part /data --fstype="xfs" --ondisk=sda --size=51200
part swap --fstype="swap" --ondisk=sda --size=2048
part /boot --fstype="ext4" --ondisk=sda --size=1024
%packages
@^minimal-environment
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
%post
yum -y install curl
curl 10.0.0.88/shell/newSet.sh | bash
curl 10.0.0.88/shell/sshpass.sh | bash
%end

创建ks8.cfg在HTTP服务器目录下

cat > /var/www/html/ks/ks8.cfg <<EOF
> ignoredisk --only-use=sda
> zerombr
> text
> reboot
> clearpart --all --initlabel
> selinux --disabled
> firewall --disabled
> url --url=http://10.0.0.88/centos/8/os/x86_64/
> keyboard --vckeymap=us --xlayouts='us'
> lang en_US.UTF-8
> network --bootproto=dhcp --device=eth0 --ipv6=auto --activate
> network --hostname=server8.timonium.co
> bootloader --append="net.ifnames=0" --location=mbr --boot-drive=sda
> 
> rootpw --iscrypted $1$Zmb3GPCH$gNU/fyVaRKbqZeFATib3k/
> firstboot --enable
> skipx
> services --disabled="chronyd"
> timezone Asia/Shanghai --isUtc --nontp
> #autopart --type=lvm
> #part / --fstype xfs --size 1 --grow --ondisk sda 可以实现根自动使用所有剩余空间
> part / --fstype="xfs" --ondisk=sda --size=102400
> part /data --fstype="xfs" --ondisk=sda --size=51200
> part swap --fstype="swap" --ondisk=sda --size=2048
> part /boot --fstype="ext4" --ondisk=sda --size=1024
> %packages
> @^minimal-environment
> 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
> %post --nochroot
yum -y install curl
curl 10.0.0.88/shell/newSet.sh | bash
curl 10.0.0.88/shell/sshpass.sh | bash
%end
> EOF

这篇关于CentOS8手动编辑定制生成应答文件anaconda-ks.cfg的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/889741

相关文章

轻量级在线服装3D定制引擎Myway简介

我写的面向web元宇宙轻量级系列引擎中的另外一个,在线3D定制引擎Myway 3D。 用于在线商品定制,比如个性化服装的定制、日常用品(如杯子)、家装(被套)等物品的在线定制。 特性列表: 可更换衣服款式,按需定制更换模型可实时更改材质颜色可实时添加文本,并可实时修改大小、颜色和角度,支持自定义字体可实时添加艺术图标,并可实时修改大小、颜色和角度,支持翻转、各种对齐可更改衣服图案,按需求定制

android 带与不带logo的二维码生成

该代码基于ZXing项目,这个网上能下载得到。 定义的控件以及属性: public static final int SCAN_CODE = 1;private ImageView iv;private EditText et;private Button qr_btn,add_logo;private Bitmap logo,bitmap,bmp; //logo图标private st

FastAdmin/bootstrapTable 表格中生成的按钮设置成文字

公司有个系统后台框架用的是FastAdmin,后台表格的操作栏按钮只有图标,想要设置成文字。 查资料后发现其实很简单,主需要新增“text”属性即可,如下 buttons: [{name: 'acceptcompany',title: '复核企业',text:'复核企业',classname: 'btn btn-xs btn-primary btn-dialog',icon: 'fa fa-pe

开启青龙 Ninja 扫码功能失效后修改成手动填写CK功能【修正Ninja拉库地址】

国内:进入容器docker exec -it qinglong bash #获取ninjagit clone -b main https://ghproxy.com/https://github.com/wjx0428/ninja.git /ql/ninja#安装cd /ql/ninja/backend && pnpm install cp .env.example .env

ScrollView 非手动调用的方法

1. /**  *  非人为的时候调用这个方法  *  *  @param scrollView <#scrollView description#>  */ - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView {           } 2.判断控制器的view是否加载过 [willShowVC

PHP生成csv格式Excel,秒级别实现excel导出功能

防止报超内存,兼容中文,兼容科学技术法。 爽。。。。很爽。。。。 /*** 告诉浏览器下载csv文件* @param string $filename*/public static function downloadCsv($data, $filename, $encoding = 'utf-8'){header("Content-type: text/csv");header("Conten

PHP 读取或生成大的Excel

场景,在很多情况下,需要读取Excel文件。 常用的有PHPExcel包或者使用 maatwebsite/excel 包 但是使用这个包读取或生成excel,如果excel文件过大,很容易出现超内存情况。 解决方法: 上传:要求上传者使用.csv 文件上传。然后使用php自带的 fgetcsv()函数来读取文件。http://php.net/manual/zh/function.fgetc

使用Sublime Text 2编辑CoffeeScript

Sublime Text 2很好很强大,咱就用它来编辑Coffee代码吧。 安装Sublime Text 2过程就略过了。   CoffeeScript作者是推荐使用TextMate编辑CoffeeScript的。但是TextMate收费,并且对中文支持不好。如果你不在意这两个问题,那么强烈推荐你使用TextMate,并关注CoffeeScript作者的TextMate

3D模型相关生成

3D模型相关生成 1. DreamFusion Model DreamFusion Model 是一种将文本描述转化为三维模型的技术。你可以想象它是一个“魔法翻译器”,你告诉它一个场景或物体的描述,比如“一个飞翔的龙”,它就能生成一个相应的 3D 模型。 原理: 文本到图像生成:DreamFusion 首先将文本描述转化为一系列可能的 2D 图像。这部分利用了预训练的扩散模型(如 DALL

Java代理-动态字节码生成代理的5种方式

上篇讲到了代理模式出现的原因,实现方式以及跟其他相似设计模式的区别。传送门@_@ http://blog.csdn.net/wonking666/article/details/79497547 1.静态代理的不足 设计模式里面的代理模式,代理类是需要手动去写的。但是手写代理的问题颇多 1.如果不同类型的目标对象需要执行同样一套代理的逻辑,比如说在方法调用前后打印参数和结果,那么仍然需要为每