扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
1.安装软件包
yum install genisoimage pykickstart -y
2.新建数据目录,复制安装包
mount /dev/cdrom /media/cdrom
mkdir -p /data/os
rsync -a /media/cdrom/ /data/os/
cd /data/os/
cp /root/ks.cfg ./isolinux/ks.cfg
3.编写ks文件
[root@test os]# more /data/os/isolinux/ks.cfg
#version=RHEL8
# Partition clearing information
clearpart --none --initlabel
# Use graphical install
graphical
#repo --name="AppStream" --baseurl=file:///run/install/repo/AppStream
# Use CDROM installation media
cdrom
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --hostname=localhost.localdomain
# Root password --tom.12
rootpw --iscrypted $6$xCCTrJnCr7QBGZb/$hXm51x5uAKlQoYI/Dckyx6j03UCGtSFCsGtGVnQ5VQmlfOkAjPQCFqmJfvNXoZqqfYRbdaKyxDhqUwynPA60N0
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Run the Setup Agent on first boot
firstboot --disable
# firewall configuration
firewall --disabled
# System services
services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai
%packages
@Base
@Core
@development
@network-tools
kexec-tools
vim
bind-utils
sysstat
lrzsz
iptraf
cmake
redhat-lsb
lsof
ftp
traceroute
ncurses-devel
dstat
iotop
NetworkManager-tui
openssl-devel
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
# Reboot after installation
reboot
4.验证ks文件
[root@test ~]# ksvalidator /root/ks.cfg
5.编辑引导配置文件
[root@test ~]# cat /data/os/isolinux/isolinux.cfg
label linux
menu label ^Install CentOS Linux 8.0.1905
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=CentOS-8-BaseOS-x86_64 quiet
label custom
menu label ^Install CentOS 8 autoinstall
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=CENTOS8 inst.ks=cdrom:/isolinux/ks.cfg
[root@test ~]# cat /data/os/EFI/BOOT/grub.cfg
menuentry 'Test this media & install CentOS Linux 8.0.1905' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS-8-BaseOS-x86_64 rd.live.check quiet
initrdefi /images/pxeboot/initrd.img
}
menuentry 'Install CentOS 8 custom autoinstall' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /images/pxeboot/vmlinuz inst.ks=cdrom:/isolinux/ks.cfg inst.stage2=hd:LABEL=CENTOS8 quiet
initrdefi /images/pxeboot/initrd.img
}
6.制作iso
cd /data/os/
genisoimage -v -cache-inodes -joliet-long -R -J -T -V CENTOS8 -o /root/centos-8.0-x86_64.iso -input-charset utf-8 -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -b images/efiboot.img -no-emul-boot .
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流