溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

centos8自定義光盤安裝_kickstart

發(fā)布時(shí)間:2020-09-16 18:02:13 來源:網(wǎng)絡(luò) 閱讀:1129 作者:huayumicheng 欄目:系統(tǒng)運(yùn)維

1.安裝軟件包
yum install genisoimage pykickstart -y

2.新建數(shù)據(jù)目錄,復(fù)制安裝包
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.驗(yàn)證ks文件
[root@test ~]# ksvalidator /root/ks.cfg

5.編輯引導(dǎo)配置文件
[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? .

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI