Subversion Repositories livecd

Rev

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

Rev 255 Rev 258
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/exim-*           /mini/usr/share/doc 2>/dev/null
297
    mv -v /usr/share/doc/exim-*           /mini/usr/share/doc 2>/dev/null
298
    mv -v /usr/share/doc/gawk-*           /mini/usr/share/doc 2>/dev/null
298
    mv -v /usr/share/doc/gawk-*           /mini/usr/share/doc 2>/dev/null
299
    mv -v /usr/share/doc/gcc-*            /mini/usr/share/doc 2>/dev/null
299
    mv -v /usr/share/doc/gcc-*            /mini/usr/share/doc 2>/dev/null
300
    mv -v /usr/share/doc/gdm-*            /mini/usr/share/doc 2>/dev/null
300
    mv -v /usr/share/doc/gdm-*            /mini/usr/share/doc 2>/dev/null
301
    mv -v /usr/share/doc/ghostscript-*    /mini/usr/share/doc 2>/dev/null
301
    mv -v /usr/share/doc/ghostscript-*    /mini/usr/share/doc 2>/dev/null
302
    mv -v /usr/share/doc/gnome-vfs2-*     /mini/usr/share/doc 2>/dev/null
302
    mv -v /usr/share/doc/gnome-vfs2-*     /mini/usr/share/doc 2>/dev/null
303
    mv -v /usr/share/doc/gnuplot-*        /mini/usr/share/doc 2>/dev/null
303
    mv -v /usr/share/doc/gnuplot-*        /mini/usr/share/doc 2>/dev/null
304
    mv -v /usr/share/doc/initscripts-*    /mini/usr/share/doc 2>/dev/null
304
    mv -v /usr/share/doc/initscripts-*    /mini/usr/share/doc 2>/dev/null
305
    mv -v /usr/share/doc/iproute-*        /mini/usr/share/doc 2>/dev/null
305
    mv -v /usr/share/doc/iproute-*        /mini/usr/share/doc 2>/dev/null
306
    mv -v /usr/share/doc/libsigc++20-*    /mini/usr/share/doc 2>/dev/null
306
    mv -v /usr/share/doc/libsigc++20-*    /mini/usr/share/doc 2>/dev/null
307
    mv -v /usr/share/doc/m2crypto-*       /mini/usr/share/doc 2>/dev/null
307
    mv -v /usr/share/doc/m2crypto-*       /mini/usr/share/doc 2>/dev/null
308
    mv -v /usr/share/doc/ntp-*            /mini/usr/share/doc 2>/dev/null
308
    mv -v /usr/share/doc/ntp-*            /mini/usr/share/doc 2>/dev/null
309
    mv -v /usr/share/doc/openafs-*        /mini/usr/share/doc 2>/dev/null
309
    mv -v /usr/share/doc/openafs-*        /mini/usr/share/doc 2>/dev/null
310
    mv -v /usr/share/doc/pine-*           /mini/usr/share/doc 2>/dev/null
310
    mv -v /usr/share/doc/pine-*           /mini/usr/share/doc 2>/dev/null
311
    mv -v /usr/share/doc/htdig-*          /mini/usr/share/doc 2>/dev/null
311
    mv -v /usr/share/doc/htdig-*          /mini/usr/share/doc 2>/dev/null
312
    mv -v /usr/share/doc/ImageMagick-*    /mini/usr/share/doc 2>/dev/null
312
    mv -v /usr/share/doc/ImageMagick-*    /mini/usr/share/doc 2>/dev/null
313
    mv -v /usr/share/doc/isdn4k-utils-*   /mini/usr/share/doc 2>/dev/null
313
    mv -v /usr/share/doc/isdn4k-utils-*   /mini/usr/share/doc 2>/dev/null
314
    mv -v /usr/share/doc/sane-backends-*  /mini/usr/share/doc 2>/dev/null
314
    mv -v /usr/share/doc/sane-backends-*  /mini/usr/share/doc 2>/dev/null
315
    mv -v /usr/share/doc/selinux-policy-* /mini/usr/share/doc 2>/dev/null
315
    mv -v /usr/share/doc/selinux-policy-* /mini/usr/share/doc 2>/dev/null
316
    mv -v /usr/share/doc/testdisk-*       /mini/usr/share/doc 2>/dev/null
316
    mv -v /usr/share/doc/testdisk-*       /mini/usr/share/doc 2>/dev/null
317
 
317
 
318
    mkdir -p /mini/usr/share/backgrounds/images
318
    mkdir -p /mini/usr/share/backgrounds/images
319
    mv -v /usr/share/backgrounds/images/*.gz /mini/usr/share/backgrounds/images/ 2>/dev/null
319
    mv -v /usr/share/backgrounds/images/*.gz /mini/usr/share/backgrounds/images/ 2>/dev/null
320
    
320
    
321
    mkdir -p /mini/usr/share/anaconda/pixmaps
321
    mkdir -p /mini/usr/share/anaconda/pixmaps
322
    mv -v /usr/share/anaconda/pixmaps/rnotes /mini/usr/share/anaconda/pixmaps/
322
    mv -v /usr/share/anaconda/pixmaps/rnotes /mini/usr/share/anaconda/pixmaps/
323
 
323
 
324
    # move zipped java source, demo, sample to /mini, if j2sdk is installed
324
    # move zipped java source, demo, sample to /mini, if j2sdk is installed
325
    java_src=$( rpm -ql j2sdk 2>/dev/null | grep /src.zip$ )
325
    java_src=$( rpm -ql j2sdk 2>/dev/null | grep /src.zip$ )
326
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
326
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
327
    java_demo=$( rpm -ql j2sdk | grep /demo$ | head -n 1 )
327
    java_demo=$( rpm -ql j2sdk | grep /demo$ | head -n 1 )
328
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
328
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
329
    java_sample=$( rpm -ql j2sdk | grep /sample$ | head -n 1 )
329
    java_sample=$( rpm -ql j2sdk | grep /sample$ | head -n 1 )
330
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
330
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
331
 
331
 
332
    # move zipped java source, demo, sample to /mini, if jdk is installed
332
    # move zipped java source, demo, sample to /mini, if jdk is installed
333
    java_src=$( rpm -ql jdk 2>/dev/null | grep /src.zip$ )
333
    java_src=$( rpm -ql jdk 2>/dev/null | grep /src.zip$ )
334
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
334
    [ -e "$java_src" ] && mv -v "$java_src" /mini/
335
    java_demo=$( rpm -ql jdk | grep /demo$ | head -n 1 )
335
    java_demo=$( rpm -ql jdk | grep /demo$ | head -n 1 )
336
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
336
    [ -e "$java_demo" ] && mv -v "$java_demo" /mini/ 
337
    java_sample=$( rpm -ql jdk | grep /sample$ | head -n 1 )
337
    java_sample=$( rpm -ql jdk | grep /sample$ | head -n 1 )
338
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
338
    [ -e "$java_sample" ] && mv -v "$java_sample" /mini/ 
339
    
339
    
340
fi
340
fi
341
 
341
 
342
echo "done."
342
echo "done."
343
echo "--------------------------------------------"
343
echo "--------------------------------------------"
344
 
344
 
345
 
345
 
346
 
346
 
347
###############################################################
347
###############################################################
348
# Modify files
348
# Modify files
349
###############################################################
349
###############################################################
350
 
350
 
351
echo "Modify files ..."
351
echo "Modify files ..."
352
 
352
 
353
### create /etc/sysconfig/clock, if not existing
353
### create /etc/sysconfig/clock, if not existing
354
if [ ! -e /etc/sysconfig/clock ]; then
354
if [ ! -e /etc/sysconfig/clock ]; then
355
    echo "UTC=false" >> /etc/sysconfig/clock
355
    echo "UTC=false" >> /etc/sysconfig/clock
356
    echo "ARC=false" >> /etc/sysconfig/clock
356
    echo "ARC=false" >> /etc/sysconfig/clock
357
fi
357
fi
358
 
358
 
359
### remove AFS startup warning about cache
359
### remove AFS startup warning about cache
360
[ $PSI ] && sed  -i "/\!\!\!/d" /etc/init.d/afs
360
[ $PSI ] && sed  -i "/\!\!\!/d" /etc/init.d/afs
361
 
361
 
362
### disable umount of loop device during shutdown
362
### disable umount of loop device during shutdown
363
#   this is done really dirty at the moment:
363
#   this is done really dirty at the moment:
364
#    -> just replace "loop" with non existing device "lo_fake"
364
#    -> just replace "loop" with non existing device "lo_fake"
365
 
365
 
366
[ -e /etc/init.d/netfs ]     && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/netfs
366
[ -e /etc/init.d/netfs ]     && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/netfs
367
[ -e /etc/init.d/autofs ]    && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/autofs
367
[ -e /etc/init.d/autofs ]    && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/autofs
368
[ -e /etc/init.d/halt ]      && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/halt
368
[ -e /etc/init.d/halt ]      && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/halt
369
[ -e /etc/init.d/functions ] && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/functions
369
[ -e /etc/init.d/functions ] && sed -i "s|/loop/|/lo_fake/|g" /etc/init.d/functions
370
 
370
 
371
# do not shuttdown loopback interface
371
# do not shuttdown loopback interface
372
sed -i "s|[^#]action \$\"Shutting down loopback interface:|\t#action \$\"Shutting down loopback interface:|" /etc/init.d/network
372
sed -i "s|[^#]action \$\"Shutting down loopback interface:|\t#action \$\"Shutting down loopback interface:|" /etc/init.d/network
373
 
373
 
374
### suppress error message of already mounted devpts when doing mount -a
374
### suppress error message of already mounted devpts when doing mount -a
375
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
375
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
376
 
376
 
377
### copy new /etc/init.d/halt 
377
### copy new /etc/init.d/halt 
378
cp -a customize/sl${OS_RELEASE}/halt /etc/init.d/halt
378
cp -a customize/sl${OS_RELEASE}/halt /etc/init.d/halt
379
 
379
 
380
### in /etc/rc.d/rc.sysinit
380
### in /etc/rc.d/rc.sysinit
381
#   comment out 'initlog -c "fsck -T -a $rootdev $fsckoptions"' 
381
#   comment out 'initlog -c "fsck -T -a $rootdev $fsckoptions"' 
382
#   to disable fsck of root filesystem
382
#   to disable fsck of root filesystem
383
sed -i "s|\tfsck -T -a \$rootdev|\tsleep 0; #fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
383
sed -i "s|\tfsck -T -a \$rootdev|\tsleep 0; #fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
384
sed -i "s|\tinitlog -c \"fsck -T -a \$rootdev|\tsleep 0; #initlog -c \"fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
384
sed -i "s|\tinitlog -c \"fsck -T -a \$rootdev|\tsleep 0; #initlog -c \"fsck -T -a \$rootdev|" /etc/rc.d/rc.sysinit
385
#   disable "Remounting root filesystem in read-write mode"
385
#   disable "Remounting root filesystem in read-write mode"
386
sed -i "s| action \$\"Remounting root filesystem| sleep 0; #action \$\"Remounting root filesystem|" /etc/rc.d/rc.sysinit
386
sed -i "s| action \$\"Remounting root filesystem| sleep 0; #action \$\"Remounting root filesystem|" /etc/rc.d/rc.sysinit
387
 
387
 
388
### start afs with option -memcache !
388
### start afs with option -memcache !
389
if [ -e /etc/sysconfig/afs ]; then
389
if [ -e /etc/sysconfig/afs ]; then
390
    if [ $PSI ]; then
390
    if [ $PSI ]; then
391
	sed -i "s|^EXTRA_OPTIONS=.*|EXTRA_OPTIONS='-fakestat -memcache'|" /etc/sysconfig/afs
391
	sed -i "s|^EXTRA_OPTIONS=.*|EXTRA_OPTIONS='-fakestat -memcache'|" /etc/sysconfig/afs
392
	sed -i "s|ENABLE_MEMCACHE='no'|ENABLE_MEMCACHE='yes'|" /etc/sysconfig/afs
392
	sed -i "s|ENABLE_MEMCACHE='no'|ENABLE_MEMCACHE='yes'|" /etc/sysconfig/afs
393
    else
393
    else
394
	# for SL4
394
	# for SL4
395
	grep -q "\-fakestat \-memcache" /etc/sysconfig/afs
395
	grep -q "\-fakestat \-memcache" /etc/sysconfig/afs
396
	if [ "$?" != "0" ]; then
396
	if [ "$?" != "0" ]; then
397
	    sed -i "s|-fakestat|-fakestat -memcache|" /etc/sysconfig/afs
397
	    sed -i "s|-fakestat|-fakestat -memcache|" /etc/sysconfig/afs
398
	fi
398
	fi
399
	# for SL5
399
	# for SL5
400
	rpm -q openafs | grep -q SL5
400
	rpm -q openafs | grep -q SL5
401
	if [ "$?" = "0" ]; then
401
	if [ "$?" = "0" ]; then
402
	    sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
402
	    sed -i "s|^OPTIONS=.*|OPTIONS=\"-memcache\"|" /etc/sysconfig/afs
403
	fi
403
	fi
404
    fi
404
    fi
405
fi
405
fi
406
 
406
 
407
### source /etc/sysconfig/psi
407
### source /etc/sysconfig/psi
408
[ $PSI ] && . /etc/sysconfig/psi
408
[ $PSI ] && . /etc/sysconfig/psi
409
 
409
 
410
### Set /etc/motd
410
### Set /etc/motd
411
LiveCD="LiveCD"
411
LiveCD="LiveCD"
412
[ "$ARCH" = "x86_64" ] && LiveCD="LiveCD 64bit"
412
[ "$ARCH" = "x86_64" ] && LiveCD="LiveCD 64bit"
413
echo "Welcome to $LIVECD_OS ${LiveCD}" > /etc/motd
413
echo "Welcome to $LIVECD_OS ${LiveCD}" > /etc/motd
414
[ $PSI ] && echo "Welcome to PSI ${LiveCD} (${CLASS} ${SUBCLASS} SL${RELEASE})" > /etc/motd
414
[ $PSI ] && echo "Welcome to PSI ${LiveCD} (${CLASS} ${SUBCLASS} SL${RELEASE})" > /etc/motd
415
[ $DVD ]  && sed -i "s|CD|DVD|"    /etc/motd
415
[ $DVD ]  && sed -i "s|CD|DVD|"    /etc/motd
416
[ $MINI ] && sed -i "s|CD|MiniCD|" /etc/motd
416
[ $MINI ] && sed -i "s|CD|MiniCD|" /etc/motd
417
 
417
 
418
### Set hostname to psi or slinux (not really necessary)
418
### Set hostname to psi or slinux (not really necessary)
419
if [ $PSI ]; then
419
if [ $PSI ]; then
420
    HOSTNAME="psi"
420
    HOSTNAME="psi"
421
    sed -i "s/hostname=.*/hostname=${HOSTNAME}.psi.ch/" /etc/ssmtp/ssmtp.conf
