Changeset 2127


Ignore:
Timestamp:
Jan 14, 2009, 10:05:17 PM (11 years ago)
Author:
Bruno Cornec
Message:

When forcing a USB device through Boot CLI, mondorestore is now taking it in account as the restore deveice, instead of taking what is in the conf file.

Location:
branches/2.2.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.8/mindi/rootfs/sbin/start-usb

    r1983 r2127  
    77
    88# Get info from config file
    9 usbdev=`grep usb-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
     9MRUSBDEV=`grep usb-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
    1010
    1111# info from cmdline are predominent
    1212for i in `cat /proc/cmdline` ; do
    13     echo $i | grep -qi usb= && usbdev=`echo $i | cut -d= -f2`
     13    echo $i | grep -qi usb= && MRUSBDEV=`echo $i | cut -d= -f2`
    1414done
    1515
    16 if [ $usbdev = "" ]; then
     16if [ $MRUSBDEV = "" ]; then
    1717    # No usb configuration neither stored during archive
    1818    # nor on cmdline so no usb wanted => exiting
     
    2020fi
    2121
    22 echo -en "Mounting USB device (${usbdev}1) on /mnt/cdrom..."
     22export MRUSBDEV
     23
     24echo -en "Mounting USB device (${MRUSBDEV}1) on /mnt/cdrom..."
    2325/sbin/modprobe usb-storage
    2426for i in 1 2 3 4 5 6 7 8 9 10 ; do
     
    2628        echo -en "."
    2729done
    28 mount -t vfat ${usbdev}1 /mnt/cdrom && LogIt "USB device (${usbdev}1) mounted on /mnt/cdrom"
     30mount -t vfat ${MRUSBDEV}1 /mnt/cdrom && LogIt "USB device (${MRUSBDEV}1) mounted on /mnt/cdrom"
    2931echo "."
  • branches/2.2.8/mondo/src/mondorestore/mondo-rstr-tools.c

    r2110 r2127  
    854854        bkpinfo->media_size[1] = 650;   /* good guess */
    855855    } else if (bkpinfo->backup_media_type == usb) {
    856         if (read_cfg_var(cfg_file, "usb-dev", value)) {
    857             fatal_error("Cannot get USB device name from cfg file");
     856        envtmp1 = getenv("MRUSBDEV");
     857        if (envtmp1 == NULL) {
     858            if (read_cfg_var(cfg_file, "usb-dev", value)) {
     859                fatal_error("Cannot get USB device name from cfg file");
     860            }
     861        } else {
     862            strcpy(value,envtmp1);
    858863        }
    859864        sprintf(bkpinfo->media_device, "%s1", value);
Note: See TracChangeset for help on using the changeset viewer.