码迷,mamicode.com
首页 > 其他好文 > 详细

网络安装OS(配置文件)

时间:2018-06-26 11:02:27      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:echo   nsfile   rmdir   app   package   jxl   art   chmod   fss   

●无人值守安装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 $1$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 200
part / --fstype ext3 --size 20000
part /boot --fstype ext3 --size 500
#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-32 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 0755 $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 7
#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"

 

网络安装OS(配置文件)

标签:echo   nsfile   rmdir   app   package   jxl   art   chmod   fss   

原文地址:https://www.cnblogs.com/mountain2011/p/9227257.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!