Subversion Repositories livecd

Rev

Rev 307 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 307 Rev 335
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
###############################################################
3
###############################################################
4
#
4
#
5
# LiveCD customization script
5
# LiveCD customization script
6
# 
6
# 
7
# Run this script on a SL Installation
7
# Run this script on a SL Installation
8
# to prepare the system for a LiveCD 
8
# to prepare the system for a LiveCD 
9
#
9
#
10
# Urs Beyerle
10
# Urs Beyerle
11
#
11
#
12
###############################################################
12
###############################################################
13
 
13
 
14
### source livecd.conf
14
### source livecd.conf
15
. livecd.conf
15
. livecd.conf
16
 
16
 
17
###############################################################
17
###############################################################
18
 
18
 
19
function usage() {
19
function usage() {
20
 
20
 
21
   ## Usage
21
   ## Usage
22
   # ----------------------------------------------------------
22
   # ----------------------------------------------------------
23
 
23
 
24
   cat <<EOF
24
   cat <<EOF
25
 
25
 
26
   Optional Options:
26
   Optional Options:
27
 
27
 
28
    -h:       print this screen
28
    -h:       print this screen
29
    -psi:     customize for PSI Live CD
29
    -psi:     customize for PSI Live CD
30
    -dvd:     customize for Live DVD
30
    -dvd:     customize for Live DVD
31
    -mini:    customize for Mini Live CD
31
    -mini:    customize for Mini Live CD
32
 
32
 
33
EOF
33
EOF
34
 
34
 
35
}
35
}
36
 
36
 
37
###############################################################
37
###############################################################
38
 
38
 
39
###############################################################
39
###############################################################
40
# Definitions
40
# Definitions
41
###############################################################
41
###############################################################
42
 
42
 
43
### read options from command-line
43
### read options from command-line
44
PSI=""
44
PSI=""
45
while [ $# -gt 0 ]; do
45
while [ $# -gt 0 ]; do
46
 
46
 
47
    case "$1" in
47
    case "$1" in
48
       -h)
48
       -h)
49
            usage; exit;;
49
            usage; exit;;
50
       -psi)
50
       -psi)
51
            PSI=-psi; shift; continue;;
51
            PSI=-psi; shift; continue;;
52
       -dvd)
52
       -dvd)
53
            DVD=-dvd; shift; continue;;
53
            DVD=-dvd; shift; continue;;
54
       -mini)
54
       -mini)
55
            MINI=-mini; shift; continue;;
55
            MINI=-mini; shift; continue;;
56
       *)
56
       *)
57
            usage; exit;;
57
            usage; exit;;
58
    esac
58
    esac
59
 
59
 
60
done
60
done
61
 
61
 
62
### arch x86_64 or i686 ?
62
### arch x86_64 or i686 ?
63
ARCH=$( /bin/arch )
63
ARCH=$( /bin/arch )
64
[ "$ARCH" != "x86_64" ] && ARCH=i686
64
[ "$ARCH" != "x86_64" ] && ARCH=i686
65
 
65
 
66
### set local username for PSI
66
### set local username for PSI
67
[ $PSI ] && LOCALUSER=l_psi
67
[ $PSI ] && LOCALUSER=l_psi
68
 
68
 
69
 
69
 
70
 
70
 
71
###############################################################
71
###############################################################
72
# Backup some original files
72
# Backup some original files
73
###############################################################
73
###############################################################
74
 
74
 
75
echo "Backup original files ..."
75
echo "Backup original files ..."
76
 
76
 
77
ori_files="/etc/init.d/netfs \
77
ori_files="/etc/init.d/netfs \
78
           /etc/init.d/autofs \
78
           /etc/init.d/autofs \
79
           /etc/init.d/halt \
79
           /etc/init.d/halt \
80
           /etc/init.d/network
80
           /etc/init.d/network
81
           /etc/init.d/functions \
81
           /etc/init.d/functions \
82
           /etc/rc.d/rc.sysinit \
82
           /etc/rc.d/rc.sysinit \
83
           /etc/sysconfig/afs \
83
           /etc/sysconfig/afs \
84
           /etc/motd \
84
           /etc/motd \
85
           /etc/redhat-release \
85
           /etc/redhat-release \
86
	   /etc/rc.d/rc.local \
86
	   /etc/rc.d/rc.local \
87
           /etc/resolv.conf"
87
           /etc/resolv.conf"
88
 
88
 
89
for file in $ori_files; do
89
for file in $ori_files; do
90
    [ ! -e ${file}.ori ] && cp -a ${file} ${file}.ori 2>/dev/null
90
    [ ! -e ${file}.ori ] && cp -a ${file} ${file}.ori 2>/dev/null
91
done
91
done
92
 
92
 
93
 
93
 
94
 
94
 
95
###############################################################
95
###############################################################
96
# Configure system
96
# Configure system
97
###############################################################
97
###############################################################
98
 
98
 
99
echo "Configure system ..."
99
echo "Configure system ..."
100
 
100
 
101
# build nvidia kernel modules 
101
# build nvidia kernel modules 
102
[ -x /usr/sbin/mknvidia ] && mknvidia
102
[ -x /usr/sbin/mknvidia ] && mknvidia
103
dkms status -m nvidia 2>/dev/null | grep -q nvidia
103
dkms status -m nvidia 2>/dev/null | grep -q nvidia
104
if [ "$?" = "0" ]; then
104
if [ "$?" = "0" ]; then
105
    # already built?
105
    # already built?
106
    dkms status -m nvidia -k $KERNEL | grep installed
106
    dkms status -m nvidia -k $KERNEL | grep installed
107
    if [ "$?" != "0" ]; then
107
    if [ "$?" != "0" ]; then
108
	module_version=$( dkms status -m nvidia | cut -d"," -f2 | cut -d":" -f1 )
108
	module_version=$( dkms status -m nvidia | cut -d"," -f2 | cut -d":" -f1 )
109
	dkms build -m nvidia -v $module_version -k $KERNEL
109
	dkms build -m nvidia -v $module_version -k $KERNEL
110
	dkms install -m nvidia -v $module_version -k $KERNEL
110
	dkms install -m nvidia -v $module_version -k $KERNEL
111
    fi
111
    fi
112
fi
112
fi
113
 
113
 
114
# build vpnclient kernel module
114
# build vpnclient kernel module
115
running_kernel=$( uname -r )
115
running_kernel=$( uname -r )
116
if [ -x /usr/sbin/mkvpnclient ]; then
116
if [ -x /usr/sbin/mkvpnclient ]; then
117
    if [ "$running_kernel" = "$KERNEL" ]; then
117
    if [ "$running_kernel" = "$KERNEL" ]; then
118
	mkvpnclient
118
	mkvpnclient
119
    else
119
    else
120
	if [ -e /lib/modules/$KERNEL/CiscoVPN/cisco_ipsec.ko ]; then
120
	if [ -e /lib/modules/$KERNEL/CiscoVPN/cisco_ipsec.ko ]; then
121
	    echo "VPN client kernel module found."
121
	    echo "VPN client kernel module found."
122
	    sleep 2
122
	    sleep 2
123
	else
123
	else
124
	    echo "VPN client kernel module could not be build ..."
124
	    echo "VPN client kernel module could not be build ..."
125
	    sleep 5
125
	    sleep 5
126
	fi
126
	fi
127
    fi
127
    fi
128
fi
128
fi
129
 
129
 
130
# Update Virus definitions 
130
# Update Virus definitions 
131
# run freshclam
131
# run freshclam
132
if [ -x /usr/bin/freshclam ]; then
132
if [ -x /usr/bin/freshclam ]; then
133
    echo; echo "Run /usr/bin/freshclam:"
133
    echo; echo "Run /usr/bin/freshclam:"
134
    /etc/init.d/clamd status || /etc/init.d/clamd start && /usr/bin/freshclam
134
    /etc/init.d/clamd status || /etc/init.d/clamd start && /usr/bin/freshclam
135
    /etc/init.d/clamd stop
135
    /etc/init.d/clamd stop
136
    echo
136
    echo
137
fi
137
fi
138
# update f-prot and uvscan
138
# update f-prot and uvscan
139
[ -x /usr/local/f-prot/tools/check-updates.pl ] && /usr/local/f-prot/tools/check-updates.pl
139
[ -x /usr/local/f-prot/tools/check-updates.pl ] && /usr/local/f-prot/tools/check-updates.pl
140
[ -x /usr/local/uvscan/update-dat ] && /usr/local/uvscan/update-dat
140
[ -x /usr/local/uvscan/update-dat ] && /usr/local/uvscan/update-dat
141
 
141
 
142
# run depmod -a for the LiveCD kernels
142
# run depmod -a for the LiveCD kernels
143
echo "Run depmod -a $KERNEL ..."
143
echo "Run depmod -a $KERNEL ..."
144
depmod -a $KERNEL
144
depmod -a $KERNEL
145
if [ $SMP ]; then
145
if [ $SMP ]; then
146
    echo "Run depmod -a ${KERNEL}smp ..."
146
    echo "Run depmod -a ${KERNEL}smp ..."
147
    depmod -a ${KERNEL}smp
147
    depmod -a ${KERNEL}smp
148
fi
148
fi
149
 
149
 
150
# delete users (just to be sure)
150
# delete users (just to be sure)
151
userdel -r $LOCALUSER 2>/dev/null
151
userdel -r $LOCALUSER 2>/dev/null
152
userdel -r l_psi 2>/dev/null
152
userdel -r l_psi 2>/dev/null
153
userdel -r sluser 2>/dev/null
153
userdel -r sluser 2>/dev/null
154
userdel -r user 2>/dev/null
154
userdel -r user 2>/dev/null
155
 
155
 
156
# copy back /etc/yum.repos.d.ori to /etc/yum.repos.d
156
# copy back /etc/yum.repos.d.ori to /etc/yum.repos.d
157
if [ -d /etc/yum.repos.d.ori ]; then
157
if [ -d /etc/yum.repos.d.ori ]; then
158
    cp -a /etc/yum.repos.d.ori /etc/yum.repos.d
158
    cp -a /etc/yum.repos.d.ori /etc/yum.repos.d
159
fi
159
fi
160
 
160
 
161
echo "done."
161
echo "done."
162
echo "--------------------------------------------"
162
echo "--------------------------------------------"
163
 
163
 
164
 
164
 
165
 
165
 
166
###############################################################
166
###############################################################
167
# Clean up and delete files
167
# Clean up and delete files
168
###############################################################
168
###############################################################
169
 
169
 
170
echo "Cleaning up ..."
170
echo "Cleaning up ..."
171
 
171
 
172
### set LANG
172
### set LANG
173
export LANG=C
173
export LANG=C
174
 
174
 
175
### stop AFS
175
### stop AFS
176
/etc/init.d/afs stop 2>/dev/null
176
/etc/init.d/afs stop 2>/dev/null
177
 
177
 
178
### clean up yum
178
### clean up yum
179
yum clean all >/dev/null
179
yum clean all >/dev/null
180
rm -rf /var/cache/yum/*
180
rm -rf /var/cache/yum/*
181
 
181
 
182
### remove cfengine log files
182
### remove cfengine log files
183
rm -f /var/cfengine/*log
183
rm -f /var/cfengine/*log
184
 
184
 
185
### delete log files
185
### delete log files
186
find /var/log/ -type f -exec rm -f {} \;
186
find /var/log/ -type f -exec rm -f {} \;
187
 
187
 
188
### clean rpm database cache
188
### clean rpm database cache
189
rm -rf /var/lib/rpm/__db.*
189
rm -rf /var/lib/rpm/__db.*
190
 
190
 
191
### clean /var/spool/mail
191
### clean /var/spool/mail
192
rm -rf /var/spool/mail/*
192
rm -rf /var/spool/mail/*
193
touch /var/spool/mail/root
193
touch /var/spool/mail/root
194
chmod 600 /var/spool/mail/root
194
chmod 600 /var/spool/mail/root
195
 
195
 
196
### delete .rpmori .rpm Files in /etc
196
### delete .rpmori .rpm Files in /etc
197
find /etc -name "*\.rpmorig" -exec rm -f {} \;
197
find /etc -name "*\.rpmorig" -exec rm -f {} \;
198
find /etc -name "*\.rpmnew"  -exec rm -f {} \;
198
find /etc -name "*\.rpmnew"  -exec rm -f {} \;
199
find /etc -name "*\.rpmsave" -exec rm -f {} \;
199
find /etc -name "*\.rpmsave" -exec rm -f {} \;
200
 
200
 
201
### delete *~ files in /etc
201
### delete *~ files in /etc
202
find /etc | grep "~$" | while read f; do rm -f "$f"; done
202
find /etc | grep "~$" | while read f; do rm -f "$f"; done
203
 
203
 
204
### clean up /root
204
### clean up /root
205
rm -f  /root/.bash_history
205
rm -f  /root/.bash_history
206
rm -f  /root/.lesshst
206
rm -f  /root/.lesshst
207
rm -f  /root/.rnd
207
rm -f  /root/.rnd
208
rm -rf /root/.emacs.d
208
rm -rf /root/.emacs.d
209
rm -f  /root/.ssh/known_hosts
209
rm -f  /root/.ssh/known_hosts
210
rm -rf /root/.subversion
210
rm -rf /root/.subversion
211
 
211
 
212
### clean AFS cache
212
### clean AFS cache
213
if [ -d /usr/vice/cache ]; then
213
if [ -d /usr/vice/cache ]; then
214
    rm -rf /usr/vice/cache
214
    rm -rf /usr/vice/cache
215
    mkdir /usr/vice/cache
215
    mkdir /usr/vice/cache
216
fi
216
fi
217
if [ -d /var/cache/openafs ]; then
217
if [ -d /var/cache/openafs ]; then
218
    rm -rf /var/cache/openafs
218
    rm -rf /var/cache/openafs
219
    mkdir /var/cache/openafs
219
    mkdir /var/cache/openafs
220
fi
220
fi
221
 
221
 
222
### clean up /var/tmp
222
### clean up /var/tmp
223
rm -rf /var/tmp/*
223
rm -rf /var/tmp/*
224
 
224
 
225
### remove root passwd
225
### remove root passwd
226
sed -i "s|^root:.*|root:\*:12943:0:99999:7:::|" /etc/shadow
226
sed -i "s|^root:.*|root:\*:12943:0:99999:7:::|" /etc/shadow
227
sed -i "s|^root:.*:0:0|root:x:0:0|" /etc/passwd
227
sed -i "s|^root:.*:0:0|root:x:0:0|" /etc/passwd
228
 
228
 
229
### remove /.autofsck
229
### remove /.autofsck
230
rm -f /.autofsck
230
rm -f /.autofsck
231
 
231
 
232
### disable cfagent 
232
### disable cfagent 
233
[ $PSI ] && mv /etc/cron.d/cfengine      /etc/cron_backup/ 2>/dev/null
233
[ $PSI ] && mv /etc/cron.d/cfengine      /etc/cron_backup/ 2>/dev/null
234
 
234
 
235
### disable psi-cronjobs
235
### disable psi-cronjobs
236
[ $PSI ] && mv /etc/cron.d/psi-cronjobs  /etc/cron_backup/ 2>/dev/null
236
[ $PSI ] && mv /etc/cron.d/psi-cronjobs  /etc/cron_backup/ 2>/dev/null
237
 
237
 
238
### disable check_update
238
### disable check_update
239
[ $PSI ] && sed -i "s|/etc/init.d/check_update|# /etc/init.d/check_update|" /etc/rc.d/rc.local.psi
239
[ $PSI ] && sed -i "s|/etc/init.d/check_update|# /etc/init.d/check_update|" /etc/rc.d/rc.local.psi
240
[ $PSI ] && chkconfig check_update off
240
[ $PSI ] && chkconfig check_update off
241
 
241
 
242
### create in /boot link to LiveCD kernel(s)
242
### create in /boot link to LiveCD kernel(s)
243
ln -fs /boot/vmlinuz-$KERNEL /boot/vmlinuz
243
ln -fs /boot/vmlinuz-$KERNEL /boot/vmlinuz
244
[ $SMP ] && ln -fs /boot/vmlinuz-${KERNEL}smp /boot/vmlinuz${SMP}
244
[ $SMP ] && ln -fs /boot/vmlinuz-${KERNEL}smp /boot/vmlinuz${SMP}
245
 
245
 
246
### remove ssh keys
246
### remove ssh keys
247
FILES_REMOVE="/etc/ssh/ssh_host_key \
247
FILES_REMOVE="/etc/ssh/ssh_host_key \
248
              /etc/ssh/ssh_host_key.pub \
248
              /etc/ssh/ssh_host_key.pub \
249
              /etc/ssh/ssh_host_rsa_key.pub \
249
              /etc/ssh/ssh_host_rsa_key.pub \
250
              /etc/ssh/ssh_host_dsa_key \
250
              /etc/ssh/ssh_host_dsa_key \
251
              /etc/ssh/ssh_host_dsa_key.pub"
251
              /etc/ssh/ssh_host_dsa_key.pub"
252
for file in $FILES_REMOVE; do
252
for file in $FILES_REMOVE; do
253
    rm -f $file
253
    rm -f $file
254
done
254
done
255
 
255
 
256
### remove useless cronjobs
256
### remove useless cronjobs
257
mkdir -p /etc/cron_backup
257
mkdir -p /etc/cron_backup
258
mv /etc/cron.d/sysstat                 /etc/cron_backup/ 2>/dev/null
258
mv /etc/cron.d/sysstat                 /etc/cron_backup/ 2>/dev/null
259
mv /etc/cron.weekly/00-makewhatis.cron /etc/cron_backup/00-makewhatis.cron.weekly 2>/dev/null
259
mv /etc/cron.weekly/00-makewhatis.cron /etc/cron_backup/00-makewhatis.cron.weekly 2>/dev/null
260
mv /etc/cron.daily/00-makewhatis.cron  /etc/cron_backup/ 2>/dev/null
260
mv /etc/cron.daily/00-makewhatis.cron  /etc/cron_backup/ 2>/dev/null
261
mv /etc/cron.daily/makewhatis.cron     /etc/cron_backup/ 2>/dev/null
261
mv /etc/cron.daily/makewhatis.cron     /etc/cron_backup/ 2>/dev/null
262
mv /etc/cron.daily/rpm                 /etc/cron_backup/ 2>/dev/null
262
mv /etc/cron.daily/rpm                 /etc/cron_backup/ 2>/dev/null
263
mv /etc/cron.daily/slocate.cron        /etc/cron_backup/ 2>/dev/null
263
mv /etc/cron.daily/slocate.cron        /etc/cron_backup/ 2>/dev/null
264
mv /etc/cron.daily/tetex.cron          /etc/cron_backup/ 2>/dev/null
264
mv /etc/cron.daily/tetex.cron          /etc/cron_backup/ 2>/dev/null
265
mv /etc/cron.daily/yum.cron            /etc/cron_backup/ 2>/dev/null
265
mv /etc/cron.daily/yum.cron            /etc/cron_backup/ 2>/dev/null
266
mv /etc/cron.daily/prelink             /etc/cron_backup/ 2>/dev/null
266
mv /etc/cron.daily/prelink             /etc/cron_backup/ 2>/dev/null
267
 
267
 
268
### remove backup of /etc/X11/xorg.conf
268
### remove backup of /etc/X11/xorg.conf
269
rm -f /etc/X11/xorg.conf.ori    2>/dev/null
269
rm -f /etc/X11/xorg.conf.ori    2>/dev/null
270
rm -f /etc/X11/xorg.conf.backup 2>/dev/null
270
rm -f /etc/X11/xorg.conf.backup 2>/dev/null
271
 
271
 
272
### remove unused dirs in /lib/modules
272
### remove unused dirs in /lib/modules
273
ls /lib/modules/ | grep -v $KERNEL | while read mod_dir; do
273
ls /lib/modules/ | grep -v $KERNEL | while read mod_dir; do
274
    rpm -qf --quiet /lib/modules/$mod_dir
274
    rpm -qf --quiet /lib/modules/$mod_dir
275
    if [ $? != "0" ]; then
275
    if [ $? != "0" ]; then
276
	if [ $mod_dir != "" ]; then
276
	if [ $mod_dir != "" ]; then
277
	    cleaned_dir=/tmp/cleaned-$( date +%Y%m%d%H%M )
277
	    cleaned_dir=/tmp/cleaned-$( date +%Y%m%d%H%M )
278
	    mkdir -p $cleaned_dir
278
	    mkdir -p $cleaned_dir
279
            echo "Move dir /lib/modules/$mod_dir to $cleaned_dir"
279
            echo "Move dir /lib/modules/$mod_dir to $cleaned_dir"
280
	    mv -f /lib/modules/$mod_dir $cleaned_dir/
280
	    mv -f /lib/modules/$mod_dir $cleaned_dir/
281
        fi
281
        fi
282
    fi
282
    fi
283
done
283
done
284
 
284
 
285
### move some unneeded files to /mini (not for LiveDVD and miniCD)
285
### move some unneeded files to /mini (not for LiveDVD and miniCD)
286
#   to save disk space
286
#   to save disk space
287
 
287
 
288
if [ ! $DVD ] && [ ! $MINI ]; then
288
if [ ! $DVD ] && [ ! $MINI ]; then
289
 
289
 
290
    echo "Move some folders to /mini, to save disk space:"
290
    echo "Move some folders to /mini, to save disk space:"
291
    mkdir -p /mini
291
    mkdir -p /mini
292
 
292
 
293
    # move some dirs in /usr/share/doc to /mini
293
    # move some dirs in /usr/share/doc to /mini
294
    mkdir -p /mini/usr/share/doc
294
    mkdir -p /mini/usr/share/doc
295
    mv -v /usr/share/doc/bash-*           /mini/usr/share/doc 2>/dev/null
295
    mv -v /usr/share/doc/bash-*           /mini/usr/share/doc 2>/dev/null
296
    mv -v /usr/share/doc/cups-*           /mini/usr/share/doc 2>/dev/null
296
    mv -v /usr/share/doc/cups-*           /mini/usr/share/doc 2>/dev/null
297
    mv -v /usr/share/doc/dialog-*         /mini/usr/share/doc 2>/dev/null    
297
    mv -v /usr/share/doc/dialog-*         /mini/usr/share/doc 2>/dev/null    
298
    mv -v /usr/share/doc/exim-*           /mini/usr/share/doc 2>/dev/null
298
    mv -v /usr/share/doc/exim-*           /mini/usr/share/doc 2>/dev/null
299
    mv -v /usr/share/doc/foomatic-*       /mini/usr/share/doc 2>/dev/null
299
    mv -v /usr/share/doc/foomatic-*       /mini/usr/share/doc 2>/dev/null
300
    mv -v /usr/share/doc/gawk-*           /mini/usr/share/doc 2>/dev/null
300
    mv -v /usr/share/doc/gawk-*           /mini/usr/share/doc 2>/dev/null
301
    mv -v /usr/share/doc/gcc-*            /mini/usr/share/doc 2>/dev/null
301
    mv -v /usr/share/doc/gcc-*            /mini/usr/share/doc 2>/dev/null
302
    mv -v /usr/share/doc/gdm-*            /mini/usr/share/doc 2>/dev/null
302
    mv -v /usr/share/doc/gdm-*            /mini/usr/share/doc 2>/dev/null
303
    mv -v /usr/share/doc/ghostscript-*    /mini/usr/share/doc 2>/dev/null
303
    mv -v /usr/share/doc/ghostscript-*    /mini/usr/share/doc 2>/dev/null
304
    mv -v /usr/share/doc/gnome-vfs2-*     /mini/usr/share/doc 2>/dev/null
304
    mv -v /usr/share/doc/gnome-vfs2-*     /mini/usr/share/doc 2>/dev/null
305
    mv -v /usr/share/doc/gnuplot-*        /mini/usr/share/doc 2>/dev/null
305
    mv -v /usr/share/doc/gnuplot-*        /mini/usr/share/doc 2>/dev/null
306
    mv -v /usr/share/doc/initscripts-*    /mini/usr/share/doc 2>/dev/null
306
    mv -v /usr/share/doc/initscripts-*    /mini/usr/share/doc 2>/dev/null
307
    mv -v /usr/share/doc/iproute-*        /mini/usr/share/doc 2>/dev/null
307
    mv -v /usr/share/doc/iproute-*        /mini/usr/share/doc 2>/dev/null
308
    mv -v /usr/share/doc/lame-*           /mini/usr/share/doc 2>/dev/null
308
    mv -v /usr/share/doc/lame-*           /mini/usr/share/doc 2>/dev/null
309
    mv -v /usr/share/doc/libsigc++20-*    /mini/usr/share/doc 2>/dev/null
309
    mv -v /usr/share/doc/libsigc++20-*    /mini/usr/share/doc 2>/dev/null
310
    mv -v /usr/share/doc/libxslt-*        /mini/usr/share/doc 2>/dev/null
310
    mv -v /usr/share/doc/libxslt-*        /mini/usr/share/doc 2>/dev/null
311
    mv -v /usr/share/doc/m2crypto-*       /mini/usr/share/doc 2>/dev/null
311
    mv -v /usr/share/doc/m2crypto-*       /mini/usr/share/doc 2>/dev/null
312
    mv -v /usr/share/doc/ntp-*            /mini/usr/share/doc 2>/dev/null
312
    mv -v /usr/share/doc/ntp-*            /mini/usr/share/doc 2>/dev/null
313
    mv -v /usr/share/doc/openafs-*        /mini/usr/share/doc 2>/dev/null
313
    mv -v /usr/share/doc/openafs-*        /mini/usr/share/doc 2>/dev/null
314
    mv -v /usr/share/doc/pam-*            /mini/usr/share/doc 2>/dev/null
314
    mv -v /usr/share/doc/pam-*            /mini/usr/share/doc 2>/dev/null
315
    mv -v /usr/share/doc/pine-*           /mini/usr/share/doc 2>/dev/null
315
    mv -v /usr/share/doc/pine-*           /mini/usr/share/doc 2>/dev/null
316
    mv -v /usr/share/doc/pygtk2-*         /mini/usr/share/doc 2>/dev/null
316
    mv -v /usr/share/doc/pygtk2-*         /mini/usr/share/doc 2>/dev/null
317
    mv -v /usr/share/doc/htdig-*          /mini/usr/share/doc 2>/dev/null
317
    mv -v /usr/share/doc/htdig-*          /mini/usr/share/doc 2>/dev/null
318
    mv -v /usr/share/doc/ImageMagick-*    /mini/usr/share/doc 2>/dev/null
318
    mv -v /usr/share/doc/ImageMagick-*    /mini/usr/share/doc 2>/dev/null
319
    mv -v /usr/share/doc/isdn4k-utils-*   /mini/usr/share/doc 2>/dev/null
319
    mv -v /usr/share/doc/isdn4k-utils-*   /mini/usr/share/doc 2>/dev/null
-
 
320
    mv -v /usr/share/doc/rpm-*            /mini/usr/share/doc 2>/dev/null
320
    mv -v /usr/share/doc/rsyslog-*        /mini/usr/share/doc 2>/dev/null
321
    mv -v /usr/share/doc/rsyslog-*        /mini/usr/share/doc 2>/dev/null
321
    mv -v /usr/share/doc/sane-backends-*  /mini/usr/share/doc 2>/dev/null
322
    mv -v /usr/share/doc/sane-backends-*  /mini/usr/share/doc 2>/dev/null
322
    mv -v /usr/share/doc/selinux-policy-* /mini/usr/share/doc 2>/dev/null
323
    mv -v /usr/share/doc/selinux-policy-* /mini/usr/share/doc 2>/dev/null
323
    mv -v /usr/share/doc/testdisk-*       /mini/usr/share/doc 2>/dev/null
324
    mv -v /usr/share/doc/testdisk-*       /mini/usr/share/doc 2>/dev/null
324
    mv -v /usr/share/doc/xdialog-*        /mini/usr/share/doc 2>/dev/null
325
    mv -v /usr/share/doc/xdialog-*        /mini/usr/share/doc 2>/dev/null
325
 
326
 
326
    mkdir -p /mini/usr/share/backgrounds/images
327
    mkdir -p /mini/usr/share/backgrounds/images
327
    mv -v /usr/share/backgrounds/images/*.gz /mini/usr/share/backgrounds/images/ 2>/dev/null
328
    mv -v /usr/share/backgrounds/images/*.gz /mini/usr/share/backgrounds/images/ 2>/dev/null
328
    
329
    
329
    mkdir -p /mini/usr/share/anaconda/pixmaps
330
    mkdir -p /mini/usr/share/anaconda/pixmaps
330
    mv -v /usr/share/anaconda/pixmaps/rnotes /mini/usr/share/anaconda/pixmaps/
331
    mv -v /usr/share/anaconda/pixmaps/rnotes /mini/usr/share/anaconda/pixmaps/
331
 
332
 
332
    # move zipped java source, demo, sample to /mini, if j2sdk is installed
333
    # move zipped java source, demo, sample to /mini, if j2sdk is installed
333
    java_src=$( rpm -ql j2sdk 2>/dev/null | grep /src.zip$ )
334
    java_src=$( rpm -ql j2sdk 2>/dev/null | grep /src.zip$ )
334
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
335
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
335
    java_demo=$( rpm -ql j2sdk | grep /demo$ | head -n 1 )
336
    java_demo=$( rpm -ql j2sdk | grep /demo$ | head -n 1 )
336
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
337
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
337
    java_sample=$( rpm -ql j2sdk | grep /sample$ | head -n 1 )
338
    java_sample=$( rpm -ql j2sdk | grep /sample$ | head -n 1 )
338
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
339
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
339
 
340
 
340
    # move zipped java source, demo, sample to /mini, if jdk is installed
341
    # move zipped java source, demo, sample to /mini, if jdk is installed
341
    java_src=$( rpm -ql jdk 2>/dev/null | grep /src.zip$ )
342
    java_src=$( rpm -ql jdk 2>/dev/null | grep /src.zip$ )
342
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
343
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
343
    java_demo=$( rpm -ql jdk | grep /demo$ | head -n 1 )
344
    java_demo=$( rpm -ql jdk | grep /demo$ | head -n 1 )
344
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
345
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
345
    java_sample=$( rpm -ql jdk | grep /sample$ | head -n 1 )
346
    java_sample=$( rpm -ql jdk | grep /sample$ | head -n 1 )
346
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
347
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
-
 
348
 
-
 
349
    # move mysql info to /mini
-
 
350
    mkdir -p /mini/usr/share/info
-
 
351
    mv -v /usr/share/info/mysql.info.gz /mini/usr/share/info 2>/dev/null
347
    
352
    
348
fi
353
fi
349
 
354
 
350
echo "done."
355
echo "done."
351
echo "--------------------------------------------"
356
echo "--------------------------------------------"
352
 
357
 
353
 
358
 
354
 
359
 
355
###############################################################
360
###############################################################
356
# Modify files
361
# Modify files
357
###############################################################
362
###############################################################
358
 
363
 
359
echo "Modify files ..."
364
echo "Modify files ..."
360
 
365
 
361
### create /etc/sysconfig/clock, if not existing
366
### create /etc/sysconfig/clock, if not existing
362
if [ ! -e /etc/sysconfig/clock ]; then
367
if [ ! -e /etc/sysconfig/clock ]; then
363
    echo "UTC=false" >> /etc/sysconfig/clock
368
    echo "UTC=false" >> /etc/sysconfig/clock
364
    echo "ARC=false" >> /etc/sysconfig/clock
369
    echo "ARC=false" >> /etc/sysconfig/clock
365
fi
370
fi
366
 
371
 
367
### remove AFS startup warning about cache
372
### remove AFS startup warning about cache
368
[ $PSI ] && sed  -i "/\!\!\!/d" /etc/init.d/afs
373
[ $PSI ] && sed  -i "/\!\!\!/d" /etc/init.d/afs
369
 
374
 
370
### disable umount of loop device during shutdown
375
### disable umount of loop device during shutdown
371
#   this is done really dirty at the moment:
376
#   this is done really dirty at the moment:
372
#    -> just replace "loop" with non existing device "lo_fake"
377
#    -> just replace "loop" with non existing device "lo_fake"
373
 
378
 
374
[ -e /etc/init.d/netfs ]     && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/netfs
379
[ -e /etc/init.d/netfs ]     && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/netfs
375
[ -e /etc/init.d/autofs ]    && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/autofs
380
[ -e /etc/init.d/autofs ]    && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/autofs
376
[ -e /etc/init.d/halt ]      && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/halt
381
[ -e /etc/init.d/halt ]      && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/halt
377
[ -e /etc/init.d/functions ] && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/functions
382
[ -e /etc/init.d/functions ] && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/functions
378
 
383
 
379
# do not shuttdown loopback interface
384
# do not shuttdown loopback interface
380
sed -i "s|[^#]action \$\"Shutting down loopback interface:|\t#action \$\"Shutting down loopback interface:|" /etc/init.d/network
385
sed -i "s|[^#]action \$\"Shutting down loopback interface:|\t#action \$\"Shutting down loopback interface:|" /etc/init.d/network
381
 
386
 
382
### suppress error message of already mounted devpts when doing mount -a
387
### suppress error message of already mounted devpts when doing mount -a
383
sed -i "s|mount -a -t nonfs,nfs4,smbfs,cifs,ncpfs,gfs$|mount -a -t nonfs,nfs4,smbfs,cifs,ncpfs,gfs 2>/dev/null|" /etc/init.d/netfs
388
sed -i "s|mount -a -t nonfs,nfs4,smbfs,cifs,ncpfs,gfs$|mount -a -t nonfs,nfs4,smbfs,cifs,ncpfs,gfs 2>/dev/null|" /etc/init.d/netfs
384
 
389
 
385
### copy new /etc/init.d/halt 
390
### copy new /etc/init.d/halt 
386
cp -a customize/sl${OS_RELEASE}/halt /etc/init.d/halt
391
cp -a customize/sl${OS_RELEASE}/halt /etc/init.d/halt
387
 
392
 
388
### in /etc/rc.d/rc.sysinit
393
### in /etc/rc.d/rc.sysinit
389
#   comment out 'initlog -c "fsck -T -a $rootdev $fsckoptions"' 
394
#   comment out 'initlog -c "fsck -T -a $rootdev $fsckoptions"' 
390
#   to disable fsck of root filesystem
395
#   to disable fsck of root filesystem
391
sed -i "s|\tfsck -T -a \$rootdev|\tsleep 0; #fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
396
sed -i "s|\tfsck -T -a \$rootdev|\tsleep 0; #fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
392
sed -i "s|\tinitlog -c \"fsck -T -a \$rootdev|\tsleep 0; #initlog -c \"fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
397
sed -i "s|\tinitlog -c \"fsck -T -a \$rootdev|\tsleep 0; #initlog -c \"fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
393
#   disable "Remounting root filesystem in read-write mode"
398
#   disable "Remounting root filesystem in read-write mode"
394
sed -i "s| action \$\"Remounting root filesystem| sleep 0; #action \$\"Remounting root filesystem|" /etc/rc.d/rc.sysinit
399
sed -i "s| action \$\"Remounting root filesystem| sleep 0; #action \$\"Remounting root filesystem|" /etc/rc.d/rc.sysinit
395
 
400
 
396
### start afs with option -memcache !
401
### start afs with option -memcache !
397
if [ -e /etc/sysconfig/afs ]; then
402
if [ -e /etc/sysconfig/afs ]; then
398
    if [ $PSI ]; then
403
    if [ $PSI ]; then
399
	sed -i "s|^EXTRA_OPTIONS=.*|EXTRA_OPTIONS='-fakestat -memcache'|" /etc/sysconfig/afs
404
	sed -i "s|^EXTRA_OPTIONS=.*|EXTRA_OPTIONS='-fakestat -memcache'|" /etc/sysconfig/afs
400
	sed -i "s|ENABLE_MEMCACHE='no'|ENABLE_MEMCACHE='yes'|" /etc/sysconfig/afs
405
	sed -i "s|ENABLE_MEMCACHE='no'|ENABLE_MEMCACHE='yes'|" /etc/sysconfig/afs
401
    else
406
    else
402
	# for SL4
407
	# for SL4
403
	grep -q "\-fakestat \-memcache" /etc/sysconfig/afs
408
	grep -q "\-fakestat \-memcache" /etc/sysconfig/afs
404
	if [ "$?" != "0" ]; then
409
	if [ "$?" != "0" ]; then
405
	    sed -i "s|-fakestat|-fakestat -memcache|" /etc/sysconfig/afs
410
	    sed -i "s|-fakestat|-fakestat -memcache|" /etc/sysconfig/afs
406
	fi
411
	fi
407
	# for SL5
412
	# for SL5
408
	rpm -q openafs | grep -q SL5
413
	rpm -q openafs | grep -q SL5
409
	if [ "$?" = "0" ]; then
414
	if [ "$?" = "0" ]; then
410
	    sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
415
	    sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
411
	fi
416
	fi
412
    fi
417
    fi
413
fi
418
fi
414
 
419
 
415
### source /etc/sysconfig/psi
420
### source /etc/sysconfig/psi
416
[ $PSI ] && . /etc/sysconfig/psi
421
[ $PSI ] && . /etc/sysconfig/psi
417
 
422
 
418
### Set /etc/motd
423
### Set /etc/motd
419
LiveCD="LiveCD"
424
LiveCD="LiveCD"
420
[ "$ARCH" = "x86_64" ] && LiveCD="LiveCD 64bit"
425
[ "$ARCH" = "x86_64" ] && LiveCD="LiveCD 64bit"
421
echo "Welcome to $LIVECD_OS ${LiveCD}" > /etc/motd
426
echo "Welcome to $LIVECD_OS ${LiveCD}" > /etc/motd
422
[ $PSI ] && echo "Welcome to PSI ${LiveCD} (${CLASS} ${SUBCLASS} SL${RELEASE})" > /etc/motd
427
[ $PSI ] && echo "Welcome to PSI ${LiveCD} (${CLASS} ${SUBCLASS} SL${RELEASE})" > /etc/motd
423
[ $DVD ]  && sed -i "s|CD|DVD|"    /etc/motd
428
[ $DVD ]  && sed -i "s|CD|DVD|"    /etc/motd
424
[ $MINI ] && sed -i "s|CD|MiniCD|" /etc/motd
429
[ $MINI ] && sed -i "s|CD|MiniCD|" /etc/motd
425
 
430
 
426
### Set hostname to psi or slinux (not really necessary)
431
### Set hostname to psi or slinux (not really necessary)
427
if [ $PSI ]; then
432
if [ $PSI ]; then
428
    HOSTNAME="psi"
433
    HOSTNAME="psi"
429
    sed -i "s/hostname=.*/hostname=${HOSTNAME}.psi.ch/" /etc/ssmtp/ssmtp.conf
434
    sed -i "s/hostname=.*/hostname=${HOSTNAME}.psi.ch/" /etc/ssmtp/ssmtp.conf
430
    sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/psi
435
    sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/psi
431
else
436
else
432
    HOSTNAME="$DEFAULT_HOSTNAME"
437
    HOSTNAME="$DEFAULT_HOSTNAME"
433
fi
438
fi
434
 
439
 
435
### Change hostname
440
### Change hostname
436
sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/network
441
sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/network
437
sed -i "s/DHCP_HOSTNAME=.*/DHCP_HOSTNAME==${HOSTNAME}/" /etc/sysconfig/networking/devices/ifcfg-eth0 2>/dev/null
442
sed -i "s/DHCP_HOSTNAME=.*/DHCP_HOSTNAME==${HOSTNAME}/" /etc/sysconfig/networking/devices/ifcfg-eth0 2>/dev/null
438
 
443
 
439
### Modify /etc/redhat-release
444
### Modify /etc/redhat-release
440
ADD=" - LiveCD"
445
ADD=" - LiveCD"
441
[ $DVD ]  && ADD=" - LiveDVD"
446
[ $DVD ]  && ADD=" - LiveDVD"
442
[ $MINI ] && ADD=" - LiveMiniCD"
447
[ $MINI ] && ADD=" - LiveMiniCD"
443
if [ -e /etc/redhat-release.ori ]; then
448
if [ -e /etc/redhat-release.ori ]; then
444
    echo "$( cat /etc/redhat-release.ori )${ADD}" > /etc/redhat-release
