Centos install on USB device using kickstart

Centos install on USB device using kickstart

Centos install on USB device using kickstart 150 150 Roderick Derks

# Kickstart file generated by Roderick Derks.
# Centos 5.6

#version=DEVEL
install
url –url http://freenas02.r71.nl:8080/Centos_5.6/cd1/
lang en_US.UTF-8
keyboard us
timezone –utc Europe/Amsterdam
rootpw  –iscrypted $6$AFQ9hKwPBKDUZwXd$E9nM0G2GBa4h2wDoG3D4mbK/fhpg.ER0RovPd4c5zKLHXjv7APZ7/rDAcDSvpFa2CBqq9rEdyZHYw/eY13EON.
selinux –disabled
authconfig –enableshadow –passalgo=sha512 –enablefingerprint
firewall –enabled –ssh –http

#ask for network config during installation
#network –device=eth0 –bootproto=query

reboot

bootloader –location=mbr –driveorder=sda –append="acpi=off"
clearpart –linux –drives=sda
part /boot –fstype ext3 –size=100 –ondisk=sda
part pv.6 –size=0 –grow –ondisk=sda
volgroup VolGroup00 –pesize=32768 pv.6
logvol swap –fstype swap –name=LogVol01 –vgname=VolGroup00 –size=500 –grow –maxsize=2016
logvol / –fstype ext3 –name=LogVol00 –vgname=VolGroup00 –size=1500 –grow

#%packages
#@core
%packages –nobase
kernel-PAE
bzip2
crontabs
dhclient
logrotate
openssh
openssh-clients
openssh-server
pam_passwdqc
sudo
tcpdump
telnet
wget
which
yum
– -audit-libs-python
– -checkpolicy
– -dhcpv6-client
– -ecryptfs-utils
– -ed
– -file
– -gnu-efi
– -gpm
– -hdparm
– -kbd
– -libhugetlbfs
– -libselinux-python
– -libsemanage
– -nspr
– -nss
– -policycoreutils
– -prelink
– -selinux-policy
– -selinux-policy-targeted
– -setools
– -setserial
– -sysfsutils
– -tcl
– -udftools
– -vim-enhanced

#PRE
#%pre
#sleep 1

# POST
%post –log=/root/kickstart-post-log

rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
yum -y remove kernel iptables slang usermode wireless-tools
yum -y remove cryptsetup-luks dbus dmidecode hwdata libgpg-error libusb
yum -y remove libvolume_id libxml2-python pciutils
#yum -y remove cyrus-sasl-lib logrotate

cat >> /root/rict_install01.sh <<_POST01

# rpm-forge
cd /tmp
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -i /tmp/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm

# update Centos
yum -y check-update
yum -y update

# install apache
yum -y install httpd
service httpd start

_POST01

# backup originele rc.local maken
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.backup
# test:
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.backup2

# executable rechten geven aan het  script
chmod +x /root/rict_install01.sh

#info toevoegen aan rc.local
cat >> /etc/rc.d/rc.local <<_POST03
    # eenmalig uitvoeren  scripts
    echo —- UITVOEREN SCRIPT /root/rict_install01.sh
    /root/rict_install01.sh
    # Terugplaatsen rc.local.backup naar rc.local (restoren van origineel)
    # waardoor eenmalige uitvoer  script is gegarandeerd
    cp /etc/rc.d/rc.local /root/rc.local
    mv -f /etc/rc.d/rc.local.backup /etc/rc.d/rc.local

_POST03

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your Name (required)

Your Email (required)

Subject

Your Message

Your Name (required)

Your Email (required)

Subject

Your Message