网络安装OS(配置文件)

●无人值守安装KS文件(redhat用,删除下面中文)。

#LinuxIParm Config File
#Generated by LinuxIParm Configurator
#Boot Model UEFI
#System language
lang en_US
#System keyboard
keyboard jp106
#System timzone
timezone --utc Asia/ShaiHang
#System password
rootpw --iscrypted $$MnJHnXr8$C/yT9HAX/wM3XjxlkabXW0
#Reboot after installation
reboot
#install Linux intead of upgrade
install
#Use NFS installation media
nfs --server 192.168.0.20 --dir /(替换为NFS共享目录)/redhat7
#System bootloader configulation
bootloader --location=mbr
#Clear the Master Boot Record
zerombr
#Clear Partitions from the disk
clearpart --all --initlabel
#Disk partition information
part /boot/efi --fstype ext3 --size
part / --fstype ext3 --size
part /boot --fstype ext3 --size
#Use dhcp networking
network --bootproto dhcp --hostname redhat7UEFI
#System authorization information
auth --useshadow --enablemd5
#Firewall configuration
firewall --disabled
#XWindows configuration information
skipx
#Package install information
%packages
@ Core
@ X Window System
@ Development Tools
@ Network File System Client
glibc-*.i686
libgcc-*.i686
nss-softokn-freebl-*.i686
%end
#Script Command after install
%post #Auto Add APP Client
#Auto Add IA- Mode
NFSSERVER=192.168.0.20
APPServer=192.168.0.20 //TFTP所在服务器
#Dir Making
APPHOME=/opt/APPclient
mkdir -p $APPHOME
mkdir $APPHOME/APP
mkdir $APPHOME/APP/etc
mkdir $APPHOME/APP/bin
mkdir $APPHOME/APP/log
mkdir $APPHOME/APP/obj
#Mount /mnt/(替换为NFS共享目录)
mkdir /mnt
mkdir /mnt/test_For
/bin/mount -o nolock -t nfs $NFSSERVER:/(替换为NFS共享目录) /mnt/test_For
#File Copy(要做的处理)
rm -f $APPHOME/APP/bin/test.sh
cp -p /mnt/(替换为NFS共享目录)/某个文件夹/test.sh $APPHOME/bin
chmod $APPHOME/APP/bin/test.sh #UnMount /mnt/test_For
/bin/umount /mnt/test_For
#Delete MountPoint
rmdir /mnt/test_For
/bin/systemctl enable test-rc.service
/bin/systemctl daemon-reload
cp -p /etc/test-rc /etc/test-rc.org
sed -i '/^exit 0$/d' /etc/test-rc
echo "" >> /etc/test-rc
echo "chown root /etc/systemd/system/test.service" >> /etc/test-rc
echo "chgrp root /etc/systemd/system/test.service" >> /etc/test-rc
echo "chown root /usr/local/bin/testcancel" >> /etc/test-rc
echo "chgrp root /usr/local/bin/testcancel" >> /etc/test-rc
echo "chown -R root $APPHOME/APP" >> /etc/test-rc
echo "chgrp -R root $APPHOME/APP" >> /etc/test-rc
echo "cd $APPHOME/APP/bin" >> /etc/test-rc
echo "$APPHOME/APP/bin/test.sh -a" $APPServer >> /etc/test-rc
echo "exit 0" >> /etc/test-rc
chown root /etc/test-rc
chgrp root /etc/test-rc
chown root /etc/systemd/system/test-rc.service
chgrp root /etc/systemd/system/test-rc.service
%end

●ansfile应答文件(redhat用)

#LinuxIParm Config File
#LinuxOs Red Hat Enterprise Linux
#Boot Model UEFI
image=/TFTP目录/redhat7/vmlinuz
label=linux
initrd=/TFTP目录/redhat7/initrd.img
append="ks=nfs:192.168.0.20:/(替换为NFS共享目录)/ks/redhat7.cfg ksdevice=bootif IPAPPEND2"
上一篇:【Android】Retrofit网络请求Service,@Path、@Query、@QueryMap...


下一篇:sql中truncate 、delete与drop区别