Changeset 2696 in MondoRescue


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 .

Location:
branches/2.2.10
Files:
23 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/README.bkphw

    r2091 r2696  
    2323cp -a utilities/conrep /usr/local/bin
    2424cp -a utilities/conrep.xml /usr/local/bin
     25# For versions <= 1.90
    2526cp -a utilities/cpqacuxe/cpqacuxe /usr/local/bin
    2627cp -a utilities/cpqacuxe/bld /usr/local/bin
    2728mv /usr/local/bin/bld/*.so /usr/local/lib
     29# For recent versions
     30cp -a utilities/hpacucli /usr/local/bin
    2831echo /usr/local/lib >> /etc/ld.so.conf
    2932ldconfig
  • branches/2.2.10/mindi/analyze-my-lvm

    r2635 r2696  
    6969    # Do not process LV whose VG are excluded
    7070    if [ -f $MINDI_TMP/excludedvgs ]; then
    71         if [ "`grep $volume_group $MINDI_TMP/excludedvgs`" != "" ]; then
     71        if [ "`grep -x $volume_group $MINDI_TMP/excludedvgs`" != "" ]; then
    7272            echo "Not including LV $logical_volume as VG $volume_group was excluded"
    7373            return
  • branches/2.2.10/mindi/deplist.d/proliant.conf

    r2409 r2696  
    88/usr/local/bin/cpqacuxe
    99/usr/local/bin/hponcfg
     10/usr/local/bin/hpacucli
  • 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
  • branches/2.2.10/mindi/mindi-bkphw

    r2462 r2696  
    7373            print TOOLS "$tooldir/bld\n";
    7474        }
     75        if ($tool =~ /\/.hpacucli$/) {
     76            my $dir=basename($tool);
     77            $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/hpacucli.dat");
     78            print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $locbkpdir/hpacucli.dat\n";
     79            print TOOLS "$tooldir/bld\n";
     80        }
    7581        if ($tool =~ /\/hponcfg$/) {
    7682            $ret = system("$tool -w $bkpdir/hponcfg.dat");
  • branches/2.2.10/mindi/proliant.files

    r1832 r2696  
    11/usr/local/bin/hponcfg
    22/usr/local/bin/conrep
     3/usr/local/bin/hpacucli
    34/opt/compaq/cpqacuxe/bld/.acuxebin
    45/usr/local/bin/bld/.acuxebin
  • branches/2.2.10/mindi/rootfs/sbin/init

    r2623 r2696  
    284284    fi
    285285    # Depending on udevd version it gives back the hand or not :-(
    286     ps | grep udevd 2> /dev/null 1> /dev/null
     286    ps | grep -v grep |grep udevd 2> /dev/null 1> /dev/null
    287287    if [ $? -ne 0 ]; then
    288288        /sbin/udevd --daemon &
  • branches/2.2.10/mondo/README

    r2635 r2696  
    6565
    6666This license was given to MondoRescue by the original author Hugo Rabson, and is
    67 continue its current maintainer Bruno Cornec.
     67continued by its current maintainer Bruno Cornec.
    6868
  • branches/2.2.10/mondo/src/common/libmondo-cli.c

    r2508 r2696  
    497497            if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    498498                mr_asprintf(tmp1, "sshfs %s", bkpinfo->netfs_mount);
     499            } else if (strstr(bkpinfo->netfs_proto, "nfs")) {
     500                mr_asprintf(tmp1, "mount %s", bkpinfo->netfs_mount);
    499501            } else {
    500                 mr_asprintf(tmp1, "mount %s", bkpinfo->netfs_mount);
     502                log_to_screen("Protocol %s not supported yet for network backups.\n", bkpinfo->netfs_proto);
     503                fatal_error("Bad Protocol\n");
    501504            }
    502505            i = system(tmp1);
  • branches/2.2.10/mondo/src/common/libmondo-devices.c

    r2643 r2696  
    12711271
    12721272
     1273/**
     1274* Mount the CD-ROM or USB device at /mnt/cdrom.
     1275* @param bkpinfo The backup information structure. Fields used:
     1276* - @c bkpinfo->backup_media_type
     1277* - @c bkpinfo->disaster_recovery
     1278* - @c bkpinfo->isodir
     1279* - @c bkpinfo->media_device
     1280* @return 0 for success, nonzero for failure.
     1281*/
     1282int mount_media()
     1283{
     1284char *mount_cmd = NULL;
     1285int i, res;
     1286#ifdef __FreeBSD__
     1287    char mdd[32];
     1288    char *mddev = mdd;
     1289#endif
     1290
     1291    if (bkpinfo->backup_media_type == tape || bkpinfo->backup_media_type == udev) {
     1292        log_msg(8, "Tape/udev. Therefore, no need to mount a media.");
     1293        return 0;
     1294    }
     1295
     1296    if (!run_program_and_log_output("mount | grep -F " MNT_CDROM, FALSE)) {
     1297        log_msg(2, "mount_media() - media already mounted. Fair enough.");
     1298        return (0);
     1299    }
     1300
     1301    if (bkpinfo->media_device == NULL) {
     1302        fatal_error("No media device at that point");
     1303    }
     1304
     1305    if (bkpinfo->backup_media_type == netfs) {
     1306        log_msg(2, "Mounting for Network thingy");
     1307        log_msg(2, "isodir = %s", bkpinfo->isodir);
     1308        if (!strcmp(bkpinfo->isodir, "/") && am_I_in_disaster_recovery_mode()) {
     1309            mr_free(bkpinfo->isodir);
     1310            mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
     1311            log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
     1312        }
     1313        if ((bkpinfo->isodir == NULL) || (bkpinfo->netfs_remote_dir == NULL) || (bkpinfo->prefix == NULL)) {
     1314            fatal_error("Unable to prepare the iso filename");
     1315        }
     1316#ifdef __FreeBSD__
     1317        mr_asprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir,
     1318            bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
     1319        mddev = make_vn(mount_cmd);
     1320        mr_free(mount_cmd);
     1321
     1322        mr_asprintf(mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev);
     1323#else
     1324        mr_asprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1325#endif
     1326
     1327    } else if (bkpinfo->backup_media_type == iso) {
     1328#ifdef __FreeBSD__
     1329        mr_sprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir,
     1330            bkpinfo->prefix, g_current_media_number);
     1331        mddev = make_vn(mount_cmd);
     1332        mr_free(mount_cmd);
     1333
     1334        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
     1335#else
     1336        mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
     1337#endif
     1338    } else if (bkpinfo->backup_media_type == usb) {
     1339        mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, MNT_CDROM);
     1340    } else if (strstr(bkpinfo->media_device, "/dev/")) {
     1341#ifdef __FreeBSD__
     1342        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
     1343#else
     1344        mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
     1345#endif
     1346    } else {
     1347        mr_free(bkpinfo->media_device);
     1348        if (bkpinfo->disaster_recovery && does_file_exist("/tmp/CDROM-LIVES-HERE")) {
     1349            bkpinfo->media_device = last_line_of_file(MINDI_CACHE"/CDROM-LIVES-HERE");
     1350        } else {
     1351            bkpinfo->media_device = find_cdrom_device(TRUE);
     1352        }
     1353
     1354#ifdef __FreeBSD__
     1355        mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
     1356#else
     1357        mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
     1358#endif
     1359    }
     1360
     1361    log_msg(2, "(mount_media) --- command = %s", mount_cmd);
     1362    for (i = 0; i < 2; i++) {
     1363        res = run_program_and_log_output(mount_cmd, FALSE);
     1364        if (!res) {
     1365            break;
     1366        } else {
     1367            log_msg(2, "Failed to mount device.");
     1368            sleep(5);
     1369            sync();
     1370        }
     1371    }
     1372    mr_free(mount_cmd);
     1373
     1374    if (res) {
     1375        log_msg(2, "Failed, despite %d attempts", i);
     1376    } else {
     1377        log_msg(2, "Mounted media drive OK");
     1378    }
     1379    return (res);
     1380}
     1381/**************************************************************************
     1382*END_MOUNT_CDROM                                                         *
     1383**************************************************************************/
    12731384
    12741385
     
    13161427        // BERLIOS --- I'm tempted to do something about this...
    13171428        // Why unmount and remount again and again?
    1318         log_msg(3, "Remounting CD");
    13191429        g_ISO_restore_mode = TRUE;
    1320         if (is_this_device_mounted(MNT_CDROM)) {
    1321             run_program_and_log_output("umount " MNT_CDROM, 5);
    1322         }
    1323         mr_asprintf(tmp, "mkdir -p %s/isodir &> /dev/null", bkpinfo->tmpdir);
    1324         (void)system(tmp);
    1325         mr_free(tmp);
    1326 
    1327         if (((bkpinfo->isodir == NULL) && (bkpinfo->netfs_remote_dir == NULL)) || (bkpinfo->prefix == NULL)) {
    1328             fatal_error("Unable to prepare ISO file name. Please report to dev team");
    1329         }
    1330         if (bkpinfo->netfs_remote_dir) {
    1331             // NETFS
    1332             mr_asprintf(tmp, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, cd_number_i_want);
    1333         } else {
    1334             // ISO
    1335             mr_asprintf(tmp, "%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->prefix, cd_number_i_want);
    1336         }
    1337         if (!does_file_exist(tmp)) {
    1338             mr_free(tmp);
    1339             if (bkpinfo->netfs_remote_dir) {
    1340                 // NETFS
    1341                 mr_asprintf(tmp, "%s/isodir/%s/%s-%d.iso", bkpinfo->tmpdir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, cd_number_i_want);
    1342             } else {
    1343                 // ISO
    1344                 mr_asprintf(tmp, "%s/isodir/%s-%d.iso", bkpinfo->tmpdir, bkpinfo->prefix, cd_number_i_want);
    1345             }
    1346             if (does_file_exist(tmp)) {
    1347                 log_msg(1, "FIXME - hacking bkpinfo->isodir from '%s' to %s/isodir", bkpinfo->isodir, bkpinfo->tmpdir);
    1348                 mr_free(bkpinfo->isodir);
    1349                 mr_asprintf(bkpinfo->isodir, "%s/isodir", bkpinfo->tmpdir);
    1350             }
    1351         }
    1352         log_msg(3, "Mounting %s at %s", tmp, MNT_CDROM);
    1353         if (mount_CDROM_here(tmp, MNT_CDROM)) {
    1354             mr_free(tmp);
    1355             fatal_error("Mommy!");
    1356         }
    1357         mr_free(tmp);
     1430        if (!is_this_device_mounted(MNT_CDROM)) {
     1431            log_msg(3, "Mounting media");
     1432            g_current_media_number = cd_number_i_want;
     1433            mount_media();
     1434        }
    13581435    }
    13591436    if ((res = what_number_cd_is_this()) != cd_number_i_want) {
     
    19472024    case -1:
    19482025        /* we need to add a space after token to be sure our strstr test works correctly */
    1949         mr_asprintf(tmp1,"%s ",token);
     2026        mr_asprintf(tmp1," %s ",token);
    19502027        if (mode == 'E') {
    19512028            /*  Add the token if not already in the list */
    1952             mr_asprintf(tmp,"%s ",bkpinfo->exclude_paths);
     2029            mr_asprintf(tmp," %s ",bkpinfo->exclude_paths);
    19532030            if (strstr(tmp,tmp1) == NULL) {
    1954                 mr_strcat(bkpinfo->exclude_paths, " %s", tmp1);
     2031                mr_strcat(bkpinfo->exclude_paths, "%s", tmp1);
    19552032            }
    19562033        } else {
    19572034            /*  Add the token if not already in the list */
    1958             mr_asprintf(tmp,"%s ",bkpinfo->include_paths);
     2035            mr_asprintf(tmp," %s ",bkpinfo->include_paths);
    19592036            if (strstr(tmp,tmp1) == NULL) {
    1960                 mr_strcat(bkpinfo->include_paths, " %s", tmp1);
     2037                mr_strcat(bkpinfo->include_paths, "%s", tmp1);
    19612038            }
    19622039        }
  • branches/2.2.10/mondo/src/common/libmondo-filelist.c

    r2651 r2696  
    452452        }
    453453        log_msg(8, "Analyzing %s", file_to_analyze);
    454         tmp = mr_stresc(file_to_analyze, "`$\\\"(){}[]'*?&|!#~", '\\');
     454        tmp = mr_stresc(file_to_analyze, " `$\\\"(){}[]'*?&|!#~", '\\');
    455455        mr_asprintf(strtmp, syscall_sprintf, tmp);
    456456        mr_free(tmp);
     
    477477
    478478    if (g_getfacl != NULL) {
    479         mr_asprintf(command, "touch %s", facl_fname);
     479        mr_asprintf(command, "touch \"%s\"", facl_fname);
    480480        run_program_and_log_output(command, 8);
    481481        mr_free(command);
    482482
    483483        retval =
    484             gen_aux_list(filelist, "getfacl --all-effective -P %s", facl_fname);
     484            gen_aux_list(filelist, "getfacl --all-effective -P \"%s\"", facl_fname);
    485485    }
    486486    return (retval);
     
    494494
    495495    if (g_getfattr != NULL) {
    496         mr_asprintf(command, "touch %s", fattr_fname);
     496        mr_asprintf(command, "touch \"%s\"", fattr_fname);
    497497        run_program_and_log_output(command, 8);
    498498        mr_free(command);
  • branches/2.2.10/mondo/src/common/libmondo-fork.c

    r2607 r2696  
    369369
    370370    if (!does_file_exist(lockfile)) {
    371         log_to_screen("Waiting for external binary to start");
     371        log_to_screen("Waiting for '%s' to start",command);
    372372        for (i = 0; i < 60 && !does_file_exist(lockfile); sleep(1), i++) {
    373373            log_msg(3, "Waiting for lockfile %s to exist", lockfile);
  • branches/2.2.10/mondo/src/common/libmondo-mountlist.c

    r2517 r2696  
    331331        /* OK, continue with main loop */
    332332        amount_allocated += mountlist->el[pos].size / 1024L;
     333
     334        /* This should only happen at the end but not tested now */
     335        if (amount_allocated > physical_drive_size) {
     336            // Used to be +1, but what if you're 1 MB too high?
     337            mr_asprintf(tmp, " %ld MB over-allocated on %s.",amount_allocated - physical_drive_size, drive);
     338            log_it(tmp);
     339
     340            /* Do we have more than 1 MB per partition ? */
     341            if (amount_allocated - physical_drive_size <= curr_part_no) {
     342                /* Probably a rouding error, just passing over
     343                 * by reducing the last partition if possible */
     344                amount_allocated -= mountlist->el[pos].size / 1024L;
     345                mountlist->el[pos].size =  (mountlist->el[pos].size - curr_part_no*1024L);
     346                amount_allocated += mountlist->el[pos].size / 1024L;
     347            } else {
     348                mr_strcat(flaws_str, "%s", tmp);
     349                res++;
     350            }
     351            mr_free(tmp);
     352        }
    333353        prev_part_no = curr_part_no;
    334354    }
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2635 r2696  
    376376    }
    377377
    378     log_msg(1, "Foo");
     378    log_msg(1, "Post-param");
    379379    if (bkpinfo->backup_media_type == tape) {
    380         log_msg(1, "Bar");
     380        log_msg(1, "Tape");
    381381        if (bkpinfo->media_device == NULL) {
    382382            return(1);
     
    498498            mr_asprintf(extra_cdrom_params, "blank=fast ");
    499499        }
    500         tmp = find_home_of_exe("cdrecord");
    501         if (tmp) {
    502             mr_asprintf(cdr_exe, "cdrecord");
     500        if (extra_cdrom_params == NULL) {
     501            // If not initialized earlier, do it now
     502            mr_asprintf(extra_cdrom_params, " ");
     503        }
     504        if (find_home_of_exe("cdrecord")) {
     505            strcpy(cdr_exe, "cdrecord");
     506        } else if (find_home_of_exe("dvdrecord")) {
     507            strcpy(cdr_exe, "dvdrecord");
    503508        } else {
    504509            mr_free(tmp);
     
    11811186
    11821187    if (!strcmp(tmp,"")) {
    1183         if ((strstr(tmp, "LABEL=") || strstr(tmp,"UUID="))) {
     1188        if ((strstr(tmp, "LABEL=") != NULL) || (strstr(tmp,"UUID=")!= NULL)) {
    11841189            if (!run_program_and_log_output("mount /boot", 5)) {
    11851190                strcpy(g_boot_mountpt, "/boot");
  • branches/2.2.10/mondo/src/include/my-stuff.h

    r2635 r2696  
    119119#define MAX_TAPECATALOG_ENTRIES 16384   ///< The maximum number of entries in the tape catalog.
    120120#define MAX_MOUNTLIST_ENTRIES 8192  ///< The maximum number of entries in the mountlist.
    121 #define MAX_STR_LEN 384         ///< The maximum length of almost all @p char buffers in Mondo.
     121#define MAX_STR_LEN 512         ///< The maximum length of almost all @p char buffers in Mondo.
    122122                                        ///  Note: Make this divisible by eight to avoid aligment issues
    123123                                        ///        on 64bit platforms like ia64.
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools-EXT.h

    r2623 r2696  
    77extern int iso_fiddly_bits(bool nuke_me_please);
    88extern void kill_petris(void);
    9 extern int mount_media();
    109extern int mount_all_devices(struct mountlist_itself *, bool);
    1110extern void protect_against_braindead_sysadmins(void);
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2644 r2696  
    4343extern void kill_anything_like_this(char *str);
    4444extern int skip_obdr(void);
     45extern int mount_media();
    4546extern int set_tape_block_size_with_mt(long internal_tape_block_size);
    4647
     
    460461/**************************************************************************
    461462*END_MOUNT_ALL_DEVICES                                                   *
    462 **************************************************************************/
    463 
    464 
    465 /**
    466 * Mount the CD-ROM or USB device at /mnt/cdrom.
    467 * @param bkpinfo The backup information structure. Fields used:
    468 * - @c bkpinfo->backup_media_type
    469 * - @c bkpinfo->disaster_recovery
    470 * - @c bkpinfo->isodir
    471 * - @c bkpinfo->media_device
    472 * @return 0 for success, nonzero for failure.
    473 */
    474 int mount_media() {
    475 
    476     char *mount_cmd = NULL;
    477     int i, res;
    478 #ifdef __FreeBSD__
    479     char mdd[32];
    480     char *mddev = mdd;
    481 #endif
    482 
    483     if (bkpinfo->backup_media_type == tape || bkpinfo->backup_media_type == udev) {
    484         log_msg(8, "Tape/udev. Therefore, no need to mount a media.");
    485         return 0;
    486     }
    487 
    488     if (!run_program_and_log_output("mount | grep -F "MNT_CDROM, FALSE)) {
    489         log_msg(2, "mount_media() - media already mounted. Fair enough.");
    490         return (0);
    491     }
    492 
    493     if (bkpinfo->media_device == NULL) {
    494         fatal_error("No media device at that point");
    495     }
    496 
    497     if (bkpinfo->backup_media_type == netfs) {
    498         log_msg(2, "Mounting for Network thingy");
    499         log_msg(2, "isodir = %s", bkpinfo->isodir);
    500         if (!strcmp(bkpinfo->isodir, "/") && am_I_in_disaster_recovery_mode()) {
    501             mr_free(bkpinfo->isodir);
    502             mr_asprintf(bkpinfo->isodir, "/tmp/isodir");
    503             log_msg(1, "isodir is being set to %s", bkpinfo->isodir);
    504         }
    505         if ((bkpinfo->isodir == NULL) || (bkpinfo->netfs_remote_dir == NULL) || (bkpinfo->prefix == NULL)) {
    506             fatal_error("Unable to prepare the iso filename");
    507         }
    508 #ifdef __FreeBSD__
    509         mr_asprintf(mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number);
    510         mddev = make_vn(mount_cmd);
    511         mr_free(mount_cmd);
    512 
    513         mr_asprintf(mount_cmd, "mount_cd9660 -r %s "MNT_CDROM, mddev);
    514 #else
    515         mr_asprintf(mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->netfs_remote_dir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    516 #endif
    517 
    518     } else if (bkpinfo->backup_media_type == iso) {
    519 #ifdef __FreeBSD__
    520         mr_asprintf(mount_cmd, "%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number);
    521         mddev = make_vn(mount_cmd);
    522         mr_free(mount_cmd);
    523 
    524         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM);
    525 #else
    526         mr_asprintf(mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM);
    527 #endif
    528     } else if (bkpinfo->backup_media_type == usb) {
    529         mr_asprintf(mount_cmd, "mount -t vfat %s %s", bkpinfo->media_device, MNT_CDROM);
    530     } else if (strstr(bkpinfo->media_device, "/dev/")) {
    531 #ifdef __FreeBSD__
    532         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
    533 #else
    534         mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
    535 #endif
    536     } else {
    537         mr_free(bkpinfo->media_device);
    538         if (bkpinfo->disaster_recovery && does_file_exist(MINDI_CACHE"/CDROM-LIVES-HERE")) {
    539             bkpinfo->media_device = last_line_of_file(MINDI_CACHE"/CDROM-LIVES-HERE");
    540         } else {
    541             bkpinfo->media_device = find_cdrom_device(TRUE);
    542         }
    543 
    544 #ifdef __FreeBSD__
    545         mr_asprintf(mount_cmd, "mount_cd9660 -r %s %s", bkpinfo->media_device, MNT_CDROM);
    546 #else
    547         mr_asprintf(mount_cmd, "mount %s -t iso9660 -o ro %s", bkpinfo->media_device, MNT_CDROM);
    548 #endif
    549     }
    550 
    551     log_msg(2, "(mount_media) --- command = %s", mount_cmd);
    552     for (i = 0; i < 2; i++) {
    553         res = run_program_and_log_output(mount_cmd, FALSE);
    554         if (!res) {
    555             break;
    556         } else {
    557             log_msg(2, "Failed to mount device.");
    558             sleep(5);
    559             sync();
    560         }
    561     }
    562     mr_free(mount_cmd);
    563 
    564     if (res) {
    565         log_msg(2, "Failed, despite %d attempts", i);
    566     } else {
    567         log_msg(2, "Mounted media drive OK");
    568     }
    569     return (res);
    570 }
    571 /**************************************************************************
    572 *END_MOUNT_CDROM                                                         *
    573463**************************************************************************/
    574464
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.h

    r2623 r2696  
    77int iso_fiddly_bits(bool nuke_me_please);
    88void kill_petris(void);
    9 int mount_media();
    109int mount_device(char *, char *, char *, bool);
    1110int mount_all_devices(struct mountlist_itself *, bool);
  • branches/2.2.10/mondo/src/mondorestore/mondorestore.c

    r2623 r2696  
    5050extern int partition_everything(struct mountlist_itself *mountlist);
    5151extern int handle_incoming_parameters(int argc, char *argv[]);
     52extern int mount_media();
    5253
    5354/**
     
    24852486
    24862487    mvaddstr_and_log_it(g_currentY, 0, "Preparing to read your archives");
     2488    mount_media();
    24872489    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    2488         mount_media();
    24892490        mvaddstr_and_log_it(g_currentY++, 0,
    24902491                            "Restoring OS and data from streaming media");
     
    25042505        mvaddstr_and_log_it(g_currentY++, 0,
    25052506                            "Restoring OS and data from CD/USB   ");
    2506         mount_media();
    25072507        resA = restore_all_tarballs_from_CD(filelist);
    25082508        resB = restore_all_biggiefiles_from_CD(filelist);
  • branches/2.2.10/mondo/src/restore-scripts/mondo/grub-MR

    r2635 r2696  
    103103fi
    104104
     105# For some OpenSuSE
     106res=1
     107if [ "$MNT_RESTORING" ] ; then
     108    if [ -x $MNT_RESTORING/usr/sbin/grub-install.unsupported ]; then
     109        echo "Now I'll use grub-install.unsupported in chroot" >> $LOGFILE
     110        chroot $MNT_RESTORING /usr/sbin/grub-install.unsupported $1 >> $LOGFILE 2>> $LOGFILE
     111        res=$?
     112        echo "grub-install.unsupported in chroot returned $res" >> $LOGFILE
     113    fi
     114else
     115    if [ -x /usr/sbin/grub-install.unsupported ]; then
     116        echo "Now I'll use grub-install.unsupported locally" >> $LOGFILE
     117        /usr/sbin/grub-install.unsupported $1 >> $LOGFILE 2>> $LOGFILE
     118        res=$?
     119        echo "grub-install.unsupported returned $res" >> $LOGFILE
     120    fi
     121fi
     122[ "$res" -eq "0" ] && exit 0
     123
    105124echo "Now I'll use grub-install" >> $LOGFILE
    106125if [ "$MNT_RESTORING" ] ; then
    107     chroot $MNT_RESTORING grub-install $1 2>&1 | tee -a $LOGFILE
     126    chroot $MNT_RESTORING grub-install $1 >> $LOGFILE 2>> $LOGFILE
    108127    res=$?
    109128else
    110     grub-install $1 2>&1 | tee -a $LOGFILE
     129    grub-install $1 >> $LOGFILE 2>> $LOGFILE
    111130    res=$?
    112131fi
    113132echo "grub-install returned $res" >> $LOGFILE
    114 [ "$res" -eq "0" ] && exit 0
    115 
    116 # For some OpenSuSE
    117 echo "Now I'll use grub-install.unsupported" >> $LOGFILE
    118 if [ "$MNT_RESTORING" ] ; then
    119     chroot $MNT_RESTORING grub-install.unsupported $1 2>&1 | tee -a $LOGFILE
    120     res=$?
    121 else
    122     grub-install.unsupported $1 2>&1 | tee -a $LOGFILE
    123     res=$?
    124 fi
    125 echo "grub-install.unsupported returned $res" >> $LOGFILE
    126133[ "$res" -eq "0" ] && exit 0
    127134
     
    172179echo "Now I'll use grub-install.patched" >> $LOGFILE
    173180cp -f `which grub-install.patched` /mnt/RESTORING/sbin
    174 chroot /mnt/RESTORING grub-install.patched $1 2>&1 | tee -a $LOGFILE
     181chroot /mnt/RESTORING grub-install.patched $1 >> $LOGFILE 2>> $LOGFILE
    175182res=$?
    176183echo "grub-install.patched returned $res" >> $LOGFILE
  • branches/2.2.10/website/docs.shtml

    r2635 r2696  
    2323  </ul>
    2424  <p>The Mondo Rescue HOWTO has also been translated in german by Magnus Rasche (Magnus.rasche_at_gmx.de):</p>
     25  <ul>
    2526  <li>A <a href="/docs/mondorescue-howto-de.pdf" target="_blank">PDF</a> document. (<a href="ftp://ftp.mandrivauser.de/magazin/mondorescue-howto-de.pdf">Reference</a> site)</li>
     27  </ul>
    2628
    2729  <div class="h2-3">
     
    5961  <ul>
    6062          <li>A Mondo Rescue <a href="/docs/mondo-intro.pdf" target="_blank">introduction</a> (in French) made by Gallig Renaud.
    61           <li>A Mondo Rescue <a href="http://trac.mondorescue.org/browser/branches/stable/mondo-doc/mondo-presentation.odp" target="_blank">presentation</a> made by Bruno Cornec. (Older versions also available: <a href="/docs/mondo-presentation-v1.pdf" target="_blank">v1</a>,<a href="/docs/mondo-presentation-v2.pdf" target="_blank">v2</a>)
     63          <li>A Mondo Rescue <a href="http://trac.mondorescue.org/browser/devel/mondo-doc/mondo-presentation.odp" target="_blank">presentation</a> made by Bruno Cornec. (Older versions also available: <a href="/docs/mondo-presentation-v1.pdf" target="_blank">v1</a>,<a href="/docs/mondo-presentation-v2.pdf" target="_blank">v2</a>)
     64          <li>A mondoarchive <a href="/docs/mondo-ref-card.pdf" target="_blank">reference card</a> made by Lester Wade..
    6265          <li><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a> <span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type"><a href="http://www.mondorescue.org/docs/p2v.pdf">Linux P2V migrations using MondoRescue</a></span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://opensource.hp.com" property="cc:attributionName" rel="cc:attributionURL">Lester Wade</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="/docs/p2v.odt" rel="dc:source">trac.mondorescue.org</a>.
     66          <li>A now obsoleted by the previous Mondo Rescue hardware migration (including P2V with VMWare) <a href="/docs/hwmigration.pdf" target="_blank">guide</a> made by Gallig Renaud, Eric Montaut and François-Xavier Horel. (<a href="/docs/HOWTO-_Deploy_Linux_from_SCSI_to_SATA.pdf" target="_blank">previous version</a>)
    6367          <li><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a> <span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">The <a href="/docs/LabMondoRescue.pdf" target="_blank">MondoRescue Lab</a></span>: Experience yourself MondoRescue by following those Lab instructions ! Should provide you with at least 2 hours of fun discovering the tool with detailed explanations. This Lab has been developed for an internal HP Open Source and Linux Event I contributed to organize (TES 2009). Highly recommended to have a good tour of the features. By <a xmlns:cc="http://creativecommons.org/ns#" href="http://opensource.hp.com" property="cc:attributionName" rel="cc:attributionURL">Bruno Cornec</a> and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 Unported License</a>.<br />Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="/docs/LabMondoRescue.odt" rel="dc:source">trac.mondorescue.org</a>.
    64           <li>A now obsoleted by the previous Mondo Rescue hardware migration (including P2V with VMWare) <a href="/docs/hwmigration.pdf" target="_blank">guide</a> made by Gallig Renaud, Eric Montaut and François-Xavier Horel. (<a href="/docs/HOWTO-_Deploy_Linux_from_SCSI_to_SATA.pdf" target="_blank">previous version</a>)
     68          <li>Other useful docs can be found on the <a href="http://trac.mondorescue.org/wiki/Communication#Articlesonmondorescue">Wiki</a>
     69  </ul>
    6570
    6671<!--#include virtual="/bottom.shtml" -->
Note: See TracChangeset for help on using the changeset viewer.