| Line 167... |
Line 167... |
| 167 |
|
167 |
|
| 168 |
done
|
168 |
done
|
| 169 |
echo
|
169 |
echo
|
| 170 |
|
170 |
|
| 171 |
|
171 |
|
| - |
|
172 |
### display fdisk -l
|
| - |
|
173 |
### -----------------------------------------------------------
|
| - |
|
174 |
echo "Output of 'fdisk -l' ..."
|
| - |
|
175 |
fdisk -l
|
| - |
|
176 |
echo
|
| - |
|
177 |
|
| - |
|
178 |
|
| 172 |
### test if $INSTALL_PART is defined and exists
|
179 |
### test if $INSTALL_PART is defined and exists
|
| 173 |
### -----------------------------------------------------------
|
180 |
### -----------------------------------------------------------
|
| 174 |
if [ ! $INSTALL_PART ]; then
|
181 |
if [ ! $INSTALL_PART ]; then
|
| 175 |
echo "No partition defined for installation"
|
182 |
echo "No partition defined for installation"
|
| 176 |
echo "Please see '$SCRIPTNAME -h'."; echo
|
183 |
echo "Please see '$SCRIPTNAME -h'."; echo
|
| Line 191... |
Line 198... |
| 191 |
|
198 |
|
| 192 |
### test if $INSTALL_PART exists
|
199 |
### test if $INSTALL_PART exists
|
| 193 |
### -----------------------------------------------------------
|
200 |
### -----------------------------------------------------------
|
| 194 |
fdisk -l | cut -d" " -f1 | grep -q "^${INSTALL_PART}$"
|
201 |
fdisk -l | cut -d" " -f1 | grep -q "^${INSTALL_PART}$"
|
| 195 |
if [ "$?" != "0" ]; then
|
202 |
if [ "$?" != "0" ]; then
|
| 196 |
echo "Partition $INSTALL_PART not found! (see 'disk -l')"; echo
|
203 |
echo "Partition $INSTALL_PART not found! See 'fdisk -l'"
|
| - |
|
204 |
echo "or you have to reboot first to make the partition table active"; echo
|
| 197 |
exit_now 1
|
205 |
exit_now 1
|
| 198 |
fi
|
206 |
fi
|
| 199 |
|
207 |
|
| 200 |
|
208 |
|
| 201 |
### set $INSTALL_DEV (eg. /dev/sda)
|
209 |
### set $INSTALL_DEV (eg. /dev/sda)
|
| Line 207... |
Line 215... |
| 207 |
### test if $SWAP_PART exists
|
215 |
### test if $SWAP_PART exists
|
| 208 |
### -----------------------------------------------------------
|
216 |
### -----------------------------------------------------------
|
| 209 |
if [ $SWAP_PART ]; then
|
217 |
if [ $SWAP_PART ]; then
|
| 210 |
fdisk -l | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
|
218 |
fdisk -l | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
|
| 211 |
if [ "$?" != "0" ]; then
|
219 |
if [ "$?" != "0" ]; then
|
| 212 |
echo "Swap partition $SWAP_PART not found! (see 'disk -l')"; echo
|
220 |
echo "Swap partition $SWAP_PART not found! (see 'fdisk -l')"
|
| - |
|
221 |
echo "Or you have to reboot first to make the partition table active"; echo
|
| 213 |
exit_now 1
|
222 |
exit_now 1
|
| 214 |
fi
|
223 |
fi
|
| 215 |
fdisk -l | grep "Linux swap" | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
|
224 |
fdisk -l | grep "Linux swap" | cut -d" " -f1 | grep -q "^${SWAP_PART}$"
|
| 216 |
if [ "$?" != "0" ]; then
|
225 |
if [ "$?" != "0" ]; then
|
| 217 |
echo "Partition $SWAP_PART is not a Linux swap partition! (see 'disk -l')"
|
226 |
echo "Partition $SWAP_PART is not a Linux swap partition! (see 'fdisk -l')"
|
| 218 |
echo "Use fdisk to create a Linux swap partition!"; echo
|
227 |
echo "Use fdisk to create a Linux swap partition!"
|
| - |
|
228 |
echo "You have to reboot first to make the partition table active"; echo
|
| 219 |
exit_now 1
|
229 |
exit_now 1
|
| 220 |
fi
|
230 |
fi
|
| 221 |
fi
|
231 |
fi
|
| 222 |
|
232 |
|
| 223 |
|
233 |
|
| 224 |
### print warning
|
234 |
### print warning
|
| 225 |
### -----------------------------------------------------------
|
235 |
### -----------------------------------------------------------
|
| 226 |
echo "------------------------------------------------------------"
|
236 |
echo "------------------------------------------------------------"
|
| 227 |
echo " LiveCD will be installed on partition $INSTALL_PART"
|
237 |
echo " LiveCD will be installed on partition $INSTALL_PART"
|
| 228 |
[ "$SWAP_PART" ] && echo " Partition $SWAP_PART will be used as swap partition."
|
238 |
[ "$SWAP_PART" ] && echo " Partition $SWAP_PART will be used as swap partition."
|
| 229 |
[ ! $NOGRUB ] && echo " GRUB will be installed in Master Boot Record of $MBR_DEV"
|
239 |
[ ! $NOGRUB ] && echo " GRUB will be installed in Master Boot Record of $MBR_DEV"
|
| Line 319... |
Line 329... |
| 319 |
|
329 |
|
| 320 |
### copy back original files
|
330 |
### copy back original files
|
| 321 |
### -----------------------------------------------------------
|
331 |
### -----------------------------------------------------------
|
| 322 |
echo -n "Restore original files ... "
|
332 |
echo -n "Restore original files ... "
|
| 323 |
for file in $FILES_RESTORE; do
|
333 |
for file in $FILES_RESTORE; do
|
| 324 |
[ -r $NEW/${file}.ori ] && cp -a $NEW/${file}.ori $NEW/${file}
|
334 |
[ -r $NEW/${file}.ori ] && mv -f $NEW/${file}.ori $NEW/${file}
|
| 325 |
done
|
335 |
done
|
| 326 |
echo "done."; echo
|
336 |
echo "done."; echo
|
| 327 |
|
337 |
|
| 328 |
|
338 |
|
| 329 |
### define kernel version
|
339 |
### define kernel version
|
| Line 407... |
Line 417... |
| 407 |
|
417 |
|
| 408 |
### create grub.conf file
|
418 |
### create grub.conf file
|
| 409 |
### -----------------------------------------------------------
|
419 |
### -----------------------------------------------------------
|
| 410 |
echo "Create grub.conf ..."
|
420 |
echo "Create grub.conf ..."
|
| 411 |
|
421 |
|
| - |
|
422 |
TITLE="Linux"
|
| - |
|
423 |
[ -e $NEW//etc/redhat-release ] && TITLE=$( cat $NEW/etc/redhat-release )
|
| - |
|
424 |
|
| 412 |
cat > $NEW/boot/grub/grub.conf <<EOF
|
425 |
cat > $NEW/boot/grub/grub.conf <<EOF
|
| 413 |
# grub.conf generated by $SCRIPTNAME
|
426 |
# grub.conf generated by $SCRIPTNAME
|
| 414 |
default=0
|
427 |
default=0
|
| 415 |
timeout=5
|
428 |
timeout=5
|
| 416 |
splashimage=$GRUB_ROOT_PART/boot/grub/splash.xpm.gz
|
429 |
splashimage=$GRUB_ROOT_PART/boot/grub/splash.xpm.gz
|
| Line 418... |
Line 431... |
| 418 |
EOF
|
431 |
EOF
|
| 419 |
|
432 |
|
| 420 |
if [ $UP_installed ]; then
|
433 |
if [ $UP_installed ]; then
|
| 421 |
echo "Add entry for UP kernel into grub.conf"
|
434 |
echo "Add entry for UP kernel into grub.conf"
|
| 422 |
cat >> $NEW/boot/grub/grub.conf <<EOF
|
435 |
cat >> $NEW/boot/grub/grub.conf <<EOF
|
| 423 |
title Scientific Linux (${KERNEL_VERSION})
|
436 |
title $TITLE (${KERNEL_VERSION})
|
| 424 |
root $GRUB_ROOT_PART
|
437 |
root $GRUB_ROOT_PART
|
| 425 |
kernel /boot/vmlinuz-$KERNEL_VERSION ro root=$INSTALL_PART
|
438 |
kernel /boot/vmlinuz-$KERNEL_VERSION ro root=$INSTALL_PART
|
| 426 |
initrd /boot/initrd-$KERNEL_VERSION.img
|
439 |
initrd /boot/initrd-$KERNEL_VERSION.img
|
| 427 |
EOF
|
440 |
EOF
|
| 428 |
fi
|
441 |
fi
|
| 429 |
|
442 |
|
| 430 |
if [ $SMP_installed ]; then
|
443 |
if [ $SMP_installed ]; then
|
| 431 |
echo "Add entry for SMP kernel into grub.conf"
|
444 |
echo "Add entry for SMP kernel into grub.conf"
|
| 432 |
cat >> $NEW/boot/grub/grub.conf <<EOF
|
445 |
cat >> $NEW/boot/grub/grub.conf <<EOF
|
| 433 |
title Scientific Linux (${KERNEL_VERSION}smp)
|
446 |
title $TITLE (${KERNEL_VERSION}smp)
|
| 434 |
root $GRUB_ROOT_PART
|
447 |
root $GRUB_ROOT_PART
|
| 435 |
kernel /boot/vmlinuz-${KERNEL_VERSION}smp ro root=$INSTALL_PART
|
448 |
kernel /boot/vmlinuz-${KERNEL_VERSION}smp ro root=$INSTALL_PART
|
| 436 |
initrd /boot/initrd-${KERNEL_VERSION}smp.img
|
449 |
initrd /boot/initrd-${KERNEL_VERSION}smp.img
|
| 437 |
EOF
|
450 |
EOF
|
| 438 |
fi
|
451 |
fi
|
| Line 551... |
Line 564... |
| 551 |
### -----------------------------------------------------------
|
564 |
### -----------------------------------------------------------
|
| 552 |
echo "--------------------------------------------------------------"
|
565 |
echo "--------------------------------------------------------------"
|
| 553 |
echo " LiveCD installed on partition $INSTALL_PART"
|
566 |
echo " LiveCD installed on partition $INSTALL_PART"
|
| 554 |
[ "$SWAP_PART" ] && echo " Partition $SWAP_PART will be used as swap partition"
|
567 |
[ "$SWAP_PART" ] && echo " Partition $SWAP_PART will be used as swap partition"
|
| 555 |
echo
|
568 |
echo
|
| 556 |
[ ! $NOGRUB ] && echo " GRUB installed in Master Boot Record (MBR) of $MBR_DEV."
|
569 |
[ ! $NOGRUB ] && echo " GRUB installed in Master Boot Record (MBR) of $MBR_DEV"
|
| 557 |
[ ! $NOGRUB ] && echo " MBR saved as $MBR_FILENAME on $INSTALL_PART and on /tmp"
|
570 |
[ ! $NOGRUB ] && echo " MBR saved as $MBR_FILENAME on $INSTALL_PART and in /tmp"
|
| 558 |
[ ! $NOGRUB ] && echo " If you have to restore MBR, execute under Linux:"
|
571 |
[ ! $NOGRUB ] && echo " If you have to restore MBR, execute under Linux:"
|
| 559 |
[ ! $NOGRUB ] && echo " # dd if=$MBR_FILENAME of=$MBR_DEV bs=512 count=1"
|
572 |
[ ! $NOGRUB ] && echo " # dd if=$MBR_FILENAME of=$MBR_DEV bs=512 count=1"
|
| 560 |
echo
|
573 |
echo
|
| 561 |
[ $WIN_PART ] && echo " Entry created in grub.conf for Windows partition $WIN_PART"
|
574 |
[ $WIN_PART ] && echo " Entry created in grub.conf for Windows partition $WIN_PART"
|
| 562 |
echo "--------------------------------------------------------------"
|
575 |
echo "--------------------------------------------------------------"
|