how to install kickstart on centos 5.6 i386 and config

举报
JBo 发表于 2021/08/12 09:12:33 2021/08/12
【摘要】 kickstart centos5.6-i386 config code custom define close gpgcheck certify kickstart centos5.6-i386 config code # 2016/05/29 www.bojiang.com #platform=x86, AMD64, or Intel EM64T # System aut...

kickstart centos5.6-i386 config


code


    # 2016/05/29 www.bojiang.com  
 
	#platform=x86, AMD64, or Intel EM64T
 
	# System authorization information
	auth  --useshadow  --enablemd5
 
	# System bootloader configuration
	bootloader --location=mbr
 
	# Clear the Master Boot Record
	zerombr
 
	# Partition clearing information
	clearpart --all --initlabel
 
	# Use graphical install
	graphical
 
	# Firewall configuration
	firewall --disabled
 
	# Run the Setup Agent on first boot
	firstboot --disable
 
	# System keyboard
	keyboard us
 
	# System language
	lang en_US
 
	# Installation logging level
	logging --level=info
 
	# Use network / cdrom installation
	url --url=$tree
 
	#Root password  or default_password_crypted
	rootpw --iscrypted $default_password_crypted
 
	# SELinux configuration
	selinux --disabled
 
	# System timezone
	timezone  Asia/Chongqing
 
	# Install OS instead of upgrade
	install
 
	# X Window System configuration information
	xconfig  --defaultdesktop=GNOME --depth=32 --resolution=1024x768 --startxonboot
 
	# Disk partitioning information
 
	part /boot  --fstype="ext3" --size=300
	part swap  --fstype="swap" --size=2048
	part /  --fstype="ext3" --grow --size=6000
	part /u  --fstype="ext3" --grow --size=3000
 
	# part /boot --fstype="ext3" --size=200 --ondisk sda
	# part pv.01 --size=1 --grow --ondisk sda
	# volgroup vg1 pv.01
	# logvol / --fstype="ext3"  --name="root" --vgname=vg1 --size=5500 --grow
	# logvol swap --fstype="swap"  --name="swap" --vgname=vg1 --size=1024 --grow --maxsize=2048 --recommended
	# logvol /u --fstype="ext3"  --name="u" --vgname=vg1 --size=2500
 
	# Reboot after installation
	reboot
 
	%packages
	@base-x
	@base
	@system-tools
	@gnome-desktop
	@gnome-software-development
	@development-tools
	@development-libs
	@dialup
	@core
	@editors
	@graphics
	@office
	@printing
	@sound-and-video
	@dns-server
	@ftp-server
	@java
	@java-development
	@text-internet
	@chinese-support
	@emacs
	@printing
	xorg-x11-server-Xnest
	xorg-x11-server-Xvfb
	ftp
	nmap
	wget
	curl
	imake
	-sysreport
	-syslogd
	-gtk2
	-avahi
	audit
	autofs
	nfs-utils
	ntsysv
	rsyslog
	crontabs
	vim-enhanced
	screen
	man
	ntp
	sudo
	rsync
	compiz
	emacs
	firefox
 
	%post --log=/root/ks-post.log

 
	### add local static ip address
    # echo -e  DEVICE=eth0\\nIPADDR=10.81.235.120\\nNETMASK=255.255.255.0\\nONBOOT=yes\\nBOOTPRO=static\\nUSERCTL=no > /etc/sysconfig/network-scripts/ifcfg-eth0
 
 
	### setting bash env
    # echo "/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/tester/bin"  >> /etc/profile
    # source /etc/profile
 
	### add test for 4 hours to check
    # echo "0 0,4,8,12,16,20 * * * LANG=zh_CN.GB2312 DISPLAY=:0.0 /u/sdt/bin/testchk" >> /var/spool/cron/tester
 
	### add user and password
    # groupadd tester
    # useradd -g tester tester -d /home/tester -m
	# echo "tester" | passwd tester --stdin
	### Add user tester has done
 
	### create directory
	# mkdir -p /u/temp
	# mkdir -p /media/data
	# chown -R tester:tester /u
	# chmod -R 775 /u
 
	### boot timeout close sendmail service
	# /sbin/chkconfig sendmail off
 
	### auto login  user tester to desktop by wait 10 second