449
    echo "$( cat /etc/redhat-release.ori )${ADD}" > /etc/redhat-release
445
fi
450
fi
446
 
451
 
447
### Set default runlevel to $RUNLEVEL
452
### Set default runlevel to $RUNLEVEL
448
if [ $RUNLEVEL ]; then
453
if [ $RUNLEVEL ]; then
449
    sed -i "s/id:.:initdefault:/id:$RUNLEVEL:initdefault:/" /etc/inittab
454
    sed -i "s/id:.:initdefault:/id:$RUNLEVEL:initdefault:/" /etc/inittab
450
fi
455
fi
451
 
456
 
452
### Edit /etc/sysconfig/desktop
457
### Edit /etc/sysconfig/desktop
453
if [ $DESKTOP ]; then
458
if [ $DESKTOP ]; then
454
    sed -i "/^DESKTOP=.*/d" /etc/sysconfig/desktop 2&>/dev/null
459
    sed -i "/^DESKTOP=.*/d" /etc/sysconfig/desktop 2&>/dev/null
455
    echo "DESKTOP=$DESKTOP" >> /etc/sysconfig/desktop
460
    echo "DESKTOP=$DESKTOP" >> /etc/sysconfig/desktop
456
fi
461
fi
457
if [ $DISPLAYMANAGER ]; then
462
if [ $DISPLAYMANAGER ]; then
458
    sed -i "/^DISPLAYMANAGER=.*/d" /etc/sysconfig/desktop 2&>/dev/null
