Changeset 2851


Ignore:
Timestamp:
Jul 25, 2011, 11:48:36 AM (8 years ago)
Author:
bruno
Message:
  • mindi only sets the boot flag of a USB device if none is present already (should avoid flip/flop situation)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/mindi

    r2847 r2851  
    14991499    echo "Transforming $USBDEVICE in a Bootable device"  >> $LOGFILE
    15001500    echo "Checking $USBDEVICE" >> $LOGFILE
    1501     $FDISK -l $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE
     1501    $FDISK -l $USBDEVICE 2>> $LOGFILE 1> $MINDI_TMP/fdisk.log
     1502    cat $MINDI_TMP/fdisk.log >> $LOGFILE
    15021503    if [ $? -ne 0 ]; then
    15031504        echo "Unable to access $USBDEVICE" | tee -a $LOGFILE
     
    15111512    # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE
    15121513    echo "Preparing $USBDEVICE" >> $LOGFILE
    1513     $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE << EOF
     1514    cat > $MINDI_TMP/fdisk.txt << EOF
    15141515d
    15151516d
     
    15231524t
    15241525b
     1526w
     1527EOF
     1528    # Search for bootable flag
     1529    grep '* ' $MINDI_TMP/fdisk.log | grep $USBDEVICE
     1530    if [ $? -ne 0 ]; then
     1531        cat >> $MINDI_TMP/fdisk.txt << EOF
    15251532a
    152615331
    15271534w
    15281535EOF
     1536    fi
     1537    $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt
    15291538    if [ $? -ne 0 ]; then
    15301539        echo "Unable to create a vfat Filesystem on $USBDEVICE" | tee -a $LOGFILE
     
    15331542        MindiExit -1
    15341543    fi
     1544    echo "fdisk build file" >> $LOGFILE
     1545    echo "----------------" >> $LOGFILE
     1546    cat $MINDI_TMP/fdisk.txt >> $LOGFILE
     1547    echo "----------------" >> $LOGFILE
     1548    rm -f $MINDI_TMP/fdisk.log $MINDI_TMP/fdisk.txt
    15351549    echo "The USB device $USBDEVICE now looks like this:" >> $LOGFILE
    15361550    $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
Note: See TracChangeset for help on using the changeset viewer.