Changeset 2696 in MondoRescue for branches/2.2.10/mindi/mindi


Ignore:
Timestamp:
Jan 25, 2011, 10:34:40 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Adds preliminary support for hpacucli. Needs test
  • Fix a compilation issue due to bad fatal_error call (no param allowed)
  • Fix some HTML syntax issues in the docs page + link to Wiki articles
  • Boot size pushed to 20MB
  • A bit more precise for error msg from PBDI
  • Exits if the protocol used is not recognized (error with -n fs:// typo)
  • Adds support for r8169 net driver
  • Fix a cast issue
  • Precise a test case to avoid ambiguity
  • Die and related functions placed before any other code as used early, and ash doesn't support function declaration. So will solve #446 by exiting mindi before doing anything weird in it.
  • Fix #445 with another technical solution to avoid vg with similar names to b wrongly excluded (vgroot and vgroot-san e.g.) (Michael Shapiro)
  • Fix a bug on exclusion of path with common content (/home and /path/home e.g.) which was handled correctly only in a certain order (John Pearson <johnp_at_gtagalenco.com.au>)
  • mount-media function is now placed in libmondo-devices.c as used by more programs.
  • Avoids calling mount_media when it's not mandatory (change the way mondorestore was working up to now but could solve some bugs reported)
  • Add xhci support to mindi.
  • Rewrite Xen kernel support to use TryToFindKernelPath systematically.
  • mindi now copies also the /lib/firmware content in order to have it for drivers needing it (bnx2 reported)
  • Push MAX_STR_LEN to 512 to allow supporting more exclude dir (2.2.10 and dyn allocation is the way to go there)
  • Add virtio driver to mindi
  • Initialize extra_cdrom_params in any case tp avoid passing null to cdrecord later on
  • Also escapes white spaces in gen_aux_list to avoid issues in getfacl call
  • Adds multiple missing drivers to mindi (mega_sr, ide_gd_mod, pata_jmicron, cp210x, dca, raid6_pq, xor async_tx, async_memcpy, async_xor)
  • Fix #434 by really testing thet udevd is not running already (chucky)
  • Adds support of pata_sil680 driver
  • Fix again #412 !! by removing calls to tee which voids the return value of the previous command
  • The way grub.unsupported was called for opensuse 11.2 was wrong. It should be done bfore calling grub-install which also exists. And tested for existence. Now this should fix #412.
  • Try to provide a workaround in code to the #401 (over-allocation of space due to rounding errors)
  • Fix a bug when using ACLs and file with spaces in their names by adding double quotes in getfacl invocation (Tom Mortell tomm_at_dslextreme.com). Also adding the same quotes on the touch commands made earlier.
  • Points to the current latest presentation instead of the old one
  • mondo-ref-card added to the docs web page
  • Add the mondoarchive reference card (Lester Wade)
  • Change useless comments for more useful ones
  • mindi is now able to handle compressed kernel with .gz or .bz2 suffix (case of OpenSuSE 11.2)
  • Improves logging for external binary
  • Improve Xen kernel detection and avoid false detection (Michael Shapiro)
  • Updated P2V doc from Lester Wade (lester.wade_at_hp.com)

Baclports from 2.2.9
svn merge -r 2650:2695 svn+ssh://bruno@svn.mondorescue.org/mondo/svn/mondorescue/branches/2.2.9 .

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/mindi

    r2651 r2696  
    5757MY_FSTAB=/etc/fstab
    5858TAPE_MODS="ht st osst ide-tape ide_tape"
    59 SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi iscsi_tcp libiscsi scsi_transport_iscsi libiscsi_tcp isp megaraid megaraid_mm megaraid_mbox megaraid_sas mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcp dc395x diskdumplib scsi_dump_register"
     59SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi iscsi_tcp libiscsi scsi_transport_iscsi libiscsi_tcp isp megaraid megaraid_mm megaraid_mbox megaraid_sas mega_sr mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcp dc395x diskdumplib scsi_dump_register"
    6060
    6161# ide-probe-mod
    62 IDE_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 edd paride ata_generic ata_piix libata dock via82cxxx generic nvidia ahci sata_nv cmd64x pata_amd pata_marvell pata_serverworks pata_sis amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk"
     62IDE_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"
    6363PCMCIA_MODS="pcmcia_core ds yenta_socket"
    64 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"
    65 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x e1000 e1000e igb eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse libcrc32c crc32c netbk xenblktap"
     64USB_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"
     65NET_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 crc32c netbk xenblktap r8169"
    6666CDROM_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"
    6767# Those modules will only go on the backup media, not the boot media.
    68 EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac multipath jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs"
     68EXTRA_MODS="$CDROM_MODS vfat fat loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq xor async_tx async_memcpy async_xor lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac multipath jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs"
    6969# Replace with that line for HP OCMP e.g.
    7070#DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain"
     
    110110fi
    111111
     112# Last function called before exiting
     113# Parameter is exit code value
     114# Should be declared here as used immediately below potentialy
     115MindiExit() {
     116    LogFile "Mindi $MINDI_VERSION is exiting"
     117    LogFile "End date : `date`"
     118    if [ _"$MONDO_SHARE" != _"" ] ; then
     119        echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log
     120        cat $LOGFILE >> /var/log/mondoarchive.log
     121        echo "--------------------------------------------------------------">> /var/log/mondoarchive.log
     122    fi
     123
     124    cd /
     125    sync&
     126
     127    # Clean temporary files only when standalone mindi
     128    if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then
     129        rm -Rf $MINDI_TMP
     130    fi
     131    exit $1
     132}
     133
     134LogIt() {
     135    if [ -e /dev/stderr ] ; then
     136        echo -e "$1" >> /dev/stderr
     137    elif [ -e /usr/bin/logger ] ; then
     138        /usr/bin/logger -s $1
     139    fi
     140    echo -e "$1" >> $LOGFILE
     141    if [ _"$2" != _"" ]; then
     142        grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
     143    fi
     144    rm -f "$2"
     145}
     146
     147
     148Die() {
     149    local i
     150    if [ "$1" = "" ] ; then
     151        LogAll "FATAL ERROR"
     152    else
     153        LogAll "FATAL ERROR. $1"
     154    fi
     155    if [ _"$2" != _"" ]; then
     156        grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
     157    fi
     158    rm -f "$2"
     159
     160    LogAll "Please e-mail a copy of $LOGFILE to the mailing list."
     161    LogAll "See http://www.mondorescue.org for more information."
     162    LogAll "WE CANNOT HELP unless you enclose that file.\n"
     163    MindiExit -1
     164}
     165
    112166# Now we can create what we need
    113167MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX`
     
    236290}
    237291
    238 
    239 # Last function called before exiting
    240 # Parameter is exit code value
    241 MindiExit() {
    242     LogFile "Mindi $MINDI_VERSION is exiting"
    243     LogFile "End date : `date`"
    244     if [ _"$MONDO_SHARE" != _"" ] ; then
    245         echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log
    246         cat $LOGFILE >> /var/log/mondoarchive.log
    247         echo "--------------------------------------------------------------">> /var/log/mondoarchive.log
    248     fi
    249 
    250     cd /
    251     sync&
    252 
    253     # Clean temporary files only when standalone mindi
    254     if [ _"$MINDI_TMP" != _"$MONDO_TMP" ]; then
    255         rm -Rf $MINDI_TMP
    256     fi
    257     exit $1
    258 }
    259 
    260 Die() {
    261     local i
    262     if [ "$1" = "" ] ; then
    263         LogAll "FATAL ERROR"
    264     else
    265         LogAll "FATAL ERROR. $1"
    266     fi
    267     if [ _"$2" != _"" ]; then
    268         grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
    269     fi
    270     rm -f "$2"
    271 
    272     LogAll "Please e-mail a copy of $LOGFILE to the mailing list."
    273     LogAll "See http://www.mondorescue.org for more information."
    274     LogAll "WE CANNOT HELP unless you enclose that file.\n"
    275     MindiExit -1
    276 }
    277292
    278293
     
    890905}
    891906
    892 
    893907# Called by TurnTgzIntoRdz, to make mondorestore.cfg
    894908MakeMondoConfigFile() {
     
    13701384    done
    13711385    MakeMessageFile > $MINDI_TMP/iso/message.txt
    1372     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?"
    13731386    if [ $KERNEL_IS_XEN = "yes" ]; then
    13741387        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?"
    13751388        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?"
    13761389    fi
    1377 
     1390    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?"
    13781391    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?"
     1392
    13791393    if [ _"$MONDO_SHARE" != _"" ]; then
     1394        if [ $KERNEL_IS_XEN = "yes" ]; then
     1395            cp $xenkernelpath $MONDO_CACHE/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?"
     1396            cp $MBOOTC32 $MONDO_CACHE/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?"
     1397        fi
    13801398        cp $kernelpath $MONDO_CACHE/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_CACHE/vmlinuz). Did you run out of disk space?"
    13811399        cp $MINDI_TMP/initrd.img $MONDO_CACHE/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MONDO_CACHE/initrd.img. Did you run out of disk space?"
     
    13951413    if [ "$ARCH" != "ia64" ] ; then
    13961414        if [ _"$MONDO_SHARE" != _"" ]; then
    1397             if [ $KERNEL_IS_XEN = "no" ]; then
    1398                 cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_CACHE 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_CACHE). Did you run out of disk space?"
    1399             else
    1400                 cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt,mboot.c32,xen.gz} $MONDO_CACHE 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_CACHE). Did you run out of disk space?"
     1415            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?"
     1416            if [ $KERNEL_IS_XEN = "yes" ]; then
     1417                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?"
    14011418            fi
    14021419            cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE
     
    16851702    retval=0
    16861703
    1687     [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel"
     1704    [ ! -e "$kernelpath" ] && Die "PBDI lilo - cannot find $kernelpath kernel"
    16881705    echo -en "Making "$BOOT_SIZE"KB boot disk..."
    16891706    TurnTgzIntoRdz $MINDI_DATA/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?"
     
    17491766         
    17501767    retval=0
    1751     if [ $KERNEL_IS_XEN = "no" ]; then
    1752         cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
    1753         retval=$?
    1754     else
     1768    cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
     1769    retval=$?
     1770    if [ $KERNEL_IS_XEN = "yes" ]; then
    17551771        cp -f $xenkernelpath $mountpoint/xenkernel &> /dev/null
    1756         retval=$?
    1757         cp -f $kernelpath $mountpoint/vmlinuz &> /dev/null
    17581772        let retval+=$?
    17591773    fi
     
    17631777        du -sk $mountpoint/* >> $LOGFILE
    17641778        LogFile "--- end of list of files ---"
    1765         echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n\
    1766 Sorry, your kernel is too big for your image.\n" >> $LOGFILE
     1779        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE
    17671780        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    17681781        cd $old_pwd
     
    20562069       root="/"
    20572070    fi
    2058     for fname in `find $root -maxdepth 2 -type f | grep -E 'lin|kern' | grep -Ev '^/proc/|^/net/'` ; do
     2071    # See if we're booted from a Xen kernel
     2072    if [ -d /proc/sys/xen ]; then
     2073        # It's a Xen kernel
     2074        KERNEL_IS_XEN="yes"
     2075        LogIt "It's a Xen kernel..."
     2076    fi
     2077
     2078    for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/'` ; do
    20592079        [ ! -e "$fname" ] && continue
    20602080        [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel
     
    20982118        fi
    20992119    fi
    2100     possible_kernels=`echo "$possible_kernels" | tr -s ' ' '\n' | sort -u | tr '\n' ' '`
     2120    possible_kernels=`echo "$possible_kernels" | tr -s ' ' '\n' | grep -vi "xen" | sort -u | tr '\n' ' '`
    21012121    noof_kernels=`CountItemsIn "$possible_kernels"`
     2122    if [ $KERNEL_IS_XEN = "yes" ]; then
     2123        possible_xenkernels=`echo "$possible_kernels" | tr -s ' ' '\n' | grep -i "xen" | sort -u | tr '\n' ' '`
     2124        noof_xenkernels=`CountItemsIn "$possible_xenkernels"`
     2125        FindMboot32Binary
     2126    fi
    21022127    if [ "$noof_kernels" -eq "0" ] ; then
    21032128        LogAll "Could not find your kernel."
     
    21182143                LogAll "$i is probably your kernel. "
    21192144                output="$i"
    2120                 return
    21212145            fi
    21222146        done
    2123         if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then
    2124             output=/boot/vmlinuz
    2125             LogFile "Schlomo, this one's for you."
     2147        if [ -n "$output" ]; then
     2148            if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then
     2149                output=/boot/vmlinuz
     2150                echo "Schlomo, this one's for you." >> $LOGFILE
     2151            else
     2152                LogIt "Two or more possible kernels found. You may specify any one of them and the "
     2153                LogIt "boot disks will still work, probably. If one does not work, try another."
     2154                LogIt "$possible_kernels"
     2155                echo ""
     2156            fi
     2157        fi
     2158    fi
     2159    if [ $KERNEL_IS_XEN = "yes" ]; then
     2160        if [ "$noof_xenkernels" -eq "0" ]; then
     2161            xenkernelpath=""
     2162        elif [ "$noof_xenkernels" -eq "1" ]; then
     2163            xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//`
     2164            echo "Your Xen kernel is $xenkernelpath (v$KERVERRUN)" >> $LOGFILE
    21262165        else
    2127             LogAll "Two or more possible kernels found. You may specify any one of them and the "
    2128             LogAll "boot disks will still work, probably. If one does not work, try another."
    2129             LogAll "$possible_kernels"
    2130             echo ""
    2131         fi
    2132     fi
    2133     echo "$output" | tr -s ' ' '\n' | sort -u | tr '\n' ' '
     2166            for i in $possible_xenkernels ; do
     2167                if echo $i | grep "$KERVERRUN" ; then
     2168                    LogIt "OK, I used my initiative and found that "
     2169                    LogIt "$i is probably your Xen kernel. "
     2170                    xenkernelpath="$i"
     2171                fi
     2172            done
     2173            if [ -n "$xenkernelpath" ]; then
     2174                new_possible_xenkernels=`echo "$possible_xenkernels" | tr -s ' ' '\n' | grep -E "^/boot" | sort -u | tr '\n' ' '`
     2175                if [ ! -n "$new_possible_xenkernels" ]; then
     2176                    xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1`
     2177                    LogIt "Using $xenkernelpath"
     2178                else
     2179                    LogIt "Two or more possible Xen kernels found. You may specify any one of them and the "
     2180                    LogIt "boot disks will still work, probably. If one does not work, try another."
     2181                    LogIt "$possible_xenkernels"
     2182                    echo ""
     2183                    xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1`
     2184                    LogIt "Using $xenkernelpath"
     2185                fi
     2186            fi
     2187        fi
     2188        xenkernelname=`basename $xenkernelpath`
     2189        if [[ -z "$xenkernelpath" || ! -f "$xenkernelpath" ]]; then
     2190            Die "Cannot find Xen kernel $xenkernelpath, aborting"
     2191        fi
     2192    fi
     2193    echo "$output"
    21342194}
    21352195
     
    22772337    cat $MINDI_CACHE/mountlist.txt >> $LOGFILE
    22782338    LogFile "-----------------------------------"
     2339
     2340    # Copy FW in case some drivers needs it
     2341    if [ -d "/lib/firmware" ]; then
     2342        cp -rp /lib/firmware $mountpoint/lib
     2343    fi
    22792344
    22802345    cd $old_pwd
     
    26632728
    26642729        kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath=""
    2665         # See if it's a Xen kernel
    2666         if [ -n "$kernelpath" ]; then
    2667             strings $kernelpath | grep -iq xen 2>/dev/null
    2668             if [ $? -eq 0 ]; then
    2669                 # It's a Xen kernel
    2670                 KERNEL_IS_XEN=yes
    2671                 LogFile "It's a Xen kernel..."
    2672                 # WARNING: This will only work for RHEL 5
    2673                 # TODO: SLES and others
    2674                 # Use TryToFindKernelPath ?
    2675                 xenkernelpath="/boot/`uname -r | awk '{sub("[Xx][Ee][Nn]",""); printf("xen.gz-%s",$0)}'`"
    2676                 if [[ -z "$xenkernelpath" || ! -f "$xenkernelpath" ]]; then
    2677                     Die "Cannot find Xen kernel $xenkernelpath, aborting"
    2678                 fi
    2679                 xenkernelname=`basename $xenkernelpath`
    2680                 FindMboot32Binary
    2681             fi
    2682         fi
    2683 
     2730        [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
     2731       
    26842732###
    26852733### Sq-Modification...
     
    26912739            LogAll "xenkernelname = $xenkernelname"
    26922740        fi
    2693         kernelname=`echo $kernelpath | cut -d'-' -f2-`
    2694         LogAll "kernelname = $kernelname"
    2695         LogAll "kernelpath = $kernelpath"
     2741        kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'`
    26962742        if [ ! -d "/lib/modules/$kernelname" ]
    26972743        then
     
    27022748           LogAll "Using modules for kernel: ${kernelname}"
    27032749        fi
     2750        LogAll "kernelname = $kernelname"
     2751        LogAll "kernelpath = $kernelpath"
    27042752###
    27052753### end of Sq-Modification
     
    27332781        [ "$USE_LZMA" = "" ] && USE_LZMA=no
    27342782        [ "$TAPEDEV" ] && LogAll "This is a tape-based backup. Fine."
    2735         [ "$kernelpath" = "" ] && kernelpath=`TryToFindKernelPath`
    2736         kernelname=`echo $kernelpath | cut -d'-' -f2-`
    2737         if [ ! -d "/lib/modules/$kernelname" ]
    2738         then
    2739            LogAll "Module path for ${kernelpath} not found..."
    2740            LogAll "using running kernel\'s modules."
    2741            kernelname=$KERVERRUN
    2742         else
    2743            LogAll "Using modules for kernel: ${kernelname}"
    2744         fi
    27452783
    27462784        MONDO_CACHE=/var/cache/mondo
Note: See TracChangeset for help on using the changeset viewer.