463
    sed -i "/^DISPLAYMANAGER=.*/d" /etc/sysconfig/desktop 2&>/dev/null
459
    echo "DISPLAYMANAGER=$DISPLAYMANAGER" >> /etc/sysconfig/desktop
464
    echo "DISPLAYMANAGER=$DISPLAYMANAGER" >> /etc/sysconfig/desktop
460
fi
465
fi
461
 
466
 
462
### GDM login background
467
### GDM login background
463
if [ -e /usr/share/gdm/themes/SL/background.png ]; then
468
if [ -e /usr/share/gdm/themes/SL/background.png ]; then
464
    cp -a customize/sl${OS_RELEASE}/background.png /usr/share/gdm/themes/SL/background.png
469
    cp -a customize/sl${OS_RELEASE}/background.png /usr/share/gdm/themes/SL/background.png
465
fi
470
fi
466
 
471
 
467
### KDE default background
472
### KDE default background
468
if [ ! $PSI ]; then
473
if [ ! $PSI ]; then
469
    if [ -e /usr/share/backgrounds/images/default.png ]; then
474
    if [ -e /usr/share/backgrounds/images/default.png ]; then
470
	cp -a customize/sl${OS_RELEASE}/default.png /usr/share/backgrounds/images/default.png
475
	cp -a customize/sl${OS_RELEASE}/default.png /usr/share/backgrounds/images/default.png
471
    fi
476
    fi
472
fi
477
fi
473
 
478
 
474
### KDE startup/exit sound
479
### KDE startup/exit sound
475
if [ -e /usr/share/config/knotify.eventsrc ]; then
480
if [ -e /usr/share/config/knotify.eventsrc ]; then
476
    cp -a customize/sl/knotify.eventsrc /usr/share/config/knotify.eventsrc
481
    cp -a customize/sl/knotify.eventsrc /usr/share/config/knotify.eventsrc
477
    cp -a customize/sl/kmixrc /usr/share/config/kmixrc
482
    cp -a customize/sl/kmixrc /usr/share/config/kmixrc
478
fi
483
fi
479
 
484
 
480
### Configure SELinux
485
### Configure SELinux
481
if [ $SELINUX ]; then
486
if [ $SELINUX ]; then
482
    if [ -e /etc/selinux/config ]; then
487
    if [ -e /etc/selinux/config ]; then
483
	sed -i "s|^SELINUX=.*|SELINUX=$SELINUX|" /etc/selinux/config
488
	sed -i "s|^SELINUX=.*|SELINUX=$SELINUX|" /etc/selinux/config
484
    fi
489
    fi
485
fi
490
fi
486
 
491
 
487
### Do not like jumping CD icon when starting autorun.desktop
492
### Do not like jumping CD icon when starting autorun.desktop
488
if [ -e /etc/skel/.kde/Autostart/Autorun.desktop ]; then
493
if [ -e /etc/skel/.kde/Autostart/Autorun.desktop ]; then
489
    grep -q "StartupNotify=false" /etc/skel/.kde/Autostart/Autorun.desktop
494
    grep -q "StartupNotify=false" /etc/skel/.kde/Autostart/Autorun.desktop
490
    if [ "$?" != "0" ]; then
495
    if [ "$?" != "0" ]; then
491
	echo "StartupNotify=false" >> /etc/skel/.kde/Autostart/Autorun.desktop
496
	echo "StartupNotify=false" >> /etc/skel/.kde/Autostart/Autorun.desktop
492
    fi
497
    fi
493
fi
498
fi
494
 
499
 
495
### make thunderbird the default mail application in launchmail, if evolution is not installed
500
### make thunderbird the default mail application in launchmail, if evolution is not installed
496
#   (I don't like launchmail )
501
#   (I don't like launchmail )
497
rpm -q evolution >/dev/null 2>&1
502
rpm -q evolution >/dev/null 2>&1
498
if [ "$?" = "1" ]; then
503
if [ "$?" = "1" ]; then
499
    rpm -q thunderbird >/dev/null 2>&1
504
    rpm -q thunderbird >/dev/null 2>&1
500
    if [ "$?" = "0" ]; then
505
    if [ "$?" = "0" ]; then
501
	if [ ! -L /usr/bin/launchmail ]; then
506
	if [ ! -L /usr/bin/launchmail ]; then
502
	    mv /usr/bin/launchmail /usr/bin/launchmail.ori
507
	    mv /usr/bin/launchmail /usr/bin/launchmail.ori
503
	    ln -s /usr/bin/thunderbird /usr/bin/launchmail
508
	    ln -s /usr/bin/thunderbird /usr/bin/launchmail
504
	fi
509
	fi
505
    fi
510
    fi
506
fi
511
fi
507
 
512
 
508
### fix a bug in dag's gparted
513
### fix a bug in dag's gparted
509
if [ -e /usr/bin/run-gparted ]; then
514
if [ -e /usr/bin/run-gparted ]; then
510
    grep -q "/bin/bash" /usr/bin/run-gparted
515
    grep -q "/bin/bash" /usr/bin/run-gparted
511
    if [ "$?" != "0" ]; then
