[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

d-i - Automated installs



This is a kickstart file I have used for Red Hat Linux 7.3.

Using this, I can install a RHL desktop on a Celeron (about) 900 in
under 15 minutes, with no interaction.
_____________________________________________________
lang en_US
langsupport --default en_AU en_US 
keyboard us
#Probe for Mouse
mouse
timezone Australia/Perth
rootpw client-password
reboot 
bootloader --location=mbr --append='vga=6 apm=off'
clearpart --drives=hda --linux
install
#nfs --server 192.168.1.1 --dir /var/ftp/pub/linux/RedHat/7.3/ISO
url --url http://cc.computerdatasafe.com.au/RedHat/7.3u/dist
part /boot --fstype ext3 --size 25 --asprimary --ondisk hda 
part / --fstype ext3 --size 1 --grow  --ondisk hda 
part swap --size 64 --ondisk hda
network --bootproto dhcp
text
#skipx
#xconfig --noprobe --resolution 1280x1024 --depth 16 --monitor 
#xconfig --resolution 1280x1024 --depth 16  --hsync 31.5-56.5 --vsync 50.0-90.0 --startxonboot
xconfig --startxonboot
auth  --useshadow  --enablemd5  
firewall --disabled

%packages
@Network Support
@Router / Firewall
@KDE
@GNOME
@Dialup Support
@Messaging and Web Tools
@Games and Entertainment
@Software Development
@Kernel Development
vim-enhanced
vim-X11
openssh
openssh-server
openssh-clients
procinfo
perl
pine
lsof
lynx
strace
pump
#=============================
%pre
# This didn't work
#set -ex
#dd if=/dev/null of=/var/swap count=65536 size=1024
#mkswap /var/swap
#swapon /var/swap

%post --nochroot
(
echo To: root@[127.0.0.1]
echo From: RedHat-Linux-Installer@ComputerDatasafe.com.au
echo Subject: Installation of Red Hat Linux

set
set -x
cp /etc/resolv.conf /mnt/sysimage/etc
URL=$(echo ${ANACONDAARGS} | chroot /mnt/sysimage awk '{print $2}' )
BASEURL=$(chroot /mnt/sysimage dirname  ${URL} )
chroot /mnt/sysimage  wget -P /etc/init.d ${BASEURL}/ks/postinstall/ks.post
chmod +x /mnt/sysimage/etc/init.d/ks.post
chroot /mnt/sysimage chkconfig ks.post on
for p in dhcpcd lilo efax finger rsh talk mutt rsh-server telnet-server talk-server postgresql-devel \
          tux iptables-ipv6
	    do chroot /mnt/sysimage rpm --erase -v ${p}
	    done
REL=$(chroot /mnt/sysimage rpm -q redhat-release | sed -e 's=[-a-zA-Z]*==;s=-.*==')
RH=192.168.1.1
RDname=/var/ftp/pub/linux/RedHat/${REL}

NFSOPTS="user,soft,intr,noauto,exec"
echo ${RH}:${RDname}	/mnt/nfs	nfs     ${NFSOPTS}
echo ${RH}:${RDname}	/mnt/nfs	nfs     ${NFSOPTS} >>/mnt/sysimage/etc/fstab
mkdir /mnt/sysimage/mnt/nfs
ed <<. /mnt/sysimage/etc/sysctl.conf
H
/kernel.sysrq/s=0=1=
wq
.
/mnt/sysimage/bin/cp -a /tmp/ks.cfg  /mnt/sysimage/tmp/
chroot /mnt/sysimage procinfo
ls -al /tmp
) 2>&1 | chroot /mnt/sysimage /usr/sbin/sendmail -t 
_____________________________________________________

You activate it at the syslinux boot prompt. I generally edit the
configuration so as to make the timeout=1, and the default (only)
selection the one I want.

The ks file can be on a floppy, on the CD, or accessible by http/ftp
etc. Since you can use http to get it, it could be generated in the fly
using CGI or similar.

Most of the ks file seems pretty simple to me. Packages can be named
individually, or chosen as a group - think tasksel. The at symbol
signifies a package name.

The %pre script I've not found much use for, but you _can_ use it to
partition the drive.

You can have more than one %post script, and they can execute chroot to
the target system or not, and you have choice in interpreter (anyone for
Perl?).

While my %post script erases some packages that were installed, it is
now possible (might have been then too) to exclude packages by preceding
their names with a minus sign:
-sendmail


-- 

Cheers
John Summerfield

Please, no off-list mail at all at all. This address accepts mail only from Debian lists.




Reply to: