Subversion Repositories livecd

Rev

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

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