Subversion Repositories livecd

Rev

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

Rev 36 Rev 43
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
###############################################################
3
###############################################################
4
#
4
#
5
# Installes the LiveCD on local harddisk
5
# Installes the LiveCD on local harddisk
6
# 
6
# 
7
# Boot LiveCD and run this script as root
7
# Boot LiveCD and run this script as root
8
#
8
#
9
# Urs Beyerle, PSI
9
# Urs Beyerle, PSI
10
#
10
#
11
###############################################################
11
###############################################################
12
 
12
 
13
 
13
 
14
###############################################################
14
###############################################################
15
# Definitions
15
# Definitions
16
###############################################################
16
###############################################################
17
 
17
 
18
# set PATH
18
# set PATH
19
PATH="/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin"
19
PATH="/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin"
20
 
20
 
21
# RPMs that are no longer needed and can break future udpates
21
# RPMs that are no longer needed and can break future udpates
22
RPMS_TO_REMOVE="kernel-module-squashfs \
22
RPMS_TO_REMOVE="kernel-module-squashfs \
23
                kernel-module-unionfs \
23
                kernel-module-unionfs \
24
                unionfs \
24
                unionfs \
25
                squashfs"
25
                squashfs"
26
 
26
 
27
# RPMs that can break future Scientific Linux updates
27
# RPMs that can break future Scientific Linux updates
28
# because there are not part of Scientific Linux
28
# because there are not part of Scientific Linux
29
RPMS_TO_REMOVE_SL="kernel-module-ntfs"
29
RPMS_TO_REMOVE_SL="kernel-module-ntfs \
-
 
30
                   nvidia.*psi"
30
                   
31
                   
31
# RPMs that can break future PSI SL updates
32
# RPMs that can break future PSI SL updates
32
# because there are not part of PSI Scientific Linux
33
# because there are not part of PSI Scientific Linux
33
RPMS_TO_REMOVE_PSI=""
34
RPMS_TO_REMOVE_PSI=""
34
                   
35
                   
35
# files which should be restored from .ori files
36
# files which should be restored from .ori files
36
FILES_RESTORE="/etc/init.d/netfs \
37
FILES_RESTORE="/etc/init.d/netfs \
37
           /etc/init.d/autofs \
38
           /etc/init.d/autofs \
38
           /etc/init.d/halt \
39
           /etc/init.d/halt \
39
           /etc/init.d/network
40
           /etc/init.d/network
40
           /etc/init.d/functions \
41
           /etc/init.d/functions \
41
           /etc/rc.d/rc.sysinit \
42
           /etc/rc.d/rc.sysinit \
42
           /etc/sysconfig/afs \
43
           /etc/sysconfig/afs \
43
           /etc/motd \
44
           /etc/motd \
44
           /etc/redhat-release \
45
           /etc/redhat-release \
45
	   /etc/rc.d/rc.local"
46
	   /etc/rc.d/rc.local"
46
 
47
 
47
# LiveCD init scripts will be removed
48
# LiveCD init scripts will be removed
48
LIVECD_INIT_SCRIPTS="runfirst \
49
LIVECD_INIT_SCRIPTS="runfirst \
49
                    runveryfirst \
50
                    runveryfirst \
50
                    runlast \
51
                    runlast \
51
                    kudzu-auto \
52
                    kudzu-auto \
52
                    login"
53
                    login"
53
 
54
 
54
# Main directories which should be not be copied
55
# Main directories which should be not be copied
55
DIR_NOT_COPY="/proc \
56
DIR_NOT_COPY="/proc \
56
              /dev \
57
              /dev \
57
              /livecd \
58
              /livecd \
58
              /boot \
59
              /boot \
59
              /afs \
60
              /afs \
60
              /sys \
61
              /sys \
61
              /mnt \
62
              /mnt \
62
              /media \
63
              /media \
63
              /initrd"
64
              /initrd"
64
 
65
 
65
# Mount point of the new SL system
66
# Mount point of the new SL system
66
NEW=/mnt/harddisk
67
NEW=/mnt/harddisk
67
 
68
 
68
# Name of the script
69
# Name of the script
69
SCRIPTNAME=$( basename $0 )
70
SCRIPTNAME=$( basename $0 )
70
 
71
 
71
 
72
 
72
 
73
 
73
 
74
 
74
###############################################################
75
###############################################################
75
# Functions
76
# Functions
76
###############################################################
77
###############################################################
77
 
78
 
78
function usage() {
79
function usage() {
79
 
80
 
80
   ## Usage
81
   ## Usage
81
   # ----------------------------------------------------------
82
   # ----------------------------------------------------------
82
 
83
 
83
   cat <<EOF
84
   cat <<EOF
84
   
85
   
85
  $SCRIPTNAME [OPTIONS] -mbr=[DEVICE] [PARTITION]
86
  $SCRIPTNAME [OPTIONS] -mbr=[DEVICE] [PARTITION]
86
 
87
 
87
    Installes LiveCD on PARTITION and the bootloader grub into 
88
    Installes LiveCD on PARTITION and the bootloader grub into 
88
    the Master Boot Record (MBR) of DEVICE. The MBR will be 
89
    the Master Boot Record (MBR) of DEVICE. The MBR will be 
89
    backed up to PARTITION.
90
    backed up to PARTITION.
90
 
91
 
91
  OPTIONS:
92
  OPTIONS:
92
 
93
 
93
    -h   --help       : Print this screen
94
    -h   --help       : Print this screen
94
    -swap=[partition] : Use [partition] as swap
95
    -swap=[partition] : Use [partition] as swap
95
    -win=[partition]  : Your active Windows partition. If not given, 
96
    -win=[partition]  : Your active Windows partition. If not given, 
96
                        $SCRIPTNAME tries to find it
97
                        $SCRIPTNAME tries to find it
97
    -nogrub           : Do not install grub. You have to install 
98
    -nogrub           : Do not install grub. You have to install 
98
                        manually a bootloader (not recommended)
99
                        manually a bootloader (not recommended)
99
    -floppy           : Needed, if grub should be installed on floppy
100
    -floppy           : Needed, if grub should be installed on floppy
100
                        In this case use -mbr=/dev/fd0 -floppy
101
                        In this case use -mbr=/dev/fd0 -floppy
101
    -norpmremove      : Do not remove RPMs that can break future 
102
    -norpmremove      : Do not remove RPMs that can break future 
102
                        updates (not recommended)
103
                        updates (not recommended)
103
    -y                : Answer all questions with yes
104
    -y                : Answer all questions with yes
104
 
105
 
105
  Example:
106
  Example:
106
 
107
 
107
  $SCRIPTNAME -swap=/dev/sda3 -mbr=/dev/sda /dev/sda2
108
  $SCRIPTNAME -swap=/dev/sda3 -mbr=/dev/sda /dev/sda2
108
 
109
 
109
    Will install LiveCD on /dev/sda2 (= second partition on 
110
    Will install LiveCD on /dev/sda2 (= second partition on 
110
    first SATA disk). All data on /dev/sda2 will be deleted.
111
    first SATA disk). All data on /dev/sda2 will be deleted.
111
    /dev/sda3 has to be a Linux Swap partion. GRUB will be 
112
    /dev/sda3 has to be a Linux Swap partion. GRUB will be 
112
    installed in the MBR of /dev/sda (= first SATA disk).
113
    installed in the MBR of /dev/sda (= first SATA disk).
113
   
114
   
114
  Remarks:
115
  Remarks:
115
 
116
 
116
    To display your hard disk partitions, user 'fdisk -l'.
117
    To display your hard disk partitions, user 'fdisk -l'.
117
    Use fdisk, qtparted or parted to create an empty Linux
118
    Use fdisk, qtparted or parted to create an empty Linux
118
    partition.
119
    partition.
119
 
120
 
120
EOF
121
EOF
121
}
122
}
122
 
123
 
123
 
124
 
124
function exit_now() {
125
function exit_now() {
125
 
126
 
126
    local exitcode=$1
127
    local exitcode=$1
127
    umount $INSTALL_PART 2>/dev/null
128
    umount $INSTALL_PART 2>/dev/null
128
    exit $exitcode
129
    exit $exitcode
129
}
130
}
130
 
131
 
131
 
132
 
132
 
133
 
133
###############################################################
134
###############################################################
134
# Main
135
# Main
135
###############################################################
136
###############################################################
136
 
137
 
137
### are we root?
138
### are we root?
138
### -----------------------------------------------------------
139
### -----------------------------------------------------------
139
if [ "$( whoami )" != "root" ]; then
140
if [ "$( whoami )" != "root" ]; then
140
    echo; echo "Please run this script as root: 'su - -c $SCRIPTNAME'"; echo
141
    echo; echo "Please run this script as root: 'su - -c $SCRIPTNAME'"; echo
141
    exit_now 1
142
    exit_now 1
142
fi
143
fi
143
 
144
 
144
 
145
 
145
### read options from command-line
146
### read options from command-line
146
### -----------------------------------------------------------
147
### -----------------------------------------------------------
147
while [ $# -gt 0 ]; do
148
while [ $# -gt 0 ]; do
148
 
149
 
149
    case "$1" in
150
    case "$1" in
150
       -h)
151
       -h)
151
            usage; exit_now;;
152
            usage; exit_now;;
152
 
153
 
153
       --help)
154
       --help)
154
            usage; exit_now;;
155
            usage; exit_now;;
155
 
156
 
156
       -swap*)
157
       -swap*)
157
           if echo $1 | grep -q '=' ; then
158
           if echo $1 | grep -q '=' ; then
158
	       SWAP_PART=$( echo $1 | sed 's/^-swap=//' )
159
	       SWAP_PART=$( echo $1 | sed 's/^-swap=//' )
159
	   else
160
	   else
160
	       shift
161
	       shift
161
               SWAP_PART=$1
162
               SWAP_PART=$1
162
	   fi
163
	   fi
163
	   ;;
164
	   ;;
164
 
165
 
165
       -mbr*)
166
       -mbr*)
166
           if echo $1 | grep -q '=' ; then
167
           if echo $1 | grep -q '=' ; then
167
	       MBR_DEV=$( echo $1 | sed 's/^-mbr=//' )
168
	       MBR_DEV=$( echo $1 | sed 's/^-mbr=//' )
168
	   else
169
	   else
169
	       shift
170
	       shift
170
               MBR_DEV=$1
171
               MBR_DEV=$1
171
	   fi
172
	   fi
172
	   ;;
173
	   ;;
173
 
174
 
174
       -win*)
175
       -win*)
175
           if echo $1 | grep -q '=' ; then
176
           if echo $1 | grep -q '=' ; then
176
	       WIN_PART=$( echo $1 | sed 's/^-win=//' )
177
	       WIN_PART=$( echo $1 | sed 's/^-win=//' )
177
	   else
178
	   else
178
	       shift
179
	       shift
179
               WIN_PART=$1
180
               WIN_PART=$1
180
	   fi
181
	   fi
181
	   ;;
182
	   ;;
182
 
183
 
183
       -nogrub)
184
       -nogrub)
184
            NOGRUB=$1;;
185
            NOGRUB=$1;;
185
 
186
 
186
       -norpmremove)
187
       -norpmremove)
187
            NORPMREMOVE=$1;;
188
            NORPMREMOVE=$1;;
188
 
189
 
189
       -floppy)
190
       -floppy)
190
            FLOPPY=$1;;
191
            FLOPPY=$1;;
191
 
192
 
192
       -y)
193
       -y)
193
            YES=$1;;
194
            YES=$1;;
194
 
195
 
195
       *)
196
       *)
196
            INSTALL_PART=$1;;
197
            INSTALL_PART=$1;;
197
    esac
198
    esac
198
 
199
 
199
    shift
200
    shift
200
 
201
 
201
done
202
done
202
echo
203
echo
203
 
204
 
204
 
205
 
205
### display fdisk -l
206
### display fdisk -l
206
### -----------------------------------------------------------
207
### -----------------------------------------------------------
207
echo "Output of 'fdisk -l' ..."
208
echo "Output of 'fdisk -l' ..."
208
fdisk -l
209
fdisk -l
209
echo
210
echo
210
 
211
 
211
 
212
 
212
### test if $INSTALL_PART is defined
213
### test if $INSTALL_PART is defined
213
### -----------------------------------------------------------
214
### -----------------------------------------------------------
214
if [ ! $INSTALL_PART ]; then
215
if [ ! $INSTALL_PART ]; then
215
    echo "No partition defined for installation"
216
    echo "No partition defined for installation"
216
    echo "Please see '$SCRIPTNAME -h'"; echo
217
    echo "Please see '$SCRIPTNAME -h'"; echo
217
    exit_now 1
218
    exit_now 1
218
fi
219
fi
219
 
220
 
220
 
221
 
221
### test if MBR_DEV is given
222
### test if MBR_DEV is given
222
### -----------------------------------------------------------
223
### -----------------------------------------------------------
223
if [ ! $NOGRUB ]; then
224
if [ ! $NOGRUB ]; then
224
    if [ ! $MBR_DEV ]; then
