#version=RHEL7 # System authorization information auth --enableshadow --passalgo=sha512
# Use CDROM installation media cdrom
# Use text install install text
# Run the Setup Agent on first boot firstboot --disable
# Keyboard layouts keyboard --vckeymap=us --xlayouts='en_us.utf-8'
# System language lang ko_KR.UTF-8
# Network information network --bootproto=dhcp --device=eno --onboot=off --ipv6=auto network --device=lo --hostname=localhost.localdomain
# Root password rootpw --iscrypted $6$DxkJ9kjcYdHIIUv4$QitYoibBbfE3liAspeZcFzfp9jEiNFRVeY27/GVg9NmOcKsUp1wTmDTVplZqETy5ZN.vYXfRiKoSOW4zKNbLM1
# System timezone timezone Asia/Seoul --isUtc
#Selinux selinux --disabled
# System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr
# Automatic partition (remove all partition) zerombr clearpart --all --initlabel part /boot --fstype=ext4 --size=500 part pv.01 --grow --size=1 volgroup VolGroup --pesize=4096 pv.01 logvol swap --name=lv_swap --vgname=VolGroup --recommended logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1024 --maxsize=51200 logvol /opt --fstype=ext4 --name=lv_opt --vgname=VolGroup --grow --size=1 reboot
%packages @core at dialog expect freetds httpd ipvsadm libnet ntp pacemaker samba-common lrzsz vim perl mysql-community-client mysql-community-server net-snmp net-tools perl-Authen-SASL perl-Business-ISBN perl-Business-ISBN-Data perl-Convert-ASN1 perl-Crypt-SSLeay perl-Digest perl-Digest-HMAC perl-Digest-MD5 perl-Digest-SHA perl-Encode-Locale perl-File-Listing perl-GSSAPI perl-HTML-Parser perl-HTML-Tagset perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Date perl-HTTP-Message perl-HTTP-Negotiate perl-IO-HTML perl-IO-Socket-IP perl-IO-Socket-SSL perl-JSON perl-LDAP perl-LWP-MediaTypes perl-Net-DNS perl-Net-HTTP perl-Net-LibIDN perl-Net-SSLeay perl-Text-Soundex perl-Text-Unidecode perl-URI perl-WWW-RobotRules perl-XML-Filter-BufferText perl-XML-NamespaceSupport perl-XML-SAX-Base perl-XML-SAX-Writer perl-libwww-perl iptables-services openssl openssh wget gdb tcpdump %end
%post --nochroot #!/bin/sh
set -x -v exec 1>/mnt/sysimage/root/kickstart-stage1.log 2>&1
echo "==> copying files from media to install drive..." cp -r /run/install/repo/postinstall /mnt/sysimage/root
%end
%post # enable serial port cat > /etc/init/Stty.conf <<EOF stop on runlevel [016] start on runlevel [345] respawn instance /dev/ttyS0 exec /sbin/agetty /dev/ttyS0 19200 vt100 EOF echo 'ttyS0' >> /etc/securetty
# Disable SELINUX echo "SELINUX=disabled" > /etc/sysconfig/selinux echo "SELINUXTYPE=targeted" >> /etc/sysconfig/selinux
# It seems that serial console is auto detected by OS # vi environment echo 'alias vi=vim' >> /etc/bashrc echo "set tabstop=4" >> /etc/vimrc
# Language environment sed -i'' -e "/LANG/c\LANG=\"ko_KR.UTF-8\"" /etc/sysconfig/i18n
# make symbolic link of jdk mkdir /usr/java mv /root/postinstall/jdk1.8.0_66 /usr/java/ ln -s /usr/java/jdk1.8.0_66 /usr/java/j2sdk ln -s /usr/bin/xmlstarlet /usr/bin/xml
# Disable snmpd verbose logging #echo OPTIONS=\"-Lnd -Lf /dev/null -p /var/run/snmpd.pid -a\" >> /etc/sysconfig/snmpd #touch /etc/snmp/snmp.conf #ln -s /etc/rsyslog.conf /etc/syslog.conf
# Stop unneeded service at this moment /sbin/chkconfig heartbeat off /sbin/chkconfig ldirectord off /sbin/chkconfig rpcbind off /sbin/chkconfig rpcidmapd off /sbin/chkconfig nfslock off /sbin/chkconfig kdump off /sbin/chkconfig NetworkManager off /sbin/chkconfig mysqld on
# /etc/my.cnf configuration cat > /etc/my.cnf << EOF [client] port = 3306 socket = /var/lib/mysql/mysql.sock
[mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock user=mysql symbolic-links=0 max_connections = 100 binlog_cache_size = 1M max_heap_table_size = 32M key_buffer = 32M max_allowed_packet = 1M table_open_cache = 256 sort_buffer_size = 4M join_buffer_size = 4M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 16M thread_cache = 8 query_cache_size= 2M skip-character-set-client-handshake=1 thread_concurrency = 4 slave-skip-errors=1062,1146,1032 expire_logs_days=15
log-bin binlog_format=MIXED server-id= innodb_buffer_pool_size=96M innodb_log_file_size=16M innodb_log_buffer_size=1M innodb_additional_mem_pool_size=2M innodb_flush_log_at_trx_commit=2 innodb_lock_wait_timeout = 120
[mysqldump] quick max_allowed_packet = 16M add-drop-table user = anyclick password = identity databases
[mysql] no-auto-rehash user = anyclick password = identity
[isamchk] key_buffer = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M
[myisamchk] key_buffer = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M
[mysqlhotcopy] interactive-timeout
[mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid open-files-limit = 2048 EOF
#network insterface setting sed -i'' -e "s/rhgb/rhgb net.ifnames=0 biosdevname=0/" /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg
#uname change mv /usr/bin/uname /usr/bin/uname.old chmod 666 /usr/bin/uname.old
mv /root/postinstall/uname_custom /usr/bin/uname chmod 755 /usr/bin/uname
#rm /root/postinstall rm -rf /root/postinstall
#firewall disable systemctl stop firewalld systemctl mask firewalld
#iptables enable systemctl enable iptables
#ftp disable userdel ftp
reboot
%end |