516
    if [ "$?" != "0" ]; then
512
	echo '#!/bin/bash'        > /usr/bin/run-gparted
517
	echo '#!/bin/bash'        > /usr/bin/run-gparted
513
	echo '/usr/sbin/gparted' >> /usr/bin/run-gparted
518
	echo '/usr/sbin/gparted' >> /usr/bin/run-gparted
514
	chmod 755 /usr/bin/run-gparted
519
	chmod 755 /usr/bin/run-gparted
515
    fi
520
    fi
516
fi
521
fi
517
 
522
 
518
echo "done."
523
echo "done."
519
echo "--------------------------------------------"
524
echo "--------------------------------------------"
520
 
525
 
521
 
526
 
522
 
527
 
523
###############################################################
528
###############################################################
524
# Add-ons
529
# Add-ons
525
###############################################################
530
###############################################################
526
 
531
 
527
echo "Add-ons ..."
532
echo "Add-ons ..."
528
 
533
 
529
### System icon on desktop
534
### System icon on desktop
530
if [ -d /usr/share/apps/kdesktop/DesktopLinks ]; then
535
if [ -d /usr/share/apps/kdesktop/DesktopLinks ]; then
531
    cp -a customize/System.desktop /usr/share/apps/kdesktop/DesktopLinks/
536
    cp -a customize/System.desktop /usr/share/apps/kdesktop/DesktopLinks/
532
fi
537
fi
533
 
538
 
534
### configure ICEWM
539
### configure ICEWM
535
cp -a customize/icewm/winoptions /usr/share/icewm/ 2>/dev/null
540
cp -a customize/icewm/winoptions /usr/share/icewm/ 2>/dev/null
536
cp -a customize/icewm/toolbar /usr/share/icewm/    2>/dev/null
541
cp -a customize/icewm/toolbar /usr/share/icewm/    2>/dev/null
537
cp -a customize/icewm/menu /usr/share/icewm/       2>/dev/null
542
cp -a customize/icewm/menu /usr/share/icewm/       2>/dev/null
538
 
543
 
539
### set SL theme as default theme for ICEWM
544
### set SL theme as default theme for ICEWM
540
rpm -q icewm-SL-theme >/dev/null 2>&1
545
rpm -q icewm-SL-theme >/dev/null 2>&1
541
if [ "$?" = "0" ]; then
546
if [ "$?" = "0" ]; then
542
    echo "Theme=SL/default.theme" > /usr/share/icewm/theme
547
    echo "Theme=SL/default.theme" > /usr/share/icewm/theme
543
fi
548
fi
544
 
549
 
545
### icons for icewm
550
### icons for icewm
546
cp -a /usr/share/pixmaps/qtparted.xpm /usr/share/icewm/icons/ 2>/dev/null
551
cp -a /usr/share/pixmaps/qtparted.xpm /usr/share/icewm/icons/ 2>/dev/null
547
cp -a /usr/share/gftp/gftp.xpm /usr/share/icewm/icons/ 2>/dev/null
552
cp -a /usr/share/gftp/gftp.xpm /usr/share/icewm/icons/ 2>/dev/null
548
 
553
 
549
### script to install LiveCD on local harddisk
554
### script to install LiveCD on local harddisk
550
cp -a customize/livecd-install  /usr/bin/
555
cp -a customize/livecd-install  /usr/bin/
551
 
556
 
552
### GUI for livecd-install
557
### GUI for livecd-install
553
cp -a customize/livecd-install-gui/livecd-install-gui /usr/sbin/
558
cp -a customize/livecd-install-gui/livecd-install-gui /usr/sbin/
554
ln -fs consolehelper /usr/bin/livecd-install-gui
559
ln -fs consolehelper /usr/bin/livecd-install-gui
555
cp -a customize/livecd-install-gui/livecd-install-gui.desktop /usr/share/applications/
560
cp -a customize/livecd-install-gui/livecd-install-gui.desktop /usr/share/applications/
556
cp -a customize/livecd-install-gui/livecd-install-gui.console.apps /etc/security/console.apps/livecd-install-gui
561
cp -a customize/livecd-install-gui/livecd-install-gui.console.apps /etc/security/console.apps/livecd-install-gui
557
cp -a customize/livecd-install-gui/livecd-install-gui.pam.d /etc/pam.d/livecd-install-gui
562
cp -a customize/livecd-install-gui/livecd-install-gui.pam.d /etc/pam.d/livecd-install-gui
558
 
563
 
559
### livecd-mkinitrd (used by livecd-install)
564
### livecd-mkinitrd (used by livecd-install)
560
if [ -e customize/sl${OS_RELEASE}/livecd-mkinitrd ]; then
565
if [ -e customize/sl${OS_RELEASE}/livecd-mkinitrd ]; then
561
    cp -a customize/sl${OS_RELEASE}/livecd-mkinitrd /usr/sbin/
566
    cp -a customize/sl${OS_RELEASE}/livecd-mkinitrd /usr/sbin/
562
else
567
else
563
    cp -a /sbin/mkinitrd /usr/sbin/livecd-mkinitrd
568
    cp -a /sbin/mkinitrd /usr/sbin/livecd-mkinitrd
564
fi
569
fi
565
 
570
 
566
### /usr/sbin/livecd-autologin, provides directly login over xinit
571
### /usr/sbin/livecd-autologin, provides directly login over xinit
567
cp -a customize/livecd-autologin /usr/sbin/livecd-autologin
572
cp -a customize/livecd-autologin /usr/sbin/livecd-autologin
568
chmod +x /usr/sbin/livecd-autologin
573
chmod +x /usr/sbin/livecd-autologin
569
 
574
 
570
### files for PSI User, will be copied during bootup to /home/$LOCALUSER/
575
### files for PSI User, will be copied during bootup to /home/$LOCALUSER/
571
if [ $PSI ]; then
576
if [ $PSI ]; then
572
    rm -rf /usr/share/$LOCALUSER
577
    rm -rf /usr/share/$LOCALUSER
573
    cp -a customize/$LOCALUSER /usr/share/
578
    cp -a customize/$LOCALUSER /usr/share/
574
fi
579
fi
575
 
580
 
576
### psi-menu, psi-scanvirus
581
### psi-menu, psi-scanvirus
577
if [ $PSI ]; then
582
if [ $PSI ]; then
578
    cp -a customize/psi/psi-menu /usr/bin/
583
    cp -a customize/psi/psi-menu /usr/bin/
579
    cp -a customize/psi/psi-scanvirus /usr/bin/
584
    cp -a customize/psi/psi-scanvirus /usr/bin/
580
    [ -d /usr/local/uvscan ] && cp -a customize/psi/update-dat /usr/local/uvscan/
585
    [ -d /usr/local/uvscan ] && cp -a customize/psi/update-dat /usr/local/uvscan/
581
    [ -x /usr/bin/freshclam ] && cp -a customize/psi/psi-freshclam /usr/bin/
586
    [ -x /usr/bin/freshclam ] && cp -a customize/psi/psi-freshclam /usr/bin/
582
fi
587
fi
583
 
588
 
584
echo "done."
589
echo "done."
585
echo "--------------------------------------------"
590
echo "--------------------------------------------"
586
 
591
 
587
 
592
 
588
###############################################################
593
###############################################################
589
# Create missing files
594
# Create missing files
590
###############################################################
595
###############################################################
591
 
596
 
592
echo "Create missing files ..."
597
echo "Create missing files ..."
593
 
598
 
594
###############################################################
599
###############################################################
595
# /etc/hosts
600
# /etc/hosts
596
### copy host file, if not existing
601
### copy host file, if not existing
597
[ -e /etc/hosts ] || cp -a customize/hosts /etc/hosts
602
[ -e /etc/hosts ] || cp -a customize/hosts /etc/hosts
598
[ -e /etc/sysconfig/networking/profiles/default/hosts ] || cp -a customize/hosts /etc/sysconfig/networking/profiles/default/hosts
603
[ -e /etc/sysconfig/networking/profiles/default/hosts ] || cp -a customize/hosts /etc/sysconfig/networking/profiles/default/hosts
599
 
604
 
600
 
605
 
601
###############################################################
606
###############################################################
602
# /etc/shadow
607
# /etc/shadow
603
if [ ! -e /etc/shadow ]; then
608
if [ ! -e /etc/shadow ]; then
604
    sed -i "s|\*|x|" /etc/passwd
609
    sed -i "s|\*|x|" /etc/passwd
605
    sed -i "s|^root::|root:x:|" /etc/passwd
610
    sed -i "s|^root::|root:x:|" /etc/passwd
606
    cat /etc/passwd | cut -d":" -f 1 | while read u; do echo "$u:*:12345:0:99999:1:::"; done >> /etc/shadow
611
    cat /etc/passwd | cut -d":" -f 1 | while read u; do echo "$u:*:12345:0:99999:1:::"; done >> /etc/shadow
607
    chmod 600 /etc/shadow
612
    chmod 600 /etc/shadow
608
fi
613
fi
609
 
614
 
610
# /etc/gshadow
615
# /etc/gshadow
611
if [ ! -e /etc/gshadow ]; then
616
if [ ! -e /etc/gshadow ]; then
612
    cp -a /etc/group /etc/gshadow
617
    cp -a /etc/group /etc/gshadow
613
    sed -i "s|:x:|::|"       /etc/gshadow
618
    sed -i "s|:x:|::|"       /etc/gshadow
614
    sed -i "s|:[0-9]\+:|::|" /etc/gshadow
