赞
踩
1、前提
服务端:Kylin-Server-10-SP2-Release-Build09-20210524-x86_64
客户端:Kylin-Server-10-SP2-Release-Build09-20210524-x86_64
服务器IP:192.168.1.100
2.1 nfs搭建
yum install -y nfs-utils
mkdir /V10SP2 /kickstart
echo -e "/V10SP2 *(insecure,rw,async,no_root_squash)\n/kickstart *(insecure,rw,async,no_root_squash)" > /etc/exports
mount xxx.iso /mnt
cp -avprf /mnt/* /V10SP2
chmod -R 777 /V10SP2
vim /kickstart/ks.cfg
添加如下内容
#version=DEVEL
# X Window System configuration information
xconfig --startxonboot
# License agreement
eula --agreed
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
nfs --server=192.168.1.100 --dir=/V10SP2
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
# System services
services --enabled="chronyd"
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang zh_CN.UTF-8
ignoredisk --only-use=sda
# Network information
# Root password
rootpw --iscrypted $6$h8fkf.JIshjmaupc$uARnGcVUbdVaUjndEznoyNeIG5nbaOqnFHR5g.4jtBasbwLPflJ2EllcNrhXM6NRZS/xFriClROmwsLatwg2D1
# System timezone
timezone Asia/Shanghai --isUtc
# System bootloader configuration
#bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# Partition clearing information
#clearpart --all --initlabel --drives=sda
# Disk partitioning information
#part / --fstype="xfs" --ondisk=sda --size=51200
#part /boot --fstype="xfs" --ondisk=sda --size=1024
#part /boot/efi --fstype="efi" --ondisk=sda --size=200 --fsoptions="umask=0077,shortname=winnt"
#part swap --fstype="swap" --ondisk=sda --size=4096
#part /home --fstype="xfs" --ondisk=sda --size=2689078
%packages
@^kylin-desktop-environment
%end
%addon com_redhat_kdump --enable --reserve-mb=1024M
%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
systemctl restart nfs.service
2.2 tftp和 xinetd 服务搭建
yum install -y tftp-server xinetd
vim /etc/xinetd.d/tftp
将 disable = yes 改为 no
cp -avp /V10SP2/EFI/BOOT/grubx64.efi /var/lib/tftpboot
cp -avp /V10SP2/EFI/BOOT/grub.cfg /var/lib/tftpboot
cp -avp /V10SP2/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/
mkdir /var/lib/tftpboot/UEFI
chmod -R 777 /var/lib/tftpboot/UEFI
cp -avp /V10SP2/EFI/BOOT/grubx64.efi /var/lib/tftpboot/UEFI
cp -avp /V10SP2/EFI/BOOT/grub.cfg /var/lib/tftpboot/UEFI
cp -avp /V10SP2/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/UEFI
cd /var/lib/tftpboot/UEFI && restorecon -v *
vim /var/lib/tftpboot/UEFI/grub.cfg
修改如下:
set default="0"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=60
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l 'Kylin-Server-10'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Install Kylin Linux Advanced Server V10' --class fedora --class gnu-linux --class gnu --class os {
# linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Kylin-Server-10 quiet
# initrdefi /images/pxeboot/initrd.img
linuxefi vmlinuz inst.ks=nfs:192.168.1.100:/kickstart/ks.cfg nvme_core.multipath=N
initrdefi initrd.img
}
systemctl restart tftp.service
systemctl restart xinetd
2.3 dhcp 服务搭建
yum install -y dhcp
vim /etc/dhcp/dhcpd.conf
内容如下
subnet 192.30.101.0 netmask 255.255.255.0{
range 192.30.101.100 192.30.101.110;
default-lease-time 6000;
max-lease-time 7200;
option time-offset -3600;
}
class "pxeclients"{
match if substring(option vendor-class-identifier,0,9)="PXEClient";
next-server 192.168.1.100;
filename "UEFI/grubx64.efi";
}
systemctl restart dhcpd
setenforce 0
systemctl stop firwalld&& systemctl disable firewalld
备注:由于配置了kickstart。部分参数已经预配置系统无需人工干预,分区部分需要自定义,所有配置设置完成开始安装。安装完成后系统会自动重启,root用户默认密码qwer1234。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。