- français
- English
Installation of Centos 6
Installation of Centos 6
Kickstart file
ks_centos.cfg : Kickstart for centos 6
- install : To install new system
- url --url=http://mirror.switch.ch/ftp/mirror/centos/6/os/x86_64 : is the mirror for centos 6
- lang en_US.UTF-8 : language
- network --onboot no --device eth1 --noipv4 --noipv6 : take ip address from boot (isolinux)
- rootpw --iscrypted ...... : password root crypted
- firewall --service=ssh : firewall by ssh protocol
- authconfig --enableshadow --passalgo=sha512 : We give the sha512 key for authentification
- selinux --disable : Of course disable security
- timezone --utc Europe/zurich
- user --name=lbm --iscrypted --password=$6$E/5..... : create user lbm with password
Partition creation (first time)
- clearpart --drives=sda,sdb --all : we format all disk (2 disks in this case, (sda, sdb))
- part / --fstype=ext4 --ondisk=sda --size=500000 : / partition on sda disk (5 GB)
- part swap --ondisk=sda --size=5000 : swap partion
- part /bordel --fstype=ext4 --ondisk=sda --grow --size=200 : The last partition of the disk is /bordel, when we put --grow take the rest of the disk, a size is mandatory, but put what you want.
- part /data --fstype=ext4 --ondisk=sdb --grow --size=200 : partition data on the second disk (sdb)
Boot loader and other stuff
- bootloader --location=mbr --append="crashkernel=auto rhgb quiet nomodeset rdblacklist=nouveau"
- firstboot --disabled
If you want only reinstall the first disk (the OS system and /bordel partition change the lines above by these lines )
###################################################################################
ignoredisk --only-use=sda
clearpart --drives=sda --all
part / --fstype=ext4 --ondisk=sda --size=50000
part swap --ondisk=sda --size=5000
part /bordel --fstype=ext4 --ondisk=sda --grow --size=200
####################################################################################
Packages ( A module in the kickstart to install packages)
%packages
@additional-devel
@base
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@desktop-platform-devel
@development
@directory-client
@eclipse
@emacs
@fonts
@general-desktop
@graphical-admin-tools
@graphics
@input-methods
@internet-applications
@internet-browser
@java-platform
@legacy-x
@network-file-system-client
@performance
@perl-runtime
@print-client
@remote-desktop-clients
@server-platform
@server-platform-devel
@tex
@technical-writing
@virtualization
@virtualization-client
@virtualization-platform
@x11
libXinerama-devel
xorg-x11-proto-devel
startup-notification-devel
libgnomeui-devel
libbonobo-devel
junit
libXau-devel
libgcrypt-devel
popt-devel
libdrm-devel
libXrandr-devel
libxslt-devel
libglade2-devel
gnutls-devel
mtools
pax
python-dmidecode
oddjob
sgpio
genisoimage
wodim
abrt-gui
desktop-file-utils
ant
rpmdevtools
jpackage-utils
rpmlint
certmonger
pam_krb5
krb5-workstation
gnome-pilot
netpbm-progs
libXmu
perl-DBD-SQLite
libvirt-java
kdebase-devel
nss-pam-ldapd
pam_ldap
%end
Post install for kickstart file.
%post
#
# Services off (all service)
#
chkconfig --level 2345 kdump off
cd /etc/rc3.d; ln -s ../rc.local S99local
cd /etc/rc5.d; ln -s ../rc.local S99local
cd
#
# Post install
#
cp /etc/rc.local /etc/rc.local.orig
cp /dev/null /etc/rc.local
cat > /etc/rc.local <<EOT
#!/bin/sh
#
# Script post installation
if [ ! -e /root/postInstall.1 ]; then
wget -q -O /root/postInstall.sh https://wiki.epfl.ch/bovigny/documents/INSTALL/postinstall.sh
chmod a+x /root/postInstall.sh
/root/postInstall.sh && touch /root/postInstall.1
fi
exit 0
EOT
chmod a+x /etc/rc.local
#
# LDAP (for identification with EPFL gaspar login)
#
authconfig --savebackup=fresh
wget -O /etc/openldap/cacerts/epflca.pem http://certauth.epfl.ch/epflca.pem
wget -O /etc/openldap/cacerts/oldepflca.pem http://certauth.epfl.ch/oldepflca.pem
cacertdir_rehash /etc/openldap/cacerts
echo nameserver 128.178.15.7 >> /etc/resolv.conf
echo search epfl.ch >> /etc/resolv.conf
perl -p -i -e 's/FORCELEGACY=no/FORCELEGACY=yes/g;' /etc/sysconfig/authconfig
authconfig --kickstart --enableshadow --passalgo=sha512 --enableldapauth --enableldap --ldapserver=ldap.epfl.ch --ldapbasedn='o=epfl,c=ch' --enableldaptls
perl -p -i -e 's/automount: +files +ldap/automount: files/g;' /etc/nsswitch.conf
#
# Autohome
#
cp /etc/auto.master /etc/auto.master.orig
perl -p -i -e 's/\+auto.master/#\+auto.master/g;' /etc/auto.master
echo '/home /etc/auto.home' >> /etc/auto.master
echo '* -fstype=nfs4 updalpe1pc5.epfl.ch:/home/&' > /etc/auto.home
#
# Fstab
#
cp /etc/fstab /etc/fstab.orig
mkdir /programs
echo 'updalpe1pc5.epfl.ch:/opt /opt nfs4 rw 0 0' >> /etc/fstab
echo 'updalpe1pc5.epfl.ch:/programs /programs nfs4 rw 0 0' >> /etc/fstab
#
# NFSv4
#
echo 'Domain = epfl.ch' >> /etc/idmapd.conf
%end