619
    sed -i "s|:[0-9]\+:|::|" /etc/gshadow
615
    chmod 600 /etc/gshadow
620
    chmod 600 /etc/gshadow
616
fi
621
fi
617
 
622
 
618
echo "done."
623
echo "done."
619
echo "--------------------------------------------"
624
echo "--------------------------------------------"
620
 
625
 
621
 
626
 
622
 
627
 
623
###############################################################
628
###############################################################
624
# Create special files
629
# Create special files
625
###############################################################
630
###############################################################
626
 
631
 
627
echo "Create special files ..."
632
echo "Create special files ..."
628
 
633
 
629
###############################################################
634
###############################################################
630
# /etc/rc.d/init.d/kudzu-auto
635
# /etc/rc.d/init.d/kudzu-auto
631
### Noninteractive HW detection and configuration
636
### Noninteractive HW detection and configuration
632
 
637
 
633
cp -a customize/kudzu-auto /etc/rc.d/init.d/kudzu-auto
638
cp -a customize/kudzu-auto /etc/rc.d/init.d/kudzu-auto
634
chmod +x /etc/rc.d/init.d/kudzu-auto
639
chmod +x /etc/rc.d/init.d/kudzu-auto
635
chkconfig --add kudzu-auto
640
chkconfig --add kudzu-auto
636
chkconfig kudzu-auto on
641
chkconfig kudzu-auto on
637
 
642
 
638
 
643
 
639
###############################################################
644
###############################################################
640
# /etc/rc.d/init.d/runveryfirst
645
# /etc/rc.d/init.d/runveryfirst
641
### Fix some things during bootup - run VERY first
646
### Fix some things during bootup - run VERY first
642
# runveryfirst will run at the begining of /etc/rc.d/rc.sysinit
647
# runveryfirst will run at the begining of /etc/rc.d/rc.sysinit
643
 
648
 
644
cp -a customize/runveryfirst /etc/init.d/runveryfirst
649
cp -a customize/runveryfirst /etc/init.d/runveryfirst
645
chmod +x /etc/rc.d/init.d/runveryfirst
650
chmod +x /etc/rc.d/init.d/runveryfirst
646
 
651
 
647
# execute runveryfirst just before "Initialize hardware"
652
# execute runveryfirst just before "Initialize hardware"
648
grep -q runveryfirst /etc/rc.d/rc.sysinit
653
grep -q runveryfirst /etc/rc.d/rc.sysinit
649
if [ "$?" != "0" ]; then
654
if [ "$?" != "0" ]; then
650
    sed -i -e "/^# Initialize hardware/a\/etc\/init.d\/runveryfirst" /etc/rc.d/rc.sysinit
655
    sed -i -e "/^# Initialize hardware/a\/etc\/init.d\/runveryfirst" /etc/rc.d/rc.sysinit
651
fi
656
fi
652
 
657
 
653
 
658
 
654
###############################################################
659
###############################################################
655
# /etc/rc.d/init.d/runfirst
660
# /etc/rc.d/init.d/runfirst
656
### Fix some things during bootup - run first
661
### Fix some things during bootup - run first
657
# runfirst will run at the end of /etc/rc.d/rc.sysinit
662
# runfirst will run at the end of /etc/rc.d/rc.sysinit
658
 
663
 
659
cp -a customize/runfirst /etc/init.d/runfirst
664
cp -a customize/runfirst /etc/init.d/runfirst
660
chmod +x /etc/rc.d/init.d/runfirst
665
chmod +x /etc/rc.d/init.d/runfirst
661
 
666
 
662
sysinit_line="/etc/rc.d/init.d/runfirst"
667
sysinit_line="/etc/rc.d/init.d/runfirst"
663
grep -q "$sysinit_line" /etc/rc.d/rc.sysinit
668
grep -q "$sysinit_line" /etc/rc.d/rc.sysinit
664
if [ "$?" != "0" ]; then
669
if [ "$?" != "0" ]; then
665
    echo "$sysinit_line" >> /etc/rc.d/rc.sysinit
670
    echo "$sysinit_line" >> /etc/rc.d/rc.sysinit
666
    echo >> /etc/rc.d/rc.sysinit
671
    echo >> /etc/rc.d/rc.sysinit
667
fi
672
fi
668
 
673
 
669
 
674
 
670
###############################################################
675
###############################################################
671
# /etc/rc.d/init.d/runlast
676
# /etc/rc.d/init.d/runlast
672
### Fix some things during bootup - run last
677
### Fix some things during bootup - run last
673
 
678
 
674
cp -a customize/runlast /etc/init.d/runlast
679
cp -a customize/runlast /etc/init.d/runlast
675
chmod +x /etc/rc.d/init.d/runlast
680
chmod +x /etc/rc.d/init.d/runlast
676
 
681
 
677
### Add /etc/rc.d/init.d/runlast to rc.local
682
### Add /etc/rc.d/init.d/runlast to rc.local
678
LINE=/etc/rc.d/init.d/runlast
683
LINE=/etc/rc.d/init.d/runlast
679
grep -q $LINE /etc/rc.d/rc.local
684
grep -q $LINE /etc/rc.d/rc.local
680
if [ "$?" != "0" ]; then
685
if [ "$?" != "0" ]; then
681
    # add line
686
    # add line
682
    echo "" >> /etc/rc.d/rc.local
687
    echo "" >> /etc/rc.d/rc.local
683
    echo $LINE >> /etc/rc.d/rc.local
688
    echo $LINE >> /etc/rc.d/rc.local
684
    echo "" >> /etc/rc.d/rc.local    
689
    echo "" >> /etc/rc.d/rc.local    
685
fi
690
fi
686
 
691
 
687
 
692
 
688
###############################################################
693
###############################################################
689
# /usr/bin/save-localdata
694
# /usr/bin/save-localdata
690
### stores data on a usbstick
695
### stores data on a usbstick
691
cp -a customize/save-localdata /usr/bin/save-localdata
696
cp -a customize/save-localdata /usr/bin/save-localdata
692
chmod +x /usr/bin/save-localdata
697
chmod +x /usr/bin/save-localdata
693
 
698
 
694
# add /usr/bin/save-localdata to /etc/sudoers
699
# add /usr/bin/save-localdata to /etc/sudoers
695
if [ -e /etc/sudoers ]; then
700
if [ -e /etc/sudoers ]; then
696
    grep -q "save-localdata" /etc/sudoers 2>/dev/null
701
    grep -q "save-localdata" /etc/sudoers 2>/dev/null
697
    if [ "$?" != "0" ]; then
702
    if [ "$?" != "0" ]; then
698
	cp -a /etc/sudoers /etc/sudoers.ori
703
	cp -a /etc/sudoers /etc/sudoers.ori
699
	echo "$LOCALUSER ALL = NOPASSWD: /usr/bin/save-localdata" >> /etc/sudoers
704
	echo "$LOCALUSER ALL = NOPASSWD: /usr/bin/save-localdata" >> /etc/sudoers
700
    fi
705
    fi
701
fi
706
fi
702
 
707
 
703
# create menu entry
708
# create menu entry
704
cp -a customize/save-localdata.desktop /usr/share/applications/
709
cp -a customize/save-localdata.desktop /usr/share/applications/
705
 
710
 
706
 
711
 
707
###############################################################
712
###############################################################
708
# /usr/bin/set-volume
713
# /usr/bin/set-volume
709
### unmute all mixers and set volumes
714
### unmute all mixers and set volumes
710
cp -a customize/set-volume /usr/bin/set-volume
715
cp -a customize/set-volume /usr/bin/set-volume
711
chmod +x /usr/bin/set-volume
716
chmod +x /usr/bin/set-volume
712
 
717
 
713
 
718
 
714
###############################################################
719
###############################################################
715
# /etc/sysconfig/networking/devices/ifcfg-eth0
720
# /etc/sysconfig/networking/devices/ifcfg-eth0
716
# /etc/sysconfig/networking/devices/ifcfg-eth1
721
# /etc/sysconfig/networking/devices/ifcfg-eth1
717
 
722
 
718
for iface in eth0 eth1; do 
723
for iface in eth0 eth1; do 
719
 
724
 
720
    # remove it first
725
    # remove it first
721
    rm -f /etc/sysconfig/networking/devices/ifcfg-${iface} 2>/dev/null
726
    rm -f /etc/sysconfig/networking/devices/ifcfg-${iface} 2>/dev/null
722
    rm -f /etc/sysconfig/networking/profiles/default/ifcfg-${iface} 2>/dev/null
727
    rm -f /etc/sysconfig/networking/profiles/default/ifcfg-${iface} 2>/dev/null
723
    rm -f /etc/sysconfig/network-scripts/ifcfg-${iface} 2>/dev/null
728
    rm -f /etc/sysconfig/network-scripts/ifcfg-${iface} 2>/dev/null
724
 
729
 
725
    # create it, if we have a sample
730
    # create it, if we have a sample
726
    if [ -e customize/sl${OS_RELEASE}/ifcfg-${iface} ]; then
731
    if [ -e customize/sl${OS_RELEASE}/ifcfg-${iface} ]; then
727
	cp -a customize/sl${OS_RELEASE}/ifcfg-${iface} /etc/sysconfig/networking/devices/ifcfg-${iface}
732
	cp -a customize/sl${OS_RELEASE}/ifcfg-${iface} /etc/sysconfig/networking/devices/ifcfg-${iface}
728
        # make hard links
733
        # make hard links
729
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/networking/profiles/default/
734
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/networking/profiles/default/
730
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/network-scripts/
735
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/network-scripts/
731
    fi
736
    fi
732
done
737
done
733
 
738
 
734
 
739
 
735
###############################################################
740
###############################################################
736
# /etc/profile.d/setsysfont.sh
741
# /etc/profile.d/setsysfont.sh
737
### setsysfont 
742
### setsysfont 
738
cat > /etc/profile.d/setsysfont.sh <<EOF
743
cat > /etc/profile.d/setsysfont.sh <<EOF
739
# setsysfont once
744
# setsysfont once
740
if [ ! -e /tmp/.sysfont_has_been_set ]; then
745
if [ ! -e /tmp/.sysfont_has_been_set ]; then
741
    touch /tmp/.sysfont_has_been_set
746
    touch /tmp/.sysfont_has_been_set
742
    /bin/setfont 2>/dev/null
747
    /bin/setfont 2>/dev/null
743
    /sbin/setsysfont 2>/dev/null
748
    /sbin/setsysfont 2>/dev/null
744
fi
749
fi
745
EOF
750
EOF
746
chmod 755 /etc/profile.d/setsysfont.sh
751
chmod 755 /etc/profile.d/setsysfont.sh
747
 
752
 
748
 
753
 
749
###############################################################
754
###############################################################
750
# /etc/profile.d/setsysfont.csh
755
# /etc/profile.d/setsysfont.csh
751
### setsysfont 
756
### setsysfont 
752
cat > /etc/profile.d/setsysfont.csh <<EOF
757
cat > /etc/profile.d/setsysfont.csh <<EOF
753
# setsysfont once
758
# setsysfont once
754
if ( ! -e /tmp/.sysfont_has_been_set ) then
759
if ( ! -e /tmp/.sysfont_has_been_set ) then
755
    touch /tmp/.sysfont_has_been_set
760
    touch /tmp/.sysfont_has_been_set
756
    /bin/setfont 2>/dev/null
761
    /bin/setfont 2>/dev/null
757
    /sbin/setsysfont 2>/dev/null
762
    /sbin/setsysfont 2>/dev/null
758
endif
763
endif
759
EOF
764
EOF
760
chmod 755 /etc/profile.d/setsysfont.csh
765
chmod 755 /etc/profile.d/setsysfont.csh
761
 
766
 
762
 
767
 
763
###############################################################
768
###############################################################
764
# /etc/cron.d/psi
769
# /etc/cron.d/psi
765
### PSI specific cronjobs
770
### PSI specific cronjobs
766
 
771
 
767
if [ $PSI ] && [ -e customize/psi/cron_psi.sl${OS_RELEASE} ]; then
772
if [ $PSI ] && [ -e customize/psi/cron_psi.sl${OS_RELEASE} ]; then
768
    cp -a customize/psi/cron_psi.sl${OS_RELEASE} /etc/cron.d/psi 
773
    cp -a customize/psi/cron_psi.sl${OS_RELEASE} /etc/cron.d/psi 
769
    chmod +x /etc/cron.d/psi
774
    chmod +x /etc/cron.d/psi
770
fi
775
fi
771
 
776
 
772
echo "done."
777
echo "done."
773
echo "--------------------------------------------"
778
echo "--------------------------------------------"
774
 
779
 
775
 
780
 
776
 
781
 
777
###############################################################
782
###############################################################
778
# Configure services
783
# Configure services
779
###############################################################
784
###############################################################
780
 
785
 
781
echo "Configure services ..."
786
echo "Configure services ..."
782
 
787
 
783
### services off
788
### services off
784
if [ $PSI ]; then
789
if [ $PSI ]; then
785
    chkconfig cfenvd off  2>/dev/null
790
    chkconfig cfenvd off  2>/dev/null
786
    chkconfig cfexecd off 2>/dev/null
791
    chkconfig cfexecd off 2>/dev/null
787
    chkconfig cfservd off 2>/dev/null
792
    chkconfig cfservd off 2>/dev/null
788
fi
793
fi
789
if [ ! "$SERVICES_OFF" = "" ]; then
794
if [ ! "$SERVICES_OFF" = "" ]; then
790
    for service in $SERVICES_OFF; do
795
    for service in $SERVICES_OFF; do
791
	chkconfig $service off 2>/dev/null
796
	chkconfig $service off 2>/dev/null
792
    done
797
    done
793
fi
798
fi
794
 
799
 
795
### we do kudzu-auto
800
### we do kudzu-auto
796
chkconfig kudzu off 
801
chkconfig kudzu off 
797
 
802
 
798
### services on
803
### services on
799
if [ ! "$SERVICES_ON" = "" ]; then
804
if [ ! "$SERVICES_ON" = "" ]; then
800
    for service in $SERVICES_ON; do
805
    for service in $SERVICES_ON; do
801
	chkconfig $service on 2>/dev/null
806
	chkconfig $service on 2>/dev/null
802
    done
807
    done
803
fi
808
fi
804
 
809
 
805
echo "done."
810
echo "done."
806
echo "--------------------------------------------"
811
echo "--------------------------------------------"
807
 
812
 
808
 
813
 
809
###############################################################
814
###############################################################
810
# Empty files
815
# Empty files
811
###############################################################
816
###############################################################
812
 
817
 
813
echo "Empty files ..."
818
echo "Empty files ..."
814
 
819
 
815
### /etc/security/users
820
### /etc/security/users
816
if [ $PSI ]; then
821
if [ $PSI ]; then
817
    rm -f /etc/security/ssh.allow
822
    rm -f /etc/security/ssh.allow
818
    touch /etc/security/ssh.allow
823
    touch /etc/security/ssh.allow
819
fi
824
fi
820
 
825
 
821
### Files to empty
826
### Files to empty
822
FILES_TOUCH="/etc/sysconfig/hwconf \
827
FILES_TOUCH="/etc/sysconfig/hwconf \
823
             /etc/resolv.conf \
828
             /etc/resolv.conf \
824
             /etc/adjtime \
829
             /etc/adjtime \
825
             /etc/modprobe.conf \
830
             /etc/modprobe.conf \
826
             /etc/dhclient-eth0.conf"
831
             /etc/dhclient-eth0.conf"
827
 
832
 
828
for file in $FILES_TOUCH; do
833
for file in $FILES_TOUCH; do
829
    rm -rf $file
834
    rm -rf $file
830
    touch $file
835
    touch $file
831
done
836
done
832
 
837
 
833
echo "done."
838
echo "done."
834
echo "--------------------------------------------"
839
echo "--------------------------------------------"
835
 
840
 
836
 
841
 
837
 
842
 
838
###############################################################
843
###############################################################
839
# Update locate db, prelink, makewhatis
844
# Update locate db, prelink, makewhatis
840
###############################################################
845
###############################################################
841
 
846
 
842
### run updatedb
847
### run updatedb
843
if [ -x /usr/bin/updatedb ]; then
848
if [ -x /usr/bin/updatedb ]; then
844
    echo "Run updatedb..."
849
    echo "Run updatedb..."
845
    . /etc/updatedb.conf 2>/dev/null
850
    . /etc/updatedb.conf 2>/dev/null
846
    rpm -q mlocate >/dev/null
851
    rpm -q mlocate >/dev/null
847
    if [ "$?" = "0" ]; then
852
    if [ "$?" = "0" ]; then
848
	/usr/bin/updatedb -e "/media /sfs /tmp /boot /livecd /home /net /trunk"
853
	/usr/bin/updatedb -e "/media /sfs /tmp /boot /livecd /home /net /trunk"
849
    else
854
    else
850
	/usr/bin/updatedb -e /media,/tmp,/boot,/livecd,/home,/net,/trunk
855
	/usr/bin/updatedb -e /media,/tmp,/boot,/livecd,/home,/net,/trunk
851
    fi
856
    fi
852
    echo "done."
857
    echo "done."
853
fi
858
fi
854
 
859
 
855
### run prelink
860
### run prelink
856
if [ -x /etc/cron.daily/prelink ]; then
861
if [ -x /etc/cron.daily/prelink ]; then
857
    echo "Run prelink..."
862
    echo "Run prelink..."
858
    /etc/cron.daily/prelink
863
    /etc/cron.daily/prelink
859
    echo "done."
864
    echo "done."
860
fi
865
fi
861
if [ -x /etc/cron_backup/prelink ]; then
866
if [ -x /etc/cron_backup/prelink ]; then
862
    echo "Run prelink..."
867
    echo "Run prelink..."
863
    /etc/cron_backup/prelink
868
    /etc/cron_backup/prelink
864
    echo "done."
869
    echo "done."
865
fi
870
fi
866
 
871
 
867
### clean prelink log
872
### clean prelink log
868
rm -f /var/log/prelink/prelink.log 2>/dev/null
873
rm -f /var/log/prelink/prelink.log 2>/dev/null
869
rm -f /var/log/prelink.log 2>/dev/null
874
rm -f /var/log/prelink.log 2>/dev/null
870
 
875
 
871
### run makewhatis
876
### run makewhatis
872
which makewhatis >/dev/null 2>&1
877
which makewhatis >/dev/null 2>&1
873
if [ "$?" = "0" ]; then
878
if [ "$?" = "0" ]; then
874
    echo "Run makewhatis..."
879
    echo "Run makewhatis..."
875
    makewhatis -u -w
880
    makewhatis -u -w
876
fi
881
fi
877
 
882
 
878
echo "done."
883
echo "done."
879
echo "--------------------------------------------"
884
echo "--------------------------------------------"
880
 
885
 
881
###############################################################
886
###############################################################