Changeset 2681 in MondoRescue


Ignore:
Timestamp:
Sep 10, 2010, 12:04:45 AM (14 years ago)
Author:
Bruno Cornec
Message:
  • Add xhci support to mindi.
  • Rewrite Xen kernel support to use TryToFindKernelPath systematically.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/mindi

    r2680 r2681  
    6161IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide_cd_mod ide-cd_mod ide-cs ide-core ide_core ide-gd_mod ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci sata_nv cmd64x pata_amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio"
    6262PCMCIA_MODS="pcmcia_core ds yenta_socket"
    63 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage input hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x"
     63USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage input hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd xhci usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x"
    6464NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse libcrc32c netbk xenblktap"
    6565CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_base nls_cp437 nls_utf8 sg sr_mod zlib_inflate iso9660"
     
    14191419    done
    14201420    MakeMessageFile > $MINDI_TMP/iso/message.txt
    1421     cp $kernelpath $MINDI_TMP/iso/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/vmlinuz). Did you run out of disk space?"
    14221421    if [ $KERNEL_IS_XEN = "yes" ]; then
    14231422        cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?"
    14241423        cp $MBOOTC32 $MINDI_TMP/iso/mboot.c32  2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MINDI_TMP/iso/mboot.c32). Did you run out of disk space?"
    14251424    fi
    1426 
     1425    cp $kernelpath $MINDI_TMP/iso/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/vmlinuz). Did you run out of disk space?"
    14271426    cp $MINDI_TMP/initrd.img $MINDI_TMP/iso/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MINDI_TMP/iso/initrd.img. Did you run out of disk space?"
     1427
    14281428    if [ _"$MONDO_SHARE" != _"" ]; then
     1429        if [ $KERNEL_IS_XEN = "yes" ]; then
     1430            cp $xenkernelpath $MONDO_ROOT/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?"
     1431            cp $MBOOTC32 $MONDO_ROOT/mboot.c32  2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MINDI_TMP/iso/mboot.c32). Did you run out of disk space?"
     1432        fi
    14291433        cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
    14301434        cp $MINDI_TMP/initrd.img $MONDO_ROOT/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MONDO_ROOT/initrd.img. Did you run out of disk space?"
     
    14381442    if [ "$ARCH" != "ia64" ] ; then
    14391443        if [ _"$MONDO_SHARE" != _"" ]; then
    1440             if [ $KERNEL_IS_XEN = "no" ]; then
    1441                 cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
    1442             else
    1443                 cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt,mboot.c32,xen.gz} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1444            cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1445            if [ $KERNEL_IS_XEN = "yes" ]; then
     1446                cp -f $MINDI_TMP/iso/{mboot.c32,xen.gz} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy Xen core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
    14441447            fi
    14451448            cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE
     
    18701873         
    18711874    retval=0
    1872     if [ $KERNEL_IS_XEN = "no" ]; then
    1873         cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
    1874         retval=$?
    1875     else
     1875    cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
     1876    retval=$?
     1877    if [ $KERNEL_IS_XEN = "yes" ]; then
    18761878        cp -f $xenkernelpath $mountpoint/xenkernel &> /dev/null
    1877         retval=$?
    1878         cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
    18791879        let retval+=$?
    18801880    fi
     
    22252225       root="/"
    22262226    fi
    2227     for fname in `find $root -maxdepth 2 -type f | grep -E 'lin|kern' | grep -Ev '^/proc/|^/net/'` ; do
     2227    # See if we're booted from a Xen kernel
     2228    if [ -d /proc/sys/xen ]; then
     2229        # It's a Xen kernel
     2230        KERNEL_IS_XEN="yes"
     2231        LogIt "It's a Xen kernel..."
     2232    fi
     2233
     2234    for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/'` ; do
    22282235        [ ! -e "$fname" ] && continue
    22292236        [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel
     
    22672274        fi
    22682275    fi
    2269     possible_kernels=`echo "$possible_kernels" | tr -s ' ' '\n' | sort -u | tr '\n' ' '`
     2276    possible_kernels=`echo "$possible_kernels" | tr -s ' ' '\n' | grep -vi "xen" | sort -u | tr '\n' ' '`
    22702277    noof_kernels=`CountItemsIn "$possible_kernels"`
     2278    if [ $KERNEL_IS_XEN = "yes" ]; then
     2279        possible_xenkernels=`echo "$possible_kernels" | tr -s ' ' '\n' | grep -i "xen" | sort -u | tr '\n' ' '`
     2280        noof_xenkernels=`CountItemsIn "$possible_xenkernels"`
     2281        FindMboot32Binary
     2282    fi
    22712283    if [ "$noof_kernels" -eq "0" ] ; then
    22722284        LogIt "Could not find your kernel."
     
    22872299                LogIt "$i is probably your kernel. "
    22882300                output="$i"
    2289                 return
    22902301            fi
    22912302        done
    2292         if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then
    2293             output=/boot/vmlinuz
    2294             echo "Schlomo, this one's for you." >> $LOGFILE
     2303        if [ -n "$output" ]; then
     2304            if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then
     2305                output=/boot/vmlinuz
     2306                echo "Schlomo, this one's for you." >> $LOGFILE
     2307            else
     2308                LogIt "Two or more possible kernels found. You may specify any one of them and the "
     2309                LogIt "boot disks will still work, probably. If one does not work, try another."
     2310                LogIt "$possible_kernels"
     2311                echo ""
     2312            fi
     2313        fi
     2314    fi
     2315    if [ $KERNEL_IS_XEN = "yes" ]; then
     2316        if [ "$noof_xenkernels" -eq "0" ]; then
     2317            xenkernelpath=""
     2318        elif [ "$noof_xenkernels" -eq "1" ]; then
     2319            xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//`
     2320            echo "Your Xen kernel is $xenkernelpath (v$KERVERRUN)" >> $LOGFILE
    22952321        else
    2296             LogIt "Two or more possible kernels found. You may specify any one of them and the "
    2297             LogIt "boot disks will still work, probably. If one does not work, try another."
    2298             LogIt "$possible_kernels"
    2299             echo ""
    2300         fi
    2301     fi
    2302     echo "$output" | tr -s ' ' '\n' | sort -u | tr '\n' ' '
     2322            for i in $possible_xenkernels ; do
     2323                if echo $i | grep "$KERVERRUN" ; then
     2324                    LogIt "OK, I used my initiative and found that "
     2325                    LogIt "$i is probably your Xen kernel. "
     2326                    xenkernelpath="$i"
     2327                fi
     2328            done
     2329            if [ -n "$xenkernelpath" ]; then
     2330                new_possible_xenkernels=`echo "$possible_xenkernels" | tr -s ' ' '\n' | grep -E "^/boot" | sort -u | tr '\n' ' '`
     2331                if [ ! -n "$new_possible_xenkernels" ]; then
     2332                    xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1`
     2333                    LogIt "Using $xenkernelpath"
     2334                else
     2335                    LogIt "Two or more possible Xen kernels found. You may specify any one of them and the "
     2336                    LogIt "boot disks will still work, probably. If one does not work, try another."
     2337                    LogIt "$possible_xenkernels"
     2338                    echo ""
     2339                    xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1`
     2340                    LogIt "Using $xenkernelpath"
     2341                fi
     2342            fi
     2343        fi
     2344        xenkernelname=`basename $xenkernelpath`
     2345        if [[ -z "$xenkernelpath" || ! -f "$xenkernelpath" ]]; then
     2346            Die "Cannot find Xen kernel $xenkernelpath, aborting"
     2347        fi
     2348    fi
     2349    echo "$output"
    23032350}
    23042351
     
    28522899
    28532900        kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
    2854         # See if it's a Xen kernel
    2855         if [ -n "$kernelpath" ]; then
    2856             # See if we're booted from a Xen kernel
    2857             if [ -d /proc/sys/xen ]; then
    2858                 # It's a Xen kernel
    2859                 KERNEL_IS_XEN=yes
    2860                 LogIt "It's a Xen kernel..."
    2861                 # WARNING: This will only work for RHEL 5
    2862                 # Use TryToFindKernelPath ?
    2863                 xenkernelpath="/boot/`uname -r | awk '{sub("[Xx][Ee][Nn]",""); printf("xen.gz-%s",$0)}'`"
    2864                 if [[ -z "$xenkernelpath" || ! -f "$xenkernelpath" ]]; then
    2865                     Die "Cannot find Xen kernel $xenkernelpath, aborting"
    2866                 fi
    2867                 xenkernelname=`basename $xenkernelpath`
    2868                 FindMboot32Binary
    2869             fi
    2870         fi
    2871 
     2901        [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
     2902       
    28722903###
    28732904### Sq-Modification...
     
    29192950        [ "$NOT_BOOT" = "" ] && NOT_BOOT=no
    29202951        [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine."
    2921         [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
    29222952        # MONDO_ROOT is the real scratchdir
    29232953        MONDO_ROOT=`echo $MINDI_CACHE | sed 's/\(.*\)\/.*/\1/'`
Note: See TracChangeset for help on using the changeset viewer.