custom

	# cat << 'EOF' > /etc/gdm/custom.conf
label mylinux
     # label mylinux与其他条目区分开
     menu label ^Kickstar install centos6
     # menu显示的条目的名字 centos6
     menu default
     # menu 把其他label条目下的menu default注释掉
     kernel vmlinuz
     append initrd=initrd.img ks=http://192.168.110.2/ks/ct6.cfg
     # ks告诉安装向导的内核,去哪里下载无人值守安装脚本	

	[daemon]
	TimedLoginEnable=true
	TimedLogin=tester
	TimedLoginDelay=10
	[security]
	[xdmcp]
	[gui]
	[greeter]
	[chooser]
	[debug]
	[servers]
	EOF
### add local yum repo will install rpm packages
# rm /etc/yum.repos.d/CentOS-*
	# cat << 'EOF' > /etc/yum.repos.d/base.repo
	[base]
	name=base
	baseurl=http://10.81.235.38/os/ct56
	enabled=1
	EOF

define close gpgcheck certify

	for f in /etc/yum.repos.d/*.repo
	do
		echo "gpgcheck=0" >> $f
	done

	### copy files to new system

	# cd /u/temp/
	# mount -t nfs 10.81.235.38:/var/www/html/tv/ /media/data/ -o nolock,udp
 
	# cp -a /media/data/* /u/temp/
 
	### tar -zxvf ecs-desktop-backup.tar.gz >> /root/ks-post.log 2>&1
	### tar -zxvf tv-ecs-desktop.tar.gz >> /root/ks-post.log 2>&1
	# tar -zxvf sdttmg.538.tar.gz  >> /root/ks-post.log 2>&1
	# tar -zxvf java_1.72_tv.tar.gz >> /root/ks-post.log 2>&1
 
	### tar -zxvf pro_95mm_ecs_leb.tar.gz >> /root/ks-post.log 2>&1
	### mv /u/temp/pro_95mm_ecs_leb /u/sdttmg/
	### mv /u/temp/.ecs-desktop-backup/ /home/tester/Desktop/  >> /root/ks-post.log 2>&1
	### mv /u/temp/tv-ecs-desktop/* /home/tester/Desktop/  >> /root/ks-post.log 2>&1
 
	chown -R tester:tester /u/temp/
	chmod -R 775 /u/temp/*
 
	###  copy release file to workstation
	# cp /u/temp/u/* /u/  >> /root/ks-post.log 2>&1
	# cp auto* /etc/  >> /root/ks-post.log 2>&1
	# cp hosts /etc/  >> /root/ks-post.log 2>&1
	# cp -a /u/temp/TurboECS.desktop /home/tester/Desktop/  >> /root/ks-post.log 2>&1
	# cp -a /u/temp/TurboSorter.desktop /home/tester/Desktop/  >> /root/ks-post.log 2>&1
	# mv /u/temp/u/* /u/  >> /root/ks-post.log 2>&1
	# mv /u/temp/usr/java/ /usr/  >> /root/ks-post.log 2>&1
 
	# ln -s /u/sdt/bin/ /home/tester/bin
	# rm -f /u/sdttmg/pro/*.pro
	# ln -s /u/sdttmg/pro_95mm_ecs_leb/* /u/sdttmg/pro/
 
	# chmod -R a+x /u/sdttmg/
	# chmod -R 777 /u/sdttmg/queues/
	# chown -R tester:tester /u/sdttmg/
	# chmod a+x /home/tester/Desktop/TurboECS.desktop
	# chmod a+x /home/tester/Desktop/TurboSorter.desktop
 
	# echo "10.81.235.120    v120" >> /etc/hosts
	# sed -i 's/HOSTNAME=localhost.localdomain/HOSTNAME=v120/g' /etc/sysconfig/network
 
	# umount -l /media/data
 
	%end
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。