/[fai]/trunk/templates/scripts/DEFAULT1/S01
ViewVC logotype

Contents of /trunk/templates/scripts/DEFAULT1/S01

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1292 - (hide annotations) (download)
Thu Nov 21 15:52:08 2002 UTC (10 years, 6 months ago) by lange
File size: 2887 byte(s)
add missing $target in chmod line
use one dpkg call to isntall packages
1 lange 1104 #! /bin/sh
2    
3 lange 1181 # (c) Thomas Lange, 2001-2002, lange@debian.org
4 lange 1104
5 lange 1181 # install addition packags that are located in /fai/files/packages/
6 lange 1292 [ "$addpackages" ] && cd $FAI/files/packages && dpkg -i --root=$target $addpackages
7 lange 1181
8 lange 1104 echo $HOSTNAME > $target/etc/hostname
9     echo $time_zone > $target/etc/timezone
10     ln -fs /usr/share/zoneinfo/${time_zone} $target/etc/localtime
11    
12     cat > $target/etc/network/interfaces <<-EOF
13     # generated by FAI
14 lange 1162 auto lo
15 lange 1104 iface lo inet loopback
16     EOF
17     fcopy /etc/hosts
18     echo -e "$IPADDR\t$HOSTNAME.$DOMAIN $HOSTNAME" >>$target/etc/hosts
19    
20     # make /tmp writeable for all, but only the user can remove his/her files
21     chmod 1777 $target/tmp
22     chown root:root $target/tmp
23    
24     # create keyboard layput table
25 lange 1181 dumpkeys | gzip -9f >$target/etc/console/boottime.kmap.gz
26 lange 1104
27     # create NIS/NONIS config
28     fcopy /etc/nsswitch.conf /etc/host.conf
29     ifclass NONIS && rm -f $target/etc/defaultdomain
30     if ifclass NIS; then
31     echo $YPDOMAIN > $target/etc/defaultdomain
32     rm -f $target/etc/yp.conf
33     for s in $YPSRVR; do
34     echo "ypserver $s" >> $target/etc/yp.conf
35     done
36     fi
37    
38     if [ -n "$hdparm" ]; then
39     cat > $target/etc/init.d/hdparm <<-EOF
40     #! /bin/sh
41     # added by FAI
42     # tune my harddisks
43     $hdparm
44     EOF
45     chmod a+rx $target/etc/init.d/hdparm
46     ln -s ../init.d/hdparm $target/etc/rcS.d/S61hdparm
47     fi
48    
49     # make scratch directory writeable for all;
50     ifclass SCRATCH && chmod 1777 $target/scratch
51     if ifclass FILES_SCRATCH; then
52     chmod 1777 $target/files/scratch
53     # enable kernel automounter
54     fcopy /etc/auto.master /etc/auto.scratch /etc/apt/sources/list
55     fi
56    
57     # copy default dotfiles for root account
58     fcopy /root/.bash_profile /root/.bashrc /root/.cshrc /root/.login /root/.alias /root/.emacs
59    
60     # suppress emacs errors
61     touch $target/etc/mailname
62    
63     ifclass USR_LOCAL_COPY && cp -a /usr/local $target/usr
64    
65     # make floppy read and writeable for all users
66     chmod a+rw $target/dev/fd*
67     # cdrom's are read only for all
68 lange 1292 chmod a+r $target/dev/sr*
69 lange 1104
70 lange 1292 # if $kernelimage is not a debfile, then it's the kernel version
71 lange 1104 # create dummy link, so package kernel-image-* makes new correct link
72     ln -s /boot/vmlinuz-nolink $target/vmlinuz
73    
74     if [ -f $files/packages/$kernelimage ]; then
75     yes 'n' | dpkg --root=$target -i $files/packages/$kernelimage
76     else
77     # default kernel package
78     yes 'n' | $ROOTCMD apt-get install $kernelimage
79     fi
80    
81     ifclass X11 && fcopy /etc/X11/XF86Config /etc/X11/Xserver
82    
83     # put CD-ROM into fstab
84 lange 1292 # if cdromdevice is defined in *.var, use that value
85 lange 1104 # if you have both a SCSI and an IDE CD-ROM -> Uuuuups, this will fail
86     [ "$cdromdevice" ] || cdromdevice=`grep -H cdrom /proc/ide/hd*/media | head -1 | awk -F/ '{print $4}'`
87     [ "$cdromdevice" ] || cdromdevice=`grep -q CD-ROM /proc/scsi/scsi && echo "sr0"`
88     echo "/dev/$cdromdevice /cdrom auto ro,user,nosuid,noauto 0 0" >>$target/etc/fstab
89    
90     # copy bootsector programm to local disk
91     [ -d /usr/local/sbin ] && cp -p /sbin/bootsector $target/usr/local/sbin

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5