Subversion Repositories livecd

Rev

Rev 22 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22 Rev 24
Line 122... Line 122...
122
            usage; exit_now;;
122
            usage; exit_now;;
123
 
123
 
124
       --help)
124
       --help)
125
            usage; exit_now;;
125
            usage; exit_now;;
126
 
126
 
127
       -swap)
127
       -swap*)
128
           if echo $1 | grep -q '=' ; then
128
           if echo $1 | grep -q '=' ; then
129
	       SWAP_PART=$( echo $1 | sed 's/^-swap=//' )
129
	       SWAP_PART=$( echo $1 | sed 's/^-swap=//' )
130
	   else
130
	   else
131
	       shift
131
	       shift
132
               SWAP_PART=$2
132
               SWAP_PART=$1
133
	   fi
133
	   fi
134
	   shift; continue;;
134
	   shift; continue;;
135
 
135
 
136
       -mbr)
136
       -mbr*)
137
           if echo $1 | grep -q '=' ; then
137
           if echo $1 | grep -q '=' ; then
138
	       MBR_DEV=$( echo $1 | sed 's/^-mbr=//' )
138
	       MBR_DEV=$( echo $1 | sed 's/^-mbr=//' )
139
	   else
139
	   else
140
	       shift
140
	       shift
141
               MBR_DEV=$2
141
               MBR_DEV=$1
142
	   fi
142
	   fi
143
	   shift; continue;;
143
	   shift; continue;;
144
 
144
 
145
       -win)
145
       -win*)
146
           if echo $1 | grep -q '=' ; then
146
           if echo $1 | grep -q '=' ; then
147
	       WIN_PART=$( echo $1 | sed 's/^-win=//' )
147
	       WIN_PART=$( echo $1 | sed 's/^-win=//' )
148
	   else
148
	   else
149
	       shift
149
	       shift
150
               WIN_PART=$2
150
               WIN_PART=$1
151
	   fi
151
	   fi
152
	   shift; continue;;
152
	   shift; continue;;
153
 
153
 
154
       -nogrub)
154
       -nogrub)
155
            NOGRUB=$1; shift; continue;;
155
            NOGRUB=$1; shift; continue;;
Line 246... Line 246...
246
 
246
 
247
### Backup MBR
247
### Backup MBR
248
### -----------------------------------------------------------
248
### -----------------------------------------------------------
249
### to do !!!!!!!!!!
249
### to do !!!!!!!!!!
250
###
250
###
-
 
251
if [ ! $NOGRUB ]; then
-
 
252
    echo
-
 
253
fi
251
 
254
 
252
 
255
 
253
### format $INSTALL_PART
256
### format $INSTALL_PART
254
### -----------------------------------------------------------
257
### -----------------------------------------------------------
255
echo -n "Format $INSTALL_PART, please wait ... " 
258
echo -n "Format $INSTALL_PART, please wait ... " 
Line 319... Line 322...
319
    [ -r $NEW/${file}.ori ] && cp -a $NEW/${file}.ori $NEW/${file} 
322
    [ -r $NEW/${file}.ori ] && cp -a $NEW/${file}.ori $NEW/${file} 
320
done
323
done
321
echo "done."; echo
324
echo "done."; echo
322
 
325
 
323
 
326
 
-
 
327
 
324
### do some mounts for chroot $NEW (no more needed)
328
### define kernel version
325
### -----------------------------------------------------------
329
### -----------------------------------------------------------
326
# mount --bind /dev $NEW/dev
330
rpm --quiet -q kernel     && UP_installed=true
327
# mount --bind /sys $NEW/sys 
331
rpm --quiet -q kernel-smp && SMP_installed=true
-
 
332
[ $UP_installed ]  && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel 2>/dev/null )
-
 
333
[ $SMP_installed ] && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel-smp  2>/dev/null )
328
# mount -t proc proc $NEW/proc
334
if [ ! $KERNEL_VERSION ]; then
-
 
335
    echo "ERROR: Kernel version could not be determined - installation failed"; echo
-
 
336
    exit_now 1
-
 
337
fi    
-
 
338
 
329
 
339
 
330
 
340
 
-
 
341
 
-
 
342
if [ ! $NOGRUB ]; then
-
 
343
 
331
### install grub
344
    ### install grub
332
### -----------------------------------------------------------
345
    ### -----------------------------------------------------------
333
echo "Run grub-install: "; echo
346
    echo "Run grub-install: "; echo
334
mkdir -p $NEW/boot/grub
347
    mkdir -p $NEW/boot/grub
335
if [ $FLOPPY ]; then
348
    if [ $FLOPPY ]; then
Line 338... Line 351...
338
    grub-install --no-floppy --root-directory=$NEW $MBR_DEV
351
	grub-install --no-floppy --root-directory=$NEW $MBR_DEV
339
fi
352
    fi
340
echo "done."; echo
353
    echo "done."; echo
341
 
354
 
342
 
355
 
343
### define kernel version
-
 
344
### -----------------------------------------------------------
-
 
345
rpm --quiet -q kernel     && UP_installed=true
-
 
346
rpm --quiet -q kernel-smp && SMP_installed=true
-
 
347
[ $UP_installed ]  && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel 2>/dev/null )
-
 
348
[ $SMP_installed ] && KERNEL_VERSION=$( rpm -q --qf "%{V}-%{R}" kernel-smp  2>/dev/null )
-
 
349
if [ ! $KERNEL_VERSION ]; then
-
 
350
    echo "ERROR: Kernel version could not be determined - installation failed"; echo
-
 
351
    exit_now 1
-
 
352
fi    
-
 
353
 
-
 
354
 
-
 
355
### check for device.map file 
356
    ### check for device.map file 
356
### -----------------------------------------------------------
357
    ### -----------------------------------------------------------
357
DEVICE_MAP=$NEW/boot/grub/device.map
358
    DEVICE_MAP=$NEW/boot/grub/device.map
358
if [ ! -e $NEW/boot/grub/device.map ]; then
359
    if [ ! -e $NEW/boot/grub/device.map ]; then
359
    echo "ERROR: $NEW/boot/grub/device.map not found"
360
	echo "ERROR: $NEW/boot/grub/device.map not found"
Line 433... Line 434...
433
chmod 600 $NEW/boot/grub/grub.conf
434
    chmod 600 $NEW/boot/grub/grub.conf
434
ln -s ../boot/grub/grub.conf $NEW/etc/grub.conf
435
    ln -s ../boot/grub/grub.conf $NEW/etc/grub.conf
435
ln -s ./grub.conf $NEW/boot/grub/menu.lst
436
    ln -s ./grub.conf $NEW/boot/grub/menu.lst
436
echo "done."; echo
437
    echo "done."; echo
437
 
438
 
-
 
439
fi
-
 
440
 
438
 
441
 
439
### install kernel into /boot
442
### install kernel into /boot
440
### -----------------------------------------------------------
443
### -----------------------------------------------------------
441
echo "Install kernel(s) ..."
444
echo "Install kernel(s) ..."
442
 
445