225
    if [ ! $MBR_DEV ]; then
225
	echo "No MBR device defined."
226
	echo "No MBR device defined."
226
	echo "Please see '$SCRIPTNAME -h'"; echo
227
	echo "Please see '$SCRIPTNAME -h'"; echo
227
	exit_now 1
228
	exit_now 1
228
    fi
229
    fi
229
fi
230
fi
230
 
231
 
231
 
232
 
232
### test if $INSTALL_PART exists
233
### test if $INSTALL_PART exists
233
### -----------------------------------------------------------
234
### -----------------------------------------------------------
234
fdisk -l | cut -d" " -f1 | grep -q "^${INSTALL_PART}$"
235
fdisk -l | cut -d" " -f1 | grep -q "^${INSTALL_PART}$"
235
if [ "$?" != "0" ]; then
236
if [ "$?" != "0" ]; then
236
    echo "Partition $INSTALL_PART not found! See 'fdisk -l'"
237
    echo "Partition $INSTALL_PART not found! See 'fdisk -l'"
237
    echo "Or you have to reboot first to make the partition table active"; echo
238
    echo "Or you have to reboot first to make the partition table active"; echo
238
    exit_now 1
239
    exit_now 1
239
fi
240
fi
240
 
241
 
241
 
242
 
242
### test if $INSTALL_PART is a Linux partition
243
### test if $INSTALL_PART is a Linux partition
243
### -----------------------------------------------------------
244
### -----------------------------------------------------------
244
fdisk -l | grep "Linux$" | cut -d" " -f1 | grep -q "^${INSTALL_PART}$"
245
fdisk -l | grep "Linux$" | cut -d" " -f1 | grep -q "^${INSTALL_PART}$"
245
if [ "$?" != "0" ]; then
246
if [ "$?" != "0" ]; then
246
    echo "Partition $INSTALL_PART is not a Linux partition! (see 'fdisk -l')"
247
    echo "Partition $INSTALL_PART is not a Linux partition! (see 'fdisk -l')"
247
    echo "Use fdisk and/or qtparted to create a Linux partition!"
248
    echo "Use fdisk and/or qtparted to create a Linux partition!"
248
    echo "You have to reboot first to make the partition table active"; echo
249
    echo "You have to reboot first to make the partition table active"; echo
249
    exit_now 1
250
    exit_now 1
250
fi
251
fi
251
 
252
 
252
 
253
 
253
### test if $SWAP_PART exists and is a Linux Swap partition
254
### test if $SWAP_PART exists and is a Linux Swap partition
254
### -----------------------------------------------------------
255
### -----------------------------------------------------------
255
if [ $SWAP_PART ]; then
256
if [ $SWAP_PART ]; then
256
    fdisk -l | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
257
    fdisk -l | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
257
    if [ "$?" != "0" ]; then
258
    if [ "$?" != "0" ]; then
258
	echo "Swap partition $SWAP_PART not found! (see 'fdisk -l')"
259
	echo "Swap partition $SWAP_PART not found! (see 'fdisk -l')"
259
	echo "Or you have to reboot first to make the partition table active"; echo
260
	echo "Or you have to reboot first to make the partition table active"; echo
260
	exit_now 1
261
	exit_now 1
261
    fi
262
    fi
262
    fdisk -l | grep "Linux swap$" | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
263
    fdisk -l | grep "Linux swap$" | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
263
    if [ "$?" != "0" ]; then
264
    if [ "$?" != "0" ]; then
264
	echo "Partition $SWAP_PART is not a Linux swap partition! (see 'fdisk -l')"
265
	echo "Partition $SWAP_PART is not a Linux swap partition! (see 'fdisk -l')"
265
	echo "Use fdisk and/or qtparted to create a Linux Swap partition!"
266
	echo "Use fdisk and/or qtparted to create a Linux Swap partition!"
266
	echo "You have to reboot first to make the partition table active"; echo
267
	echo "You have to reboot first to make the partition table active"; echo
267
	exit_now 1
268
	exit_now 1
268
    fi
269
    fi
269
fi
270
fi
270
 
271
 
271
 
272
 
272
### set $INSTALL_DEV (eg. /dev/sda)
273
### set $INSTALL_DEV (eg. /dev/sda)
273
### -----------------------------------------------------------
274
### -----------------------------------------------------------
274
INSTALL_DEV=$( echo "$INSTALL_PART" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' )
275
INSTALL_DEV=$( echo "$INSTALL_PART" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' )
275
INSTALL_PART_NR=$( echo "$INSTALL_PART" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' )
276
INSTALL_PART_NR=$( echo "$INSTALL_PART" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' )
276
 
277
 
277
 
278
 
278
### print warning
279
### print warning
279
### -----------------------------------------------------------
280
### -----------------------------------------------------------
280
echo                     "------------------------------------------------------------"
281
echo                     "------------------------------------------------------------"
281
echo                     "   LiveCD will be installed on partition $INSTALL_PART"
282
echo                     "   LiveCD will be installed on partition $INSTALL_PART"
282
[ "$SWAP_PART" ] && echo " Partition $SWAP_PART will be used as swap partition."
283
[ "$SWAP_PART" ] && echo " Partition $SWAP_PART will be used as swap partition."
283
[ ! $NOGRUB ]    && echo " GRUB will be installed in Master Boot Record of $MBR_DEV"
284
[ ! $NOGRUB ]    && echo " GRUB will be installed in Master Boot Record of $MBR_DEV"
284
echo                     "       !! All data on $INSTALL_PART will be lost !!"
285
echo                     "       !! All data on $INSTALL_PART will be lost !!"
285
echo                     "------------------------------------------------------------"
286
echo                     "------------------------------------------------------------"
286
echo
287
echo
287
 
288
 
288
 
289
 
289
### continue?
290
### continue?
290
### -----------------------------------------------------------
291
### -----------------------------------------------------------
291
if [ ! $YES ]; then
292
if [ ! $YES ]; then
292
    echo -n "Continue (y/N)? "
293
    echo -n "Continue (y/N)? "
293
    read key
294
    read key
294
    echo
295
    echo
295
    [ "$key" != "y" ] && exit_now 0
296
    [ "$key" != "y" ] && exit_now 0
296
fi
297
fi
297
 
298
 
298
 
299
 
299
### format $SWAP_PART
300
### format $SWAP_PART
300
### -----------------------------------------------------------
301
### -----------------------------------------------------------
301
if [ $SWAP_PART ]; then
302
if [ $SWAP_PART ]; then
302
    echo "Make swap on $SWAP_PART ..."
303
    echo "Make swap on $SWAP_PART ..."
303
    mkswap $SWAP_PART
304
    mkswap $SWAP_PART
304
    echo
305
    echo
305
fi
306
fi
306
 
307
 
307
 
308
 
308
### format $INSTALL_PART
309
### format $INSTALL_PART
309
### -----------------------------------------------------------
310
### -----------------------------------------------------------
310
echo -n "Format $INSTALL_PART, please wait ... " 
311
echo -n "Format $INSTALL_PART, please wait ... " 
311
mkfs.ext3 -q $INSTALL_PART || exit_now 1
312
mkfs.ext3 -q $INSTALL_PART || exit_now 1
312
echo "done."; echo
313
echo "done."; echo
313
 
314
 
314
 
315
 
315
### mount $INSTALL_PART
316
### mount $INSTALL_PART
316
### -----------------------------------------------------------
317
### -----------------------------------------------------------
317
echo -n "Try to mount $INSTALL_PART to $NEW ... "
318
echo -n "Try to mount $INSTALL_PART to $NEW ... "
318
mkdir -p $NEW
319
mkdir -p $NEW
319
mount $INSTALL_PART $NEW || exit_now 1
320
mount $INSTALL_PART $NEW || exit_now 1
320
echo "done."; echo
321
echo "done."; echo
321
 
322
 
322
 
323
 
323
### copy root dirs
324
### copy root dirs
324
### -----------------------------------------------------------
325
### -----------------------------------------------------------
325
echo "Copy Live System to $INSTALL_PART ..."
326
echo "Copy Live System to $INSTALL_PART ..."
326
root_dirs=$( ls / )
327
root_dirs=$( ls / )
327
for dir in $root_dirs; do
328
for dir in $root_dirs; do
328
    # check if dir is not in $DIR_NOT_COPY
329
    # check if dir is not in $DIR_NOT_COPY
329
    do_not_copy=""
330
    do_not_copy=""
330
    for not_dir in $DIR_NOT_COPY; do
331
    for not_dir in $DIR_NOT_COPY; do
331
	if [ "$not_dir" = "/$dir" ]; then 
332
	if [ "$not_dir" = "/$dir" ]; then 
332
	    do_not_copy="yes"
333
	    do_not_copy="yes"
333
	    break
334
	    break
334
	fi
335
	fi
335
    done
336
    done
336
    # do not copy links
337
    # do not copy links
337
    [ -L /$dir ] && do_not_copy="yes"
338
    [ -L /$dir ] && do_not_copy="yes"
338
 
339
 
339
    fail=""
340
    fail=""
340
    if [ ! $do_not_copy ]; then
341
    if [ ! $do_not_copy ]; then
341
	echo -n "  * Copy  /$dir ... "
342
	echo -n "  * Copy  /$dir ... "
342
	cp -a /$dir $NEW || fail=true
343
	cp -a /$dir $NEW || fail=true
343
	echo "done."
344
	echo "done."
344
    fi
345
    fi
345
done
346
done
346
echo
347
echo
347
if [ $fail ]; then
348
if [ $fail ]; then
348
    echo "ERROR: Not everything was copied to $INSTALL_PART"
349
    echo "ERROR: Not everything was copied to $INSTALL_PART"
349
    exit_now 1
350
    exit_now 1
350
fi
351
fi
351
 
352
 
352
 
353
 
353
### move /usr/opt back to /opt
354
### move /usr/opt back to /opt
354
### -----------------------------------------------------------
355
### -----------------------------------------------------------
355
if [ -d $NEW/usr/opt ]; then
356
if [ -d $NEW/usr/opt ]; then
356
    echo -n "Move /opt back ... "
357
    echo -n "Move /opt back ... "
357
    mv $NEW/usr/opt $NEW/
358
    mv $NEW/usr/opt $NEW/
358
    echo "done."; echo
359
    echo "done."; echo
359
fi
360
fi
360
 
361
 
361
 
362
 
362
### create dirs which were not copied
363
### create dirs which were not copied
363
### -----------------------------------------------------------
364
### -----------------------------------------------------------
364
for dir in $DIR_NOT_COPY; do
365
for dir in $DIR_NOT_COPY; do
365
    mkdir $NEW/$dir
366
    mkdir $NEW/$dir
366
done
367
done
367
# we do not need this directories
368
# we do not need this directories
368
rmdir $NEW/livecd
369
rmdir $NEW/livecd
369
# if not yet existing, create
370
# if not yet existing, create
370
mkdir -p $NEW/srv
371
mkdir -p $NEW/srv
371
mkdir -p $NEW/selinux
372
mkdir -p $NEW/selinux
372
 
373
 
373
 
374
 
374
### copy back original files
375
### copy back original files
375
### -----------------------------------------------------------
376
### -----------------------------------------------------------
376
echo -n "Restore original files ... " 
377
echo -n "Restore original files ... " 
377
for file in $FILES_RESTORE; do
378
for file in $FILES_RESTORE; do
378
    [ -r $NEW/${file}.ori ] && mv -f $NEW/${file}.ori $NEW/${file} 
379
    [ -r $NEW/${file}.ori ] && mv -f $NEW/${file}.ori $NEW/${file} 
379
done
380
done
380
echo "done."; echo
381
echo "done."; echo
381
 
382
 
382
 
383
 
383
### define kernel version
384
### define kernel version
384
### -----------------------------------------------------------
385
### -----------------------------------------------------------
385
rpm --quiet -q kernel     && UP_installed=true
386
rpm --quiet -q kernel     && UP_installed=true
386
rpm --quiet -q kernel-smp && SMP_installed=true
387
rpm --quiet -q kernel-smp && SMP_installed=true
387
[ $UP_installed ]  && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel 2>/dev/null )
388
[ $UP_installed ]  && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel 2>/dev/null )
388
[ $SMP_installed ] && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel-smp  2>/dev/null )
389
[ $SMP_installed ] && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel-smp  2>/dev/null )
389
if [ ! $KERNEL_VERSION ]; then
390
if [ ! $KERNEL_VERSION ]; then
390
    echo "ERROR: Kernel version could not be determined - installation failed"; echo
391
    echo "ERROR: Kernel version could not be determined - installation failed"; echo
391
    exit_now 1
392
    exit_now 1
392
fi    
393
fi    
393
 
394
 
394
 
395
 
395
 
396
 
396
if [ ! $NOGRUB ]; then
397
if [ ! $NOGRUB ]; then
397
 
398
 
398
    ### Backup Master Boot Record MBR
399
    ### Backup Master Boot Record MBR
399
    ### -----------------------------------------------------------
400
    ### -----------------------------------------------------------
400
    if [ ! $NOGRUB ]; then
401
    if [ ! $NOGRUB ]; then
401
	# do we have already a backup?
402
	# do we have already a backup?
402
	MBR_FILENAME="MBR$( echo $MBR_DEV | tr / _ ).bak"
403
	MBR_FILENAME="MBR$( echo $MBR_DEV | tr / _ ).bak"
403
	if [ ! -e /tmp/$MBR_FILENAME ]; then
404
	if [ ! -e /tmp/$MBR_FILENAME ]; then
404
	    echo "Backup Master Boot Record (MBR) of $MBR_DEV ..."
405
	    echo "Backup Master Boot Record (MBR) of $MBR_DEV ..."
405
	    dd if=$MBR_DEV of=/tmp/$MBR_FILENAME bs=512 count=1
406
	    dd if=$MBR_DEV of=/tmp/$MBR_FILENAME bs=512 count=1
406
	fi
407
	fi
407
	cp -a /tmp/$MBR_FILENAME $NEW/$MBR_FILENAME
408
	cp -a /tmp/$MBR_FILENAME $NEW/$MBR_FILENAME
408
	echo "MBR saved as $MBR_FILENAME on $INSTALL_PART and on /tmp"
409
	echo "MBR saved as $MBR_FILENAME on $INSTALL_PART and on /tmp"
409
	echo
410
	echo
410
    fi
411
    fi
411
 
412
 
412
 
413
 
413
    ### install grub
414
    ### install grub
414
    ### -----------------------------------------------------------
415
    ### -----------------------------------------------------------
415
    echo "Run grub-install ... "
416
    echo "Run grub-install ... "
416
    mkdir -p $NEW/boot/grub
417
    mkdir -p $NEW/boot/grub
417
    if [ $FLOPPY ]; then
418
    if [ $FLOPPY ]; then
418
	grub-install --root-directory=$NEW $MBR_DEV
419
	grub-install --root-directory=$NEW $MBR_DEV
419
    else
420
    else
420
	grub-install --no-floppy --root-directory=$NEW $MBR_DEV
421
	grub-install --no-floppy --root-directory=$NEW $MBR_DEV
421
    fi
422
    fi
422
    echo "done."; echo
423
    echo "done."; echo
423
 
424
 
424
 
425
 
425
    ### check for device.map file 
426
    ### check for device.map file 
426
    ### -----------------------------------------------------------
427
    ### -----------------------------------------------------------
427
    DEVICE_MAP=$NEW/boot/grub/device.map
428
    DEVICE_MAP=$NEW/boot/grub/device.map
428
    if [ ! -e $NEW/boot/grub/device.map ]; then
429
    if [ ! -e $NEW/boot/grub/device.map ]; then
429
	echo "ERROR: $NEW/boot/grub/device.map not found"
430
	echo "ERROR: $NEW/boot/grub/device.map not found"
430
	exit_now 1
431
	exit_now 1
431
    fi
432
    fi
432
 
433
 
433
 
434
 
434
    ### convert dev syntax to grub syntax
435
    ### convert dev syntax to grub syntax
435
    ### -----------------------------------------------------------
436
    ### -----------------------------------------------------------
436
    GRUB_INSTALL_DEV=$( grep $INSTALL_DEV $DEVICE_MAP | awk '{ print $1 }' )
437
    GRUB_INSTALL_DEV=$( grep $INSTALL_DEV $DEVICE_MAP | awk '{ print $1 }' )
437
    GRUB_ROOT_PART=$( echo "$GRUB_INSTALL_DEV" | sed "s%)$%,`expr $INSTALL_PART_NR - 1`)%" )
438
    GRUB_ROOT_PART=$( echo "$GRUB_INSTALL_DEV" | sed "s%)$%,`expr $INSTALL_PART_NR - 1`)%" )
438
 
439
 
439
 
440
 
440
    ### find active Windows partition
441
    ### find active Windows partition
441
    ### -----------------------------------------------------------
442
    ### -----------------------------------------------------------
442
    if [ ! $WIN_PART ]; then
443
    if [ ! $WIN_PART ]; then
443
        # try to find active Windows partition
444
        # try to find active Windows partition
444
	WIN_PART=$( fdisk -l 2>/dev/null | awk '{ if ($2 == "*" && $7 ~ "NTFS") print $1 }' | head -1 )
445
	WIN_PART=$( fdisk -l 2>/dev/null | awk '{ if ($2 == "*" && $7 ~ "NTFS") print $1 }' | head -1 )
445
    fi
446
    fi
446
 
447
 
447
    if [ $WIN_PART ]; then
448
    if [ $WIN_PART ]; then
448
	WIN_installed=true
449
	WIN_installed=true
449
	WIN_DISK=$( echo "$WIN_PART" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' )
450
	WIN_DISK=$( echo "$WIN_PART" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' )
450
	WIN_PART_NR=$( echo "$WIN_PART" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' )
451
	WIN_PART_NR=$( echo "$WIN_PART" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' )
451
        # convert dev syntax to grub syntax
452
        # convert dev syntax to grub syntax
452
	GRUB_WIN_DEV=$( grep $WIN_DISK $DEVICE_MAP | awk '{ print $1 }' )
453
	GRUB_WIN_DEV=$( grep $WIN_DISK $DEVICE_MAP | awk '{ print $1 }' )
453
	GRUB_WIN_PART=$( echo "$GRUB_WIN_DEV" | sed "s%)$%,`expr $WIN_PART_NR - 1`)%" )
454
	GRUB_WIN_PART=$( echo "$GRUB_WIN_DEV" | sed "s%)$%,`expr $WIN_PART_NR - 1`)%" )
454
 
455
 
455
        # $GRUB_WIN_PART should be something like (hd0,0)
456
        # $GRUB_WIN_PART should be something like (hd0,0)
456
	echo "Found active Windows partition ( $WIN_PART = $GRUB_WIN_PART )" 
457
	echo "Found active Windows partition ( $WIN_PART = $GRUB_WIN_PART )" 
457
	echo "Will add entry for Windows in GRUB."
458
	echo "Will add entry for Windows in GRUB."
458
	echo
459
	echo
459
    fi
460
    fi
460
 
461
 
461
 
462
 
462
    ### create grub.conf file
463
    ### create grub.conf file
463
    ### -----------------------------------------------------------
464
    ### -----------------------------------------------------------
464
    echo "Create grub.conf ..."
465
    echo "Create grub.conf ..."
465
 
466
 
466
    TITLE="Linux"
467
    TITLE="Linux"
467
    [ -e $NEW//etc/redhat-release ] && TITLE=$( cat $NEW/etc/redhat-release )
468
    [ -e $NEW//etc/redhat-release ] && TITLE=$( cat $NEW/etc/redhat-release )
468
 
469
 
469
    cat > $NEW/boot/grub/grub.conf <<EOF
470
    cat > $NEW/boot/grub/grub.conf <<EOF
470
# grub.conf generated by $SCRIPTNAME
471
# grub.conf generated by $SCRIPTNAME
471
default=0
472
default=0
472
timeout=5
473
timeout=5
473
splashimage=$GRUB_ROOT_PART/boot/grub/splash.xpm.gz
474
splashimage=$GRUB_ROOT_PART/boot/grub/splash.xpm.gz
474
#hiddenmenu
475
#hiddenmenu
475
EOF
476
EOF
476
 
477
 
477
    if [ $UP_installed ]; then
478
    if [ $UP_installed ]; then
478
	echo "Add entry for UP kernel into grub.conf"
479
	echo "Add entry for UP kernel into grub.conf"
479
	cat >> $NEW/boot/grub/grub.conf <<EOF
480
	cat >> $NEW/boot/grub/grub.conf <<EOF
480
title $TITLE (${KERNEL_VERSION})
481
title $TITLE (${KERNEL_VERSION})
481
        root $GRUB_ROOT_PART
482
        root $GRUB_ROOT_PART
482
	kernel /boot/vmlinuz-$KERNEL_VERSION ro root=$INSTALL_PART
483
	kernel /boot/vmlinuz-$KERNEL_VERSION ro root=$INSTALL_PART
483
	initrd /boot/initrd-$KERNEL_VERSION.img
484
	initrd /boot/initrd-$KERNEL_VERSION.img
484
EOF
485
EOF
485
    fi
486
    fi
486
 
487
 
487
    if [ $SMP_installed ]; then
488
    if [ $SMP_installed ]; then
488
	echo "Add entry for SMP kernel into grub.conf"
489
	echo "Add entry for SMP kernel into grub.conf"
489
	cat >> $NEW/boot/grub/grub.conf <<EOF
490
	cat >> $NEW/boot/grub/grub.conf <<EOF
490
title $TITLE (${KERNEL_VERSION}smp)
491
title $TITLE (${KERNEL_VERSION}smp)
491
        root $GRUB_ROOT_PART
492
        root $GRUB_ROOT_PART
492
	kernel /boot/vmlinuz-${KERNEL_VERSION}smp ro root=$INSTALL_PART
493
	kernel /boot/vmlinuz-${KERNEL_VERSION}smp ro root=$INSTALL_PART
493
	initrd /boot/initrd-${KERNEL_VERSION}smp.img
494
	initrd /boot/initrd-${KERNEL_VERSION}smp.img
494
EOF
495
EOF
495
    fi
496
    fi
496
 
497
 
497
    if [ $WIN_installed ]; then
498
    if [ $WIN_installed ]; then
498
	echo "Add entry for Windows into grub.conf"
499
	echo "Add entry for Windows into grub.conf"
499
	cat >> $NEW/boot/grub/grub.conf <<EOF
500
	cat >> $NEW/boot/grub/grub.conf <<EOF
500
title Windows
501
title Windows
501
        rootnoverify $GRUB_WIN_PART
502
        rootnoverify $GRUB_WIN_PART
502
        chainloader +1
503
        chainloader +1
503
EOF
504
EOF
504
    fi
505
    fi
505
 
506
 
506
    chmod 600 $NEW/boot/grub/grub.conf
507
    chmod 600 $NEW/boot/grub/grub.conf
507
    ln -s ../boot/grub/grub.conf $NEW/etc/grub.conf
508
    ln -s ../boot/grub/grub.conf $NEW/etc/grub.conf
508
    ln -s ./grub.conf $NEW/boot/grub/menu.lst
509
    ln -s ./grub.conf $NEW/boot/grub/menu.lst
509
    echo "done."; echo
510
    echo "done."; echo
510
 
511
 
511
fi
512
fi
512
 
513
 
513
 
514
 
514
### install kernel and other files into /boot
515
### install kernel and other files into /boot
515
### -----------------------------------------------------------
516
### -----------------------------------------------------------
516
echo "Install kernel(s) ..."
517
echo "Install kernel(s) ..."
517
 
518
 
518
[ -e /boot/vmlinuz ]      && BOOT_DIR=/boot
519
[ -e /boot/vmlinuz ]      && BOOT_DIR=/boot
519
[ -e /boot/boot/vmlinuz ] && BOOT_DIR=/boot/boot
520
[ -e /boot/boot/vmlinuz ] && BOOT_DIR=/boot/boot
520
 
521
 
521
if [ ! $BOOT_DIR ]; then
522
if [ ! $BOOT_DIR ]; then
522
    echo "ERROR: No kernel found - installation failed"; echo
523
    echo "ERROR: No kernel found - installation failed"; echo
523
    exit_now 1
524
    exit_now 1
524
fi
525
fi
525
 
526
 
526
cp -a $BOOT_DIR/vmlinuz            $NEW/boot/vmlinuz-${KERNEL_VERSION}
527
cp -a $BOOT_DIR/vmlinuz            $NEW/boot/vmlinuz-${KERNEL_VERSION}
527
cp -a $BOOT_DIR/vmlinuzs           $NEW/boot/vmlinuz-${KERNEL_VERSION}smp  2>/dev/null
528
cp -a $BOOT_DIR/vmlinuzs           $NEW/boot/vmlinuz-${KERNEL_VERSION}smp  2>/dev/null
528
cp -a $BOOT_DIR/System.map-*       $NEW/boot/
529
cp -a $BOOT_DIR/System.map-*       $NEW/boot/
529
cp -a $BOOT_DIR/config-*           $NEW/boot/
530
cp -a $BOOT_DIR/config-*           $NEW/boot/
530
cp -a $BOOT_DIR/symvers-*.gz       $NEW/boot/        2>/dev/null
531
cp -a $BOOT_DIR/symvers-*.gz       $NEW/boot/        2>/dev/null
531
cp -a $BOOT_DIR/grub/splash.xpm.gz $NEW/boot/grub/
532
cp -a $BOOT_DIR/grub/splash.xpm.gz $NEW/boot/grub/
532
cp -a $BOOT_DIR/message.ja         $NEW/boot/        2>/dev/null
533
cp -a $BOOT_DIR/message.ja         $NEW/boot/        2>/dev/null
533
cp -a $BOOT_DIR/message            $NEW/boot/        2>/dev/null
534
cp -a $BOOT_DIR/message            $NEW/boot/        2>/dev/null
534
 
535
 
535
echo "done."; echo
536
echo "done."; echo
536
 
537
 
537
 
538
 
538
### create /etc/fstab
539
### create /etc/fstab
539
### -----------------------------------------------------------
540
### -----------------------------------------------------------
540
cat > $NEW/etc/fstab <<EOF
541
cat > $NEW/etc/fstab <<EOF
541
$INSTALL_PART         /                    ext3    defaults        1 1
542
$INSTALL_PART         /                    ext3    defaults        1 1
542
devpts            /dev/pts             devpts  gid=5,mode=620  0 0
543
devpts            /dev/pts             devpts  gid=5,mode=620  0 0
543
tmpfs             /dev/shm             tmpfs   defaults        0 0
544
tmpfs             /dev/shm             tmpfs   defaults        0 0
544
proc              /proc                proc    defaults        0 0
545
proc              /proc                proc    defaults        0 0
545
sysfs             /sys                 sysfs   defaults        0 0
546
sysfs             /sys                 sysfs   defaults        0 0
546
EOF
547
EOF
547
if [ $SWAP_PART ]; then
548
if [ $SWAP_PART ]; then
548
    echo "$SWAP_PART         swap                 swap    defaults        0 0" >> $NEW/etc/fstab
549
    echo "$SWAP_PART         swap                 swap    defaults        0 0" >> $NEW/etc/fstab
549
fi
550
fi
550
 
551
 
551
 
552
 
552
### make initrd 
553
### make initrd 
553
### (needs $NEW/etc/fstab to find correct modules for root filesystem !!)
554
### (needs $NEW/etc/fstab to find correct modules for root filesystem !!)
554
### -----------------------------------------------------------
555
### -----------------------------------------------------------
555
echo "Create initrd(s) ..."
556
echo "Create initrd(s) ..."
556
# initrd should not be build on tmpfs (we take $NEW/tmp instead of /tmp)
557
# initrd should not be build on tmpfs (we take $NEW/tmp instead of /tmp)
557
sed -i "s|^TMPDIR=.*|TMPDIR=\"$NEW/tmp\"|" /usr/sbin/livecd-mkinitrd
558
sed -i "s|^TMPDIR=.*|TMPDIR=\"$NEW/tmp\"|" /usr/sbin/livecd-mkinitrd
558
 
559
 
559
if [ $UP_installed ]; then
560
if [ $UP_installed ]; then
560
    depmod -a ${KERNEL_VERSION}
561
    depmod -a ${KERNEL_VERSION}
561
    /usr/sbin/livecd-mkinitrd --fstab=$NEW/etc/fstab \
562
    /usr/sbin/livecd-mkinitrd --fstab=$NEW/etc/fstab \
562
                    $NEW//boot/initrd-${KERNEL_VERSION}.img ${KERNEL_VERSION}
563
                    $NEW//boot/initrd-${KERNEL_VERSION}.img ${KERNEL_VERSION}
563
    if [ ! -e $NEW/boot/initrd-${KERNEL_VERSION}.img ]; then
564
    if [ ! -e $NEW/boot/initrd-${KERNEL_VERSION}.img ]; then
564
	echo "ERROR: Failed to create $NEW/boot/initrd-${KERNEL_VERSION}.img"
565
	echo "ERROR: Failed to create $NEW/boot/initrd-${KERNEL_VERSION}.img"
565
	exit_now 1
566
	exit_now 1
566
    fi
567
    fi
567
fi
568
fi
568
if [ $SMP_installed ]; then
569
if [ $SMP_installed ]; then
569
    depmod -a ${KERNEL_VERSION}smp
570
    depmod -a ${KERNEL_VERSION}smp
570
    /usr/sbin/livecd-mkinitrd --fstab=$NEW/etc/fstab \
571
    /usr/sbin/livecd-mkinitrd --fstab=$NEW/etc/fstab \
571
                    $NEW/boot/initrd-${KERNEL_VERSION}smp.img ${KERNEL_VERSION}smp
572
                    $NEW/boot/initrd-${KERNEL_VERSION}smp.img ${KERNEL_VERSION}smp
572
    if [ ! -e $NEW/boot/initrd-${KERNEL_VERSION}smp.img ]; then
573
    if [ ! -e $NEW/boot/initrd-${KERNEL_VERSION}smp.img ]; then
573
	echo "ERROR: Failed to create $NEW/boot/initrd-${KERNEL_VERSION}smp.img"
574
	echo "ERROR: Failed to create $NEW/boot/initrd-${KERNEL_VERSION}smp.img"
574
	exit_now 1
575
	exit_now 1
575
    fi
576
    fi
576
fi
577
fi
577
echo "done."; echo
578
echo "done."; echo
578
 
579
 
579
 
580
 
580
### remove LiveCD init.d scripts
581
### remove LiveCD init.d scripts
581
### -----------------------------------------------------------
582
### -----------------------------------------------------------
582
for file in $LIVECD_INIT_SCRIPTS; do
583
for file in $LIVECD_INIT_SCRIPTS; do
583
    rm -f $NEW/etc/rc.d/init.d/$file
584
    rm -f $NEW/etc/rc.d/init.d/$file
584
    for n in 0 1 2 3 4 5 6; do
585
    for n in 0 1 2 3 4 5 6; do
585
	rm -f $NEW/etc/rc.d/rc${n}.d/*$file
586
	rm -f $NEW/etc/rc.d/rc${n}.d/*$file
586
    done
587
    done
587
done
588
done
588
 
589
 
589
 
590
 
590
### restore cronjobs
591
### restore cronjobs
591
### -----------------------------------------------------------
592
### -----------------------------------------------------------
592
mv $NEW/etc/cron_backup/sysstat $NEW/etc/cron.d/ 2>/dev/null
593
mv $NEW/etc/cron_backup/sysstat $NEW/etc/cron.d/ 2>/dev/null
593
mv $NEW/etc/cron_backup/00-makewhatis.cron.weekly $NEW/etc/cron.weekly/00-makewhatis.cron 2>/dev/null
594
mv $NEW/etc/cron_backup/00-makewhatis.cron.weekly $NEW/etc/cron.weekly/00-makewhatis.cron 2>/dev/null
594
mv $NEW/etc/cron_backup/* $NEW/etc/cron.daily/
595
mv $NEW/etc/cron_backup/* $NEW/etc/cron.daily/
595
 
596
 
596
 
597
 
597
### prepare chroot to $NEW
598
### prepare chroot to $NEW
598
### -----------------------------------------------------------
599
### -----------------------------------------------------------
599
mount --bind /dev $NEW/dev
600
mount --bind /dev $NEW/dev
600
mount --bind /sys $NEW/sys
601
mount --bind /sys $NEW/sys
601
mount -t proc proc $NEW/proc
602
mount -t proc proc $NEW/proc
602
 
603
 
603
 
604
 
604
### turn on kudzu again
605
### turn on kudzu again
605
### -----------------------------------------------------------
606
### -----------------------------------------------------------
606
chroot $NEW chkconfig kudzu on
607
chroot $NEW chkconfig kudzu on
607
 
608
 
608
 
609
 
609
### remove RPMs that can break future updates  
610
### remove RPMs that can break future updates  
610
### -----------------------------------------------------------
611
### -----------------------------------------------------------
611
if [ ! $NORPMREMOVE ]; then
612
if [ ! $NORPMREMOVE ]; then
612
    echo "Remove RPMs that may break future updates ..."
613
    echo "Remove RPMs that may break future updates ..."
613
    chroot $NEW rpm -qa 2>/dev/null > /tmp/rpmlist
614
    chroot $NEW rpm -qa 2>/dev/null > /tmp/rpmlist
614
 
615
 
615
    # Scientific Linux RPMs
616
    # Scientific Linux RPMs
616
    RPMSTOREMOVE="$RPMS_TO_REMOVE $RPMS_TO_REMOVE_SL"
617
    RPMSTOREMOVE="$RPMS_TO_REMOVE $RPMS_TO_REMOVE_SL"
617
 
618
 
618
    # PSI Scientific Linux RPMs
619
    # PSI Scientific Linux RPMs
619
    if [ -e /etc/sysconfig/cfengine ]; then
620
    if [ -e /etc/sysconfig/cfengine ]; then
620
	RPMSTOREMOVE="$RPMS_TO_REMOVE $RPMS_TO_REMOVE_PSI"
621
	RPMSTOREMOVE="$RPMS_TO_REMOVE $RPMS_TO_REMOVE_PSI"
621
    fi
622
    fi
622
 
623
 
623
    for rpm in $RPMSTOREMOVE; do
624
    for rpm in $RPMSTOREMOVE; do
624
	rpms_remove=$( cat /tmp/rpmlist | grep "^$rpm" )
625
	rpms_remove=$( cat /tmp/rpmlist | grep "^$rpm" )
625
	for rpm_remove in $rpms_remove; do	
626
	for rpm_remove in $rpms_remove; do	
626
	    chroot $NEW rpm -e --nodeps $rpm_remove 2>/dev/null
627
	    chroot $NEW rpm -e --nodeps $rpm_remove 2>/dev/null
627
	    [ "$?" = "0" ] && echo "$rpm_remove removed"
628
	    [ "$?" = "0" ] && echo "$rpm_remove removed"
628
	done
629
	done
629
    done
630
    done
630
    echo "done."; echo
631
    echo "done."; echo
631
fi
632
fi
-
 
633
 
-
 
634
 
-
 
635
### disable nvidia driver 
-
 
636
### -----------------------------------------------------------
-
 
637
# not in case of a PSI installation
-
 
638
if [ ! -e /etc/sysconfig/cfengine ]; then
-
 
639
    if [ -e $new/etc/X11/xorg.conf.nv_SAVED ]; then
-
 
640
        # copy back original xorg.conf
-
 
641
	mv $new/etc/X11/xorg.conf.nv_SAVED $new/etc/X11/xorg.conf
-
 
642
        # disable nvidia libs
-
 
643
	LIB=lib
-
 
644
	[ $( arch ) = "x86_64" ] && LIB=lib64
-
 
645
	mv $new/usr/X11R6/$LIB/modules/extensions/xxx.libGLcore.a.saved_by_nvidia $new/usr/X11R6/$LIB/modules/extensions/libGLcore.a
-
 
646
	mv $new/usr/X11R6/$LIB/modules/extensions/xxx.libglx.a.saved_by_nvidia $new/usr/X11R6/$LIB/modules/extensions/libglx.a
-
 
647
	rm -f $new/usr/X11R6/$LIB/libGL.so*
-
 
648
	rm -f $new/usr/$LIB/libGLcore.so
-
 
649
    fi
-
 
650
fi
632
 
651
 
633
 
652
 
634
### umount $INSTALL_PART
653
### umount $INSTALL_PART
635
### -----------------------------------------------------------
654
### -----------------------------------------------------------
636
umount $NEW/dev
655
umount $NEW/dev
637
umount $NEW/sys
656
umount $NEW/sys
638
umount $NEW/proc
657
umount $NEW/proc
639
umount $INSTALL_PART
658
umount $INSTALL_PART
640
 
659
 
641
 
660
 
642
### print summary
661
### print summary
643
### -----------------------------------------------------------
662
### -----------------------------------------------------------
644
echo                     "--------------------------------------------------------------"
663
echo                     "--------------------------------------------------------------"
645
echo                     "  LiveCD installed on partition $INSTALL_PART"
664
echo                     "  LiveCD installed on partition $INSTALL_PART"
646
[ "$SWAP_PART" ] && echo "  Partition $SWAP_PART will be used as swap partition"
665
[ "$SWAP_PART" ] && echo "  Partition $SWAP_PART will be used as swap partition"
647
echo
666
echo
648
[ ! $NOGRUB ]    && echo "  GRUB installed in Master Boot Record (MBR) of $MBR_DEV"
667
[ ! $NOGRUB ]    && echo "  GRUB installed in Master Boot Record (MBR) of $MBR_DEV"
649
[ ! $NOGRUB ]    && echo "  MBR saved as $MBR_FILENAME on $INSTALL_PART and in /tmp"
668
[ ! $NOGRUB ]    && echo "  MBR saved as $MBR_FILENAME on $INSTALL_PART and in /tmp"
650
[ ! $NOGRUB ]    && echo "  If you have to restore MBR, execute under Linux:"
669
[ ! $NOGRUB ]    && echo "  If you have to restore MBR, execute under Linux:"
651
[ ! $NOGRUB ]    && echo "  # dd if=$MBR_FILENAME of=$MBR_DEV bs=512 count=1"
670
[ ! $NOGRUB ]    && echo "  # dd if=$MBR_FILENAME of=$MBR_DEV bs=512 count=1"
652
echo 
671
echo 
653
[ $WIN_PART ]    && echo "  Entry created in grub.conf for Windows partition $WIN_PART"
672
[ $WIN_PART ]    && echo "  Entry created in grub.conf for Windows partition $WIN_PART"
654
echo                     "--------------------------------------------------------------"
673
echo                     "--------------------------------------------------------------"
655
echo                     "End of $SCRIPTNAME"
674
echo                     "End of $SCRIPTNAME"
656
echo
675
echo