421
    sed -i "s/hostname=.*/hostname=${HOSTNAME}.psi.ch/" /etc/ssmtp/ssmtp.conf
422
    sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/psi
422
    sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/psi
423
else
423
else
424
    HOSTNAME="$DEFAULT_HOSTNAME"
424
    HOSTNAME="$DEFAULT_HOSTNAME"
425
fi
425
fi
426
 
426
 
427
### Change hostname
427
### Change hostname
428
sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/network
428
sed -i "s/HOSTNAME=.*/HOSTNAME=${HOSTNAME}/" /etc/sysconfig/network
429
sed -i "s/DHCP_HOSTNAME=.*/DHCP_HOSTNAME==${HOSTNAME}/" /etc/sysconfig/networking/devices/ifcfg-eth0 2>/dev/null
429
sed -i "s/DHCP_HOSTNAME=.*/DHCP_HOSTNAME==${HOSTNAME}/" /etc/sysconfig/networking/devices/ifcfg-eth0 2>/dev/null
430
 
430
 
431
### Modify /etc/redhat-release
431
### Modify /etc/redhat-release
432
ADD=" - LiveCD"
432
ADD=" - LiveCD"
433
[ $DVD ]  && ADD=" - LiveDVD"
433
[ $DVD ]  && ADD=" - LiveDVD"
434
[ $MINI ] && ADD=" - LiveMiniCD"
434
[ $MINI ] && ADD=" - LiveMiniCD"
435
if [ -e /etc/redhat-release.ori ]; then
435
if [ -e /etc/redhat-release.ori ]; then
436
    echo "$( cat /etc/redhat-release.ori )${ADD}" > /etc/redhat-release
436
    echo "$( cat /etc/redhat-release.ori )${ADD}" > /etc/redhat-release
437
fi
437
fi
438
 
438
 
439
### Set default runlevel to $RUNLEVEL
439
### Set default runlevel to $RUNLEVEL
440
if [ $RUNLEVEL ]; then
440
if [ $RUNLEVEL ]; then
441
    sed -i "s/id:.:initdefault:/id:$RUNLEVEL:initdefault:/" /etc/inittab
441
    sed -i "s/id:.:initdefault:/id:$RUNLEVEL:initdefault:/" /etc/inittab
442
fi
442
fi
443
 
443
 
444
### Edit /etc/sysconfig/desktop
444
### Edit /etc/sysconfig/desktop
445
if [ $DESKTOP ]; then
445
if [ $DESKTOP ]; then
446
    sed -i "/^DESKTOP=.*/d" /etc/sysconfig/desktop 2&>/dev/null
446
    sed -i "/^DESKTOP=.*/d" /etc/sysconfig/desktop 2&>/dev/null
447
    echo "DESKTOP=$DESKTOP" >> /etc/sysconfig/desktop
447
    echo "DESKTOP=$DESKTOP" >> /etc/sysconfig/desktop
448
fi
448
fi
449
if [ $DISPLAYMANAGER ]; then
449
if [ $DISPLAYMANAGER ]; then
450
    sed -i "/^DISPLAYMANAGER=.*/d" /etc/sysconfig/desktop 2&>/dev/null
450
    sed -i "/^DISPLAYMANAGER=.*/d" /etc/sysconfig/desktop 2&>/dev/null
451
    echo "DISPLAYMANAGER=$DISPLAYMANAGER" >> /etc/sysconfig/desktop
451
    echo "DISPLAYMANAGER=$DISPLAYMANAGER" >> /etc/sysconfig/desktop
452
fi
452
fi
453
 
453
 
454
### GDM login background
454
### GDM login background
455
if [ -e /usr/share/gdm/themes/SL/background.png ]; then
455
if [ -e /usr/share/gdm/themes/SL/background.png ]; then
456
    cp -a customize/sl${OS_RELEASE}/background.png /usr/share/gdm/themes/SL/background.png
456
    cp -a customize/sl${OS_RELEASE}/background.png /usr/share/gdm/themes/SL/background.png
457
fi
457
fi
458
 
458
 
459
### KDE default background
459
### KDE default background
460
if [ ! $PSI ]; then
460
if [ ! $PSI ]; then
461
    if [ -e /usr/share/backgrounds/images/default.png ]; then
461
    if [ -e /usr/share/backgrounds/images/default.png ]; then
462
	cp -a customize/sl${OS_RELEASE}/default.png /usr/share/backgrounds/images/default.png
462
	cp -a customize/sl${OS_RELEASE}/default.png /usr/share/backgrounds/images/default.png
463
    fi
463
    fi
464
fi
464
fi
465
 
465
 
466
### KDE startup/exit sound
466
### KDE startup/exit sound
467
if [ -e /usr/share/config/knotify.eventsrc ]; then
467
if [ -e /usr/share/config/knotify.eventsrc ]; then
468
    cp -a customize/sl/knotify.eventsrc /usr/share/config/knotify.eventsrc
468
    cp -a customize/sl/knotify.eventsrc /usr/share/config/knotify.eventsrc
469
    cp -a customize/sl/kmixrc /usr/share/config/kmixrc
469
    cp -a customize/sl/kmixrc /usr/share/config/kmixrc
470
fi
470
fi
471
 
471
 
472
### Configure SELinux
472
### Configure SELinux
473
if [ $SELINUX ]; then
473
if [ $SELINUX ]; then
474
    if [ -e /etc/selinux/config ]; then
474
    if [ -e /etc/selinux/config ]; then
475
	sed -i "s|^SELINUX=.*|SELINUX=$SELINUX|" /etc/selinux/config
475
	sed -i "s|^SELINUX=.*|SELINUX=$SELINUX|" /etc/selinux/config
476
    fi
476
    fi
477
fi
477
fi
478
 
478
 
479
### Do not like jumping CD icon when starting autorun.desktop
479
### Do not like jumping CD icon when starting autorun.desktop
480
if [ -e /etc/skel/.kde/Autostart/Autorun.desktop ]; then
480
if [ -e /etc/skel/.kde/Autostart/Autorun.desktop ]; then
481
    grep -q "StartupNotify=false" /etc/skel/.kde/Autostart/Autorun.desktop
481
    grep -q "StartupNotify=false" /etc/skel/.kde/Autostart/Autorun.desktop
482
    if [ "$?" != "0" ]; then
482
    if [ "$?" != "0" ]; then
483
	echo "StartupNotify=false" >> /etc/skel/.kde/Autostart/Autorun.desktop
483
	echo "StartupNotify=false" >> /etc/skel/.kde/Autostart/Autorun.desktop
484
    fi
484
    fi
485
fi
485
fi
486
 
486
 
487
### make thunderbird the default mail application in launchmail, if evolution is not installed
487
### make thunderbird the default mail application in launchmail, if evolution is not installed
488
#   (I don't like launchmail )
488
#   (I don't like launchmail )
489
rpm -q evolution >/dev/null 2>&1
489
rpm -q evolution >/dev/null 2>&1
490
if [ "$?" = "1" ]; then
490
if [ "$?" = "1" ]; then
491
    rpm -q thunderbird >/dev/null 2>&1
491
    rpm -q thunderbird >/dev/null 2>&1
492
    if [ "$?" = "0" ]; then
492
    if [ "$?" = "0" ]; then
493
	if [ ! -L /usr/bin/launchmail ]; then
493
	if [ ! -L /usr/bin/launchmail ]; then
494
	    mv /usr/bin/launchmail /usr/bin/launchmail.ori
494
	    mv /usr/bin/launchmail /usr/bin/launchmail.ori
495
	    ln -s /usr/bin/thunderbird /usr/bin/launchmail
495
	    ln -s /usr/bin/thunderbird /usr/bin/launchmail
496
	fi
496
	fi
497
    fi
497
    fi
498
fi
498
fi
499
 
499
 
500
### fix a bug in dag's gparted
500
### fix a bug in dag's gparted
501
if [ -e /usr/bin/run-gparted ]; then
501
if [ -e /usr/bin/run-gparted ]; then
502
    grep -q "/bin/bash" /usr/bin/run-gparted
502
    grep -q "/bin/bash" /usr/bin/run-gparted
503
    if [ "$?" != "0" ]; then
503
    if [ "$?" != "0" ]; then
504
	echo '#!/bin/bash'        > /usr/bin/run-gparted
504
	echo '#!/bin/bash'        > /usr/bin/run-gparted
505
	echo '/usr/sbin/gparted' >> /usr/bin/run-gparted
505
	echo '/usr/sbin/gparted' >> /usr/bin/run-gparted
506
	chmod 755 /usr/bin/run-gparted
506
	chmod 755 /usr/bin/run-gparted
507
    fi
507
    fi
508
fi
508
fi
509
 
509
 
510
echo "done."
510
echo "done."
511
echo "--------------------------------------------"
511
echo "--------------------------------------------"
512
 
512
 
513
 
513
 
514
 
514
 
515
###############################################################
515
###############################################################
516
# Add-ons
516
# Add-ons
517
###############################################################
517
###############################################################
518
 
518
 
519
echo "Add-ons ..."
519
echo "Add-ons ..."
520
 
520
 
521
### System icon on desktop
521
### System icon on desktop
522
if [ -d /usr/share/apps/kdesktop/DesktopLinks ]; then
522
if [ -d /usr/share/apps/kdesktop/DesktopLinks ]; then
523
    cp -a customize/System.desktop /usr/share/apps/kdesktop/DesktopLinks/
523
    cp -a customize/System.desktop /usr/share/apps/kdesktop/DesktopLinks/
524
fi
524
fi
525
 
525
 
526
### configure ICEWM
526
### configure ICEWM
527
cp -a customize/icewm/winoptions /usr/share/icewm/
527
cp -a customize/icewm/winoptions /usr/share/icewm/ 2>/dev/null
528
cp -a customize/icewm/toolbar /usr/share/icewm/
528
cp -a customize/icewm/toolbar /usr/share/icewm/    2>/dev/null
529
cp -a customize/icewm/menu /usr/share/icewm/
529
cp -a customize/icewm/menu /usr/share/icewm/       2>/dev/null
530
 
530
 
531
### set SL theme as default theme for ICEWM
531
### set SL theme as default theme for ICEWM
532
rpm -q icewm-SL-theme >/dev/null 2>&1
532
rpm -q icewm-SL-theme >/dev/null 2>&1
533
if [ "$?" = "0" ]; then
533
if [ "$?" = "0" ]; then
534
    echo "Theme=SL/default.theme" > /usr/share/icewm/theme
534
    echo "Theme=SL/default.theme" > /usr/share/icewm/theme
535
fi
535
fi
536
 
536
 
537
### icons for icewm
537
### icons for icewm
538
cp -a /usr/share/pixmaps/qtparted.xpm /usr/share/icewm/icons/ 2>/dev/null
538
cp -a /usr/share/pixmaps/qtparted.xpm /usr/share/icewm/icons/ 2>/dev/null
539
cp -a /usr/share/gftp/gftp.xpm /usr/share/icewm/icons/ 2>/dev/null
539
cp -a /usr/share/gftp/gftp.xpm /usr/share/icewm/icons/ 2>/dev/null
540
 
540
 
541
### script to install LiveCD on local harddisk
541
### script to install LiveCD on local harddisk
542
cp -a customize/livecd-install  /usr/bin/
542
cp -a customize/livecd-install  /usr/bin/
543
 
543
 
544
### GUI for livecd-install
544
### GUI for livecd-install
545
cp -a customize/livecd-install-gui/livecd-install-gui /usr/sbin/
545
cp -a customize/livecd-install-gui/livecd-install-gui /usr/sbin/
546
ln -fs consolehelper /usr/bin/livecd-install-gui
546
ln -fs consolehelper /usr/bin/livecd-install-gui
547
cp -a customize/livecd-install-gui/livecd-install-gui.desktop /usr/share/applications/
547
cp -a customize/livecd-install-gui/livecd-install-gui.desktop /usr/share/applications/
548
cp -a customize/livecd-install-gui/livecd-install-gui.console.apps /etc/security/console.apps/livecd-install-gui
548
cp -a customize/livecd-install-gui/livecd-install-gui.console.apps /etc/security/console.apps/livecd-install-gui
549
cp -a customize/livecd-install-gui/livecd-install-gui.pam.d /etc/pam.d/livecd-install-gui
549
cp -a customize/livecd-install-gui/livecd-install-gui.pam.d /etc/pam.d/livecd-install-gui
550
 
550
 
551
### livecd-mkinitrd (used by livecd-install)
551
### livecd-mkinitrd (used by livecd-install)
552
if [ -e customize/sl${OS_RELEASE}/livecd-mkinitrd ]; then
552
if [ -e customize/sl${OS_RELEASE}/livecd-mkinitrd ]; then
553
    cp -a customize/sl${OS_RELEASE}/livecd-mkinitrd /usr/sbin/
553
    cp -a customize/sl${OS_RELEASE}/livecd-mkinitrd /usr/sbin/
554
else
554
else
555
    cp -a /sbin/mkinitrd /usr/sbin/livecd-mkinitrd
555
    cp -a /sbin/mkinitrd /usr/sbin/livecd-mkinitrd
556
fi
556
fi
557
 
557
 
558
### /usr/sbin/livecd-autologin, provides directly login over xinit
558
### /usr/sbin/livecd-autologin, provides directly login over xinit
559
cp -a customize/livecd-autologin /usr/sbin/livecd-autologin
559
cp -a customize/livecd-autologin /usr/sbin/livecd-autologin
560
chmod +x /usr/sbin/livecd-autologin
560
chmod +x /usr/sbin/livecd-autologin
561
 
561
 
562
### files for PSI User, will be copied during bootup to /home/$LOCALUSER/
562
### files for PSI User, will be copied during bootup to /home/$LOCALUSER/
563
if [ $PSI ]; then
563
if [ $PSI ]; then
564
    rm -rf /usr/share/$LOCALUSER
564
    rm -rf /usr/share/$LOCALUSER
565
    cp -a customize/$LOCALUSER /usr/share/
565
    cp -a customize/$LOCALUSER /usr/share/
566
fi
566
fi
567
 
567
 
568
### psi-menu, psi-scanvirus
568
### psi-menu, psi-scanvirus
569
if [ $PSI ]; then
569
if [ $PSI ]; then
570
    cp -a customize/psi/psi-menu /usr/bin/
570
    cp -a customize/psi/psi-menu /usr/bin/
571
    cp -a customize/psi/psi-scanvirus /usr/bin/
571
    cp -a customize/psi/psi-scanvirus /usr/bin/
572
    [ -d /usr/local/uvscan ] && cp -a customize/psi/update-dat /usr/local/uvscan/
572
    [ -d /usr/local/uvscan ] && cp -a customize/psi/update-dat /usr/local/uvscan/
573
    [ -x /usr/bin/freshclam ] && cp -a customize/psi/psi-freshclam /usr/bin/
573
    [ -x /usr/bin/freshclam ] && cp -a customize/psi/psi-freshclam /usr/bin/
574
fi
574
fi
575
 
575
 
576
echo "done."
576
echo "done."
577
echo "--------------------------------------------"
577
echo "--------------------------------------------"
578
 
578
 
579
 
579
 
580
###############################################################
580
###############################################################
581
# Create missing files
581
# Create missing files
582
###############################################################
582
###############################################################
583
 
583
 
584
echo "Create missing files ..."
584
echo "Create missing files ..."
585
 
585
 
586
###############################################################
586
###############################################################
587
# /etc/hosts
587
# /etc/hosts
588
### copy host file, if not existing
588
### copy host file, if not existing
589
[ -e /etc/hosts ] || cp -a customize/hosts /etc/hosts
589
[ -e /etc/hosts ] || cp -a customize/hosts /etc/hosts
590
[ -e /etc/sysconfig/networking/profiles/default/hosts ] || cp -a customize/hosts /etc/sysconfig/networking/profiles/default/hosts
590
[ -e /etc/sysconfig/networking/profiles/default/hosts ] || cp -a customize/hosts /etc/sysconfig/networking/profiles/default/hosts
591
 
591
 
592
 
592
 
593
###############################################################
593
###############################################################
594
# /etc/shadow
594
# /etc/shadow
595
if [ ! -e /etc/shadow ]; then
595
if [ ! -e /etc/shadow ]; then
596
    sed -i "s|\*|x|" /etc/passwd
596
    sed -i "s|\*|x|" /etc/passwd
597
    sed -i "s|^root::|root:x:|" /etc/passwd
597
    sed -i "s|^root::|root:x:|" /etc/passwd
598
    cat /etc/passwd | cut -d":" -f 1 | while read u; do echo "$u:*:12345:0:99999:1:::"; done >> /etc/shadow
598
    cat /etc/passwd | cut -d":" -f 1 | while read u; do echo "$u:*:12345:0:99999:1:::"; done >> /etc/shadow
599
    chmod 600 /etc/shadow
599
    chmod 600 /etc/shadow
600
fi
600
fi
601
 
601
 
602
# /etc/gshadow
602
# /etc/gshadow
603
if [ ! -e /etc/gshadow ]; then
603
if [ ! -e /etc/gshadow ]; then
604
    cp -a /etc/group /etc/gshadow
604
    cp -a /etc/group /etc/gshadow
605
    sed -i "s|:x:|::|"       /etc/gshadow
605
    sed -i "s|:x:|::|"       /etc/gshadow
606
    sed -i "s|:[0-9]\+:|::|" /etc/gshadow
606
    sed -i "s|:[0-9]\+:|::|" /etc/gshadow
607
    chmod 600 /etc/gshadow
607
    chmod 600 /etc/gshadow
608
fi
608
fi
609
 
609
 
610
echo "done."
610
echo "done."
611
echo "--------------------------------------------"
611
echo "--------------------------------------------"
612
 
612
 
613
 
613
 
614
 
614
 
615
###############################################################
615
###############################################################
616
# Create special files
616
# Create special files
617
###############################################################
617
###############################################################
618
 
618
 
619
echo "Create special files ..."
619
echo "Create special files ..."
620
 
620
 
621
###############################################################
621
###############################################################
622
# /etc/rc.d/init.d/kudzu-auto
622
# /etc/rc.d/init.d/kudzu-auto
623
### Noninteractive HW detection and configuration
623
### Noninteractive HW detection and configuration
624
 
624
 
625
cp -a customize/kudzu-auto /etc/rc.d/init.d/kudzu-auto
625
cp -a customize/kudzu-auto /etc/rc.d/init.d/kudzu-auto
626
chmod +x /etc/rc.d/init.d/kudzu-auto
626
chmod +x /etc/rc.d/init.d/kudzu-auto
627
chkconfig --add kudzu-auto
627
chkconfig --add kudzu-auto
628
chkconfig kudzu-auto on
628
chkconfig kudzu-auto on
629
 
629
 
630
 
630
 
631
###############################################################
631
###############################################################
632
# /etc/rc.d/init.d/runveryfirst
632
# /etc/rc.d/init.d/runveryfirst
633
### Fix some things during bootup - run VERY first
633
### Fix some things during bootup - run VERY first
634
# runveryfirst will run at the begining of /etc/rc.d/rc.sysinit
634
# runveryfirst will run at the begining of /etc/rc.d/rc.sysinit
635
 
635
 
636
cp -a customize/runveryfirst /etc/init.d/runveryfirst
636
cp -a customize/runveryfirst /etc/init.d/runveryfirst
637
chmod +x /etc/rc.d/init.d/runveryfirst
637
chmod +x /etc/rc.d/init.d/runveryfirst
638
 
638
 
639
# execute runveryfirst just before "Initialize hardware"
639
# execute runveryfirst just before "Initialize hardware"
640
grep -q runveryfirst /etc/rc.d/rc.sysinit
640
grep -q runveryfirst /etc/rc.d/rc.sysinit
641
if [ "$?" != "0" ]; then
641
if [ "$?" != "0" ]; then
642
    sed -i -e "/^# Initialize hardware/a\/etc\/init.d\/runveryfirst" /etc/rc.d/rc.sysinit
642
    sed -i -e "/^# Initialize hardware/a\/etc\/init.d\/runveryfirst" /etc/rc.d/rc.sysinit
643
fi
643
fi
644
 
644
 
645
 
645
 
646
###############################################################
646
###############################################################
647
# /etc/rc.d/init.d/runfirst
647
# /etc/rc.d/init.d/runfirst
648
### Fix some things during bootup - run first
648
### Fix some things during bootup - run first
649
# runfirst will run at the end of /etc/rc.d/rc.sysinit
649
# runfirst will run at the end of /etc/rc.d/rc.sysinit
650
 
650
 
651
cp -a customize/runfirst /etc/init.d/runfirst
651
cp -a customize/runfirst /etc/init.d/runfirst
652
chmod +x /etc/rc.d/init.d/runfirst
652
chmod +x /etc/rc.d/init.d/runfirst
653
 
653
 
654
sysinit_line="/etc/rc.d/init.d/runfirst"
654
sysinit_line="/etc/rc.d/init.d/runfirst"
655
grep -q "$sysinit_line" /etc/rc.d/rc.sysinit
655
grep -q "$sysinit_line" /etc/rc.d/rc.sysinit
656
if [ "$?" != "0" ]; then
656
if [ "$?" != "0" ]; then
657
    echo "$sysinit_line" >> /etc/rc.d/rc.sysinit
657
    echo "$sysinit_line" >> /etc/rc.d/rc.sysinit
658
    echo >> /etc/rc.d/rc.sysinit
658
    echo >> /etc/rc.d/rc.sysinit
659
fi
659
fi
660
 
660
 
661
 
661
 
662
###############################################################
662
###############################################################
663
# /etc/rc.d/init.d/runlast
663
# /etc/rc.d/init.d/runlast
664
### Fix some things during bootup - run last
664
### Fix some things during bootup - run last
665
 
665
 
666
cp -a customize/runlast /etc/init.d/runlast
666
cp -a customize/runlast /etc/init.d/runlast
667
chmod +x /etc/rc.d/init.d/runlast
667
chmod +x /etc/rc.d/init.d/runlast
668
 
668
 
669
### Add /etc/rc.d/init.d/runlast to rc.local
669
### Add /etc/rc.d/init.d/runlast to rc.local
670
LINE=/etc/rc.d/init.d/runlast
670
LINE=/etc/rc.d/init.d/runlast
671
grep -q $LINE /etc/rc.d/rc.local
671
grep -q $LINE /etc/rc.d/rc.local
672
if [ "$?" != "0" ]; then
672
if [ "$?" != "0" ]; then
673
    # add line
673
    # add line
674
    echo "" >> /etc/rc.d/rc.local
674
    echo "" >> /etc/rc.d/rc.local
675
    echo $LINE >> /etc/rc.d/rc.local
675
    echo $LINE >> /etc/rc.d/rc.local
676
    echo "" >> /etc/rc.d/rc.local    
676
    echo "" >> /etc/rc.d/rc.local    
677
fi
677
fi
678
 
678
 
679
 
679
 
680
###############################################################
680
###############################################################
681
# /usr/bin/save-localdata
681
# /usr/bin/save-localdata
682
### stores data on a usbstick
682
### stores data on a usbstick
683
cp -a customize/save-localdata /usr/bin/save-localdata
683
cp -a customize/save-localdata /usr/bin/save-localdata
684
chmod +x /usr/bin/save-localdata
684
chmod +x /usr/bin/save-localdata
685
 
685
 
686
# add /usr/bin/save-localdata to /etc/sudoers
686
# add /usr/bin/save-localdata to /etc/sudoers
687
if [ -e /etc/sudoers ]; then
687
if [ -e /etc/sudoers ]; then
688
    grep -q "save-localdata" /etc/sudoers 2>/dev/null
688
    grep -q "save-localdata" /etc/sudoers 2>/dev/null
689
    if [ "$?" != "0" ]; then
689
    if [ "$?" != "0" ]; then
690
	cp -a /etc/sudoers /etc/sudoers.ori
690
	cp -a /etc/sudoers /etc/sudoers.ori
691
	echo "$LOCALUSER ALL = NOPASSWD: /usr/bin/save-localdata" >> /etc/sudoers
691
	echo "$LOCALUSER ALL = NOPASSWD: /usr/bin/save-localdata" >> /etc/sudoers
692
    fi
692
    fi
693
fi
693
fi
694
 
694
 
695
# create menu entry
695
# create menu entry
696
cp -a customize/save-localdata.desktop /usr/share/applications/
696
cp -a customize/save-localdata.desktop /usr/share/applications/
697
 
697
 
698
 
698
 
699
###############################################################
699
###############################################################
700
# /usr/bin/set-volume
700
# /usr/bin/set-volume
701
### unmute all mixers and set volumes
701
### unmute all mixers and set volumes
702
cp -a customize/set-volume /usr/bin/set-volume
702
cp -a customize/set-volume /usr/bin/set-volume
703
chmod +x /usr/bin/set-volume
703
chmod +x /usr/bin/set-volume
704
 
704
 
705
 
705
 
706
###############################################################
706
###############################################################
707
# /etc/sysconfig/networking/devices/ifcfg-eth0
707
# /etc/sysconfig/networking/devices/ifcfg-eth0
708
# /etc/sysconfig/networking/devices/ifcfg-eth1
708
# /etc/sysconfig/networking/devices/ifcfg-eth1
709
 
709
 
710
for iface in eth0 eth1; do 
710
for iface in eth0 eth1; do 
711
 
711
 
712
    # remove it first
712
    # remove it first
713
    rm -f /etc/sysconfig/networking/devices/ifcfg-${iface} 2>/dev/null
713
    rm -f /etc/sysconfig/networking/devices/ifcfg-${iface} 2>/dev/null
714
    rm -f /etc/sysconfig/networking/profiles/default/ifcfg-${iface} 2>/dev/null
714
    rm -f /etc/sysconfig/networking/profiles/default/ifcfg-${iface} 2>/dev/null
715
    rm -f /etc/sysconfig/network-scripts/ifcfg-${iface} 2>/dev/null
715
    rm -f /etc/sysconfig/network-scripts/ifcfg-${iface} 2>/dev/null
716
 
716
 
717
    # create it, if we have a sample
717
    # create it, if we have a sample
718
    if [ -e customize/sl${OS_RELEASE}/ifcfg-${iface} ]; then
718
    if [ -e customize/sl${OS_RELEASE}/ifcfg-${iface} ]; then
719
	cp -a customize/sl${OS_RELEASE}/ifcfg-${iface} /etc/sysconfig/networking/devices/ifcfg-${iface}
719
	cp -a customize/sl${OS_RELEASE}/ifcfg-${iface} /etc/sysconfig/networking/devices/ifcfg-${iface}
720
        # make hard links
720
        # make hard links
721
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/networking/profiles/default/
721
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/networking/profiles/default/
722
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/network-scripts/
722
	cp -lf /etc/sysconfig/networking/devices/ifcfg-${iface} /etc/sysconfig/network-scripts/
723
    fi
723
    fi
724
done
724
done
725
 
725
 
726
 
726
 
727
###############################################################
727
###############################################################
728
# /etc/profile.d/setsysfont.sh
728
# /etc/profile.d/setsysfont.sh
729
### setsysfont 
729
### setsysfont 
730
cat > /etc/profile.d/setsysfont.sh <<EOF
730
cat > /etc/profile.d/setsysfont.sh <<EOF
731
# setsysfont once
731
# setsysfont once
732
if [ ! -e /tmp/.sysfont_has_been_set ]; then
732
if [ ! -e /tmp/.sysfont_has_been_set ]; then
733
    touch /tmp/.sysfont_has_been_set
733
    touch /tmp/.sysfont_has_been_set
734
    /bin/setfont 2>/dev/null
734
    /bin/setfont 2>/dev/null
735
    /sbin/setsysfont 2>/dev/null
735
    /sbin/setsysfont 2>/dev/null
736
fi
736
fi
737
EOF
737
EOF
738
chmod 755 /etc/profile.d/setsysfont.sh
738
chmod 755 /etc/profile.d/setsysfont.sh
739
 
739
 
740
 
740
 
741
###############################################################
741
###############################################################
742
# /etc/profile.d/setsysfont.csh
742
# /etc/profile.d/setsysfont.csh
743
### setsysfont 
743
### setsysfont 
744
cat > /etc/profile.d/setsysfont.csh <<EOF
744
cat > /etc/profile.d/setsysfont.csh <<EOF
745
# setsysfont once
745
# setsysfont once
746
if ( ! -e /tmp/.sysfont_has_been_set ) then
746
if ( ! -e /tmp/.sysfont_has_been_set ) then
747
    touch /tmp/.sysfont_has_been_set
747
    touch /tmp/.sysfont_has_been_set
748
    /bin/setfont 2>/dev/null
748
    /bin/setfont 2>/dev/null
749
    /sbin/setsysfont 2>/dev/null
749
    /sbin/setsysfont 2>/dev/null
750
endif
750
endif
751
EOF
751
EOF
752
chmod 755 /etc/profile.d/setsysfont.csh
752
chmod 755 /etc/profile.d/setsysfont.csh
753
 
753
 
754
 
754
 
755
###############################################################
755
###############################################################
756
# /etc/cron.d/psi
756
# /etc/cron.d/psi
757
### PSI specific cronjobs
757
### PSI specific cronjobs
758
 
758
 
759
if [ $PSI ] && [ -e customize/psi/cron_psi.sl${OS_RELEASE} ]; then
759
if [ $PSI ] && [ -e customize/psi/cron_psi.sl${OS_RELEASE} ]; then
760
    cp -a customize/psi/cron_psi.sl${OS_RELEASE} /etc/cron.d/psi 
760
    cp -a customize/psi/cron_psi.sl${OS_RELEASE} /etc/cron.d/psi 
761
    chmod +x /etc/cron.d/psi
761
    chmod +x /etc/cron.d/psi
762
fi
762
fi
763
 
763
 
764
echo "done."
764
echo "done."
765
echo "--------------------------------------------"
765
echo "--------------------------------------------"
766
 
766
 
767
 
767
 
768
 
768
 
769
###############################################################
769
###############################################################
770
# Configure services
770
# Configure services
771
###############################################################
771
###############################################################
772
 
772
 
773
echo "Configure services ..."
773
echo "Configure services ..."
774
 
774
 
775
### services off
775
### services off
776
if [ $PSI ]; then
776
if [ $PSI ]; then
777
    chkconfig cfenvd off  2>/dev/null
777
    chkconfig cfenvd off  2>/dev/null
778
    chkconfig cfexecd off 2>/dev/null
778
    chkconfig cfexecd off 2>/dev/null
779
    chkconfig cfservd off 2>/dev/null
779
    chkconfig cfservd off 2>/dev/null
780
fi
780
fi
781
if [ ! "$SERVICES_OFF" = "" ]; then
781
if [ ! "$SERVICES_OFF" = "" ]; then
782
    for service in $SERVICES_OFF; do
782
    for service in $SERVICES_OFF; do
783
	chkconfig $service off 2>/dev/null
783
	chkconfig $service off 2>/dev/null
784
    done
784
    done
785
fi
785
fi
786
 
786
 
787
### we do kudzu-auto
787
### we do kudzu-auto
788
chkconfig kudzu off 
788
chkconfig kudzu off 
789
 
789
 
790
### services on
790
### services on
791
if [ ! "$SERVICES_ON" = "" ]; then
791
if [ ! "$SERVICES_ON" = "" ]; then
792
    for service in $SERVICES_ON; do
792
    for service in $SERVICES_ON; do
793
	chkconfig $service on 2>/dev/null
793
	chkconfig $service on 2>/dev/null
794
    done
794
    done
795
fi
795
fi
796
 
796
 
797
echo "done."
797
echo "done."
798
echo "--------------------------------------------"
798
echo "--------------------------------------------"
799
 
799
 
800
 
800
 
801
###############################################################
801
###############################################################
802
# Empty files
802
# Empty files
803
###############################################################
803
###############################################################
804
 
804
 
805
echo "Empty files ..."
805
echo "Empty files ..."
806
 
806
 
807
### /etc/security/users
807
### /etc/security/users
808
if [ $PSI ]; then
808
if [ $PSI ]; then
809
    rm -f /etc/security/ssh.allow
809
    rm -f /etc/security/ssh.allow
810
    touch /etc/security/ssh.allow
810
    touch /etc/security/ssh.allow
811
fi
811
fi
812
 
812
 
813
### Files to empty
813
### Files to empty
814
FILES_TOUCH="/etc/sysconfig/hwconf \
814
FILES_TOUCH="/etc/sysconfig/hwconf \
815
             /etc/resolv.conf \
815
             /etc/resolv.conf \
816
             /etc/adjtime \
816
             /etc/adjtime \
817
             /etc/modprobe.conf \
817
             /etc/modprobe.conf \
818
             /etc/dhclient-eth0.conf"
818
             /etc/dhclient-eth0.conf"
819
 
819
 
820
for file in $FILES_TOUCH; do
820
for file in $FILES_TOUCH; do
821
    rm -rf $file
821
    rm -rf $file
822
    touch $file
822
    touch $file
823
done
823
done
824
 
824
 
825
echo "done."
825
echo "done."
826
echo "--------------------------------------------"
826
echo "--------------------------------------------"
827
 
827
 
828
 
828
 
829
 
829
 
830
###############################################################
830
###############################################################
831
# Update locate db, prelink, makewhatis
831
# Update locate db, prelink, makewhatis
832
###############################################################
832
###############################################################
833
 
833
 
834
### run updatedb
834
### run updatedb
835
if [ -x /usr/bin/updatedb ]; then
835
if [ -x /usr/bin/updatedb ]; then
836
    echo "Run updatedb..."
836
    echo "Run updatedb..."
837
    . /etc/updatedb.conf 2>/dev/null
837
    . /etc/updatedb.conf 2>/dev/null
838
    rpm -q mlocate >/dev/null
838
    rpm -q mlocate >/dev/null
839
    if [ "$?" = "0" ]; then
839
    if [ "$?" = "0" ]; then
840
	/usr/bin/updatedb -e "/media /sfs /tmp /boot /livecd /home /net /trunk"
840
	/usr/bin/updatedb -e "/media /sfs /tmp /boot /livecd /home /net /trunk"
841
    else
841
    else
842
	/usr/bin/updatedb -e /media,/tmp,/boot,/livecd,/home,/net,/trunk
842
	/usr/bin/updatedb -e /media,/tmp,/boot,/livecd,/home,/net,/trunk
843
    fi
843
    fi
844
    echo "done."
844
    echo "done."
845
fi
845
fi
846
 
846
 
847
### run prelink
847
### run prelink
848
if [ -x /etc/cron.daily/prelink ]; then
848
if [ -x /etc/cron.daily/prelink ]; then
849
    echo "Run prelink..."
849
    echo "Run prelink..."
850
    /etc/cron.daily/prelink
850
    /etc/cron.daily/prelink
851
    echo "done."
851
    echo "done."
852
fi
852
fi
853
if [ -x /etc/cron_backup/prelink ]; then
853
if [ -x /etc/cron_backup/prelink ]; then
854
    echo "Run prelink..."
854
    echo "Run prelink..."
855
    /etc/cron_backup/prelink
855
    /etc/cron_backup/prelink
856
    echo "done."
856
    echo "done."
857
fi
857
fi
858
 
858
 
859
### clean prelink log
859
### clean prelink log
860
rm -f /var/log/prelink/prelink.log 2>/dev/null
860
rm -f /var/log/prelink/prelink.log 2>/dev/null
861
rm -f /var/log/prelink.log 2>/dev/null
861
rm -f /var/log/prelink.log 2>/dev/null
862
 
862
 
863
### run makewhatis
863
### run makewhatis
864
which makewhatis >/dev/null 2>&1
864
which makewhatis >/dev/null 2>&1
865
if [ "$?" = "0" ]; then
865
if [ "$?" = "0" ]; then
866
    echo "Run makewhatis..."
866
    echo "Run makewhatis..."
867
    makewhatis -u -w
867
    makewhatis -u -w
868
fi
868
fi
869
 
869
 
870
echo "done."
870
echo "done."
871
echo "--------------------------------------------"
871
echo "--------------------------------------------"
872
 
872
 
873
###############################################################
873
###############################################################