| 1 |
#! /bin/sh
|
| 2 |
|
| 3 |
# (c) Thomas Lange, 2001-2003, lange@debian.org
|
| 4 |
|
| 5 |
# disable fsck on ext3 filesystems
|
| 6 |
partitions=`mount|grep $target |grep "type ext3"|perl -ane 'print "$F[0] "'`
|
| 7 |
for part in $partitions; do
|
| 8 |
echo "Disable periodic fsck on $part"
|
| 9 |
tune2fs -c 0 -i 0 $part
|
| 10 |
done
|
| 11 |
|
| 12 |
# install additional packags that are located in /fai/files/packages/
|
| 13 |
if [ ! -f /fai/files/packages/Packages.gz ]; then
|
| 14 |
# Mm. It seems not to be a simple repository. I assume it's configured in sources.list
|
| 15 |
echo "Directory /fai/files/packages/ seems not to be a simple repository."
|
| 16 |
fi
|
| 17 |
# create dummy link, so package kernel-image-* makes new correct link
|
| 18 |
ln -s /boot/vmlinuz-nolink $target/vmlinuz
|
| 19 |
fcopy /etc/kernel-img.conf
|
| 20 |
[ "$addpackages" ] && yes '' | $ROOTCMD apt-get install $addpackages
|
| 21 |
|
| 22 |
# xmcd loops when doing an automatic installation
|
| 23 |
ifclass AUDIO && {
|
| 24 |
yes 'n' | $ROOTCMD apt-get install xmcd
|
| 25 |
fcopy -r /etc/xmcd/
|
| 26 |
}
|
| 27 |
|
| 28 |
fcopy /etc/hostname || echo $HOSTNAME > $target/etc/hostname
|
| 29 |
echo $time_zone > $target/etc/timezone
|
| 30 |
ln -fs /usr/share/zoneinfo/${time_zone} $target/etc/localtime
|
| 31 |
|
| 32 |
fcopy -M /etc/hosts /etc/motd
|
| 33 |
|
| 34 |
# make /root accessable only by root
|
| 35 |
chmod 0700 $target/root
|
| 36 |
chown root:root $target/root
|
| 37 |
# copy default dotfiles for root account
|
| 38 |
fcopy -r /root
|
| 39 |
|
| 40 |
# create keyboard layput table
|
| 41 |
dumpkeys | gzip -9f >$target/etc/console/boottime.kmap.gz
|
| 42 |
|
| 43 |
# create NIS/NONIS config
|
| 44 |
fcopy -M /etc/nsswitch.conf /etc/host.conf
|
| 45 |
fcopy -i /etc/ypserv.securenets # only for yp server
|
| 46 |
ifclass NONIS && rm -f $target/etc/defaultdomain
|
| 47 |
if ifclass NIS; then
|
| 48 |
echo $YPDOMAIN > $target/etc/defaultdomain
|
| 49 |
rm -f $target/etc/yp.conf
|
| 50 |
for s in $YPSRVR; do
|
| 51 |
echo "ypserver $s" >> $target/etc/yp.conf
|
| 52 |
done
|
| 53 |
fi
|
| 54 |
|
| 55 |
ifclass USR_LOCAL_COPY && {
|
| 56 |
# you have to mount /usr/local
|
| 57 |
# mount -o ro $bserver:/usr/local /usr/local
|
| 58 |
cp -a /usr/local $target/usr
|
| 59 |
}
|
| 60 |
|
| 61 |
ifclass USR_LOCAL_RSYNC && {
|
| 62 |
echo "Syncing /usr/local via $LOGUSER@$bserver"
|
| 63 |
vopt=
|
| 64 |
[ "$verbose" ] && vopt=-v
|
| 65 |
rsync $vopt --delete -a $LOGUSER@$bserver:/usr/local/ $target/usr/local/
|
| 66 |
}
|
| 67 |
|
| 68 |
fcopy -M /etc/X11/XF86Config-4 && rm -f /etc/X11/XF86Config
|
| 69 |
fcopy -M /etc/X11/XF86Config && rm -f /etc/X11/XF86Config-4
|
| 70 |
|
| 71 |
# put CD-ROM into fstab and exports
|
| 72 |
# if cdromdevice is defined in *.var, use that value
|
| 73 |
# if you have both a SCSI and an IDE CD-ROM -> Uuuuups, this will fail
|
| 74 |
# if you have an IDE CDROM (mostly hdc) but you are using the ide-scsi driver,
|
| 75 |
# this IDE CDROM will be sr0, nopt hdc. So the auto detect in the following lines will fail
|
| 76 |
[ "$cdromdevice" ] || cdromdevice=`grep -H cdrom /proc/ide/hd*/media | head -1 | awk -F/ '{print $4}'`
|
| 77 |
[ "$cdromdevice" ] || cdromdevice=`grep -q CD-ROM /proc/scsi/scsi && echo "sr0"`
|
| 78 |
if [ "$cdromdevice" ]; then
|
| 79 |
echo "/dev/$cdromdevice /cdrom auto ro,user,nohide,noauto 0 0" >>$target/etc/fstab
|
| 80 |
echo "/cdrom *(ro)" >> $target/etc/exports
|
| 81 |
fi
|
| 82 |
# if a second cd-rom exists we assume that this is the cd-writer
|
| 83 |
if [ `grep "Type:.*CD-ROM" /proc/scsi/scsi | wc -l` -gt 1 ]; then
|
| 84 |
echo "/dev/sr1 /cdrec auto ro,user,nohide,noauto 0 0" >>$target/etc/fstab
|
| 85 |
echo "/cdrec *(ro)" >> $target/etc/exports
|
| 86 |
mkdir $target/cdrec
|
| 87 |
fi
|
| 88 |
|
| 89 |
# copy bootsector programm to local disk
|
| 90 |
[ -d /usr/local/sbin ] && cp -p /usr/sbin/bootsector $target/usr/local/sbin
|
| 91 |
|
| 92 |
# copy ldp.conf if printing is done via Network and NIS
|
| 93 |
ifclass NISLPRCLIENT && {
|
| 94 |
$ROOTCMD update-rc.d -f lprng remove
|
| 95 |
fcopy /usr/local/share/LPRng/pcfilter
|
| 96 |
rm -f $target/etc/cron.daily/lprng
|
| 97 |
}
|
| 98 |
|
| 99 |
# install local cron jobs
|
| 100 |
ftar /etc/cron.d
|
| 101 |
|
| 102 |
fcopy -iM /etc/auto.master /etc/auto.scratch
|
| 103 |
|
| 104 |
# copy for all NET_9 Linux-Clients exim.conf
|
| 105 |
fcopy -M /etc/exim/exim.conf /etc/aliases
|
| 106 |
|
| 107 |
# add a demo user account
|
| 108 |
ifclass DEMO && $ROOTCMD adduser --disabled-login --gecos "fai demo user" demo
|