Subversion Repositories livecd

Rev

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

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