Changeset 2937 in MondoRescue for branches/3.1/mindi


Ignore:
Timestamp:
Jan 28, 2012, 1:51:28 AM (12 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 2849:2935 ../3.0

  • Adds 3 binaries called potentially by udev o support USB key mount at restore time (Victor Gattegno)
  • mindi only sets the boot flag of a USB device if none is present already (should avoid flip/flop situation)
  • Fix a compatibility bug in analyze-my-lvm whete exclude lists with '|' was incorrectly analyzed (' ' still expected)
  • Precise that -J is not supported by mondorestore yet.
  • Fix a compatibility bug in mindi where exclude lists with '|' was incorrectly analyzed (' ' still expected)
  • Install an MBR on USB devices when possible
  • Improve error message in case mondorestore isn't found
  • Adds support for more virtio devices for KVM restore
  • Improve mbr.bin handling
  • Fix an issue in test of FindKernel for Xen and non Xen cases
    • Fix #492 by removing an extra useless fi
    • Move fvat nd fat modules to CDROM_MODS in order to have them in the initrd to support saving logs to a USB device e.g.
    • Fix an error when dmidecode reports comments before system name
    • Fix previous broken patch on comment management for bkphw
    • Improve msgs printed during kbd analysis
    • Fix a small remaining pb with new comment support
    • Try to again improve the mount/umount stuff in mondo -Adds mention to OEL, CentOS, ScientifLinux as RHEL clones
  • Fix a panadoid_free done on the wrong variable (solve a memory leak)
  • Solve #495 by skipping the potential (auto-read-only) when analyzin /proc/mdstat result
  • Fix some markup in man pages
  • adds the post-nuke script sample for Debian (Guillaume Pernot/Andrée Leidenfrost)
  • Avoid a useless umount when changing of afio set, let insist_on_cd check and perform if needed
  • Copy everything under .ssh of root account to allow for sshfs mount without passwd at restore time.
  • Adds support for bnx2i driver
  • Try to fix #496 by supporting the protocol in the output of the mount command (sshfs#...)
  • Uses the -d option of the mount command to avoid leaving loop devices in use. Probably provoked by the usage of a more recent busybox, but anyway that option doesn't hurt, and does nothing for non-loop devices. Should fix the problems reported on the ML with NFS and more than 8 ISO images (8 being the default number of loop devices available)
  • Attempt to fix #436 by adding some newtDrawForm where appropriate.
  • Fix bugs in the kernel detection routine of mindi (some echo were done without capturing their output, confusing the return). This should also help the Xen detection issue
  • Change the logging function to be nearer from 2.2.10, and start using some
  • Initialize some global fields with an empty string, now that newt Draws more regularly progress forms
  • Mindi progression still not good, but showing now 3% when calling mindi. Would need a specific handling for the progress bar to evolve more afterwards
  • Add compatibility with the latest SSSTK + PSP content for HP ProLiant + branding homogeneous now. We only take conrep out of the SSSTK pending a package availability. Using hpacuscripting now. Review of parameters called following test made.
  • Fix #501 by pushing BOOT_SIZE to 36864 for certain Ubuntu cases
  • Fix some remaining inconsistencis in the ProLiant HW backup. ready for usage.
  • Fix an issue on udevadm call (needs an intermediate variable)
  • Fix a remaining ProLiant tool call
  • Remove again some wrong variable initialization for Net in order to not have strange messages now we call Draw more often
  • Adds support for hwaddr (MAC addresses) at restore time, and map to the correct NIC if it's found at restore time (based on code from Stefan Heijmans)
  • Try to Fix #499 by changing init in order to never exit, and rebooting using sysrq in /proc (not portable). Maybe should move to using a real init, and a separated rcS script.
  • Fixes the shell msg error by using setsid as per Busybox FAQ
  • Fix #491 by correctly checking Xen kernel used for a dom0 env (apollo13)
  • Improves logging in Die()
  • Improve again ProLiant HW support, by adding references to the yet to come SSSTK rpm so that conrep is called at its future right place.
  • Improve mindi support for kernel 3.x
  • Fix #499 for good, by using a real init from busybox and moving our init script to etc/init.d/rcS. We also now call the reboot from busybox to exit, which indeed reset the system correctly (in a VM at least which wasn't the case before). Reauires a new mindi-busybox as well.
  • Attempt to solve #503 by handling /lib64 separately for udev and only if not a link (to /lib) for Ubuntu 64
  • Improve again previous tests for bug #503
  • Improve -d option description for NFS
  • Allow http download for ftp content
  • New italian mirror
  • Fix #505 by documenting environment variables
    • Fix a bug where on OBDR mode compression was turned off to create the OBDR content but not back on (report from the mailing list)
  • solve http://trac.mondorescue.org/ticket/520 by Victor Gattegno
  • Fix #524 as option -U needs a size also
  • Removes useless gendf option
  • Fix #511 now stabgrub is called also after conf file modifications
  • Adds support for SUID binaries
  • remove a useless xenkernelname variable from mindi
  • Should fix #512 by clearing old scratchdir before changing to a new
  • Simplify the function engaging SCSI for Smart Array controllers, and support as many controller as we have
  • Add some binaries used on SLES 10 by udev
  • Fix a syntax issue in newt-specific.c
  • Fix a memory free bug where a used variable was freed to early
  • Fix a memory free bug where a used variable was misused in asprintf/free
  • Fix #498 by using an external program (hpsa_obdr_mode) which can set the mode of the tape to CD-ROM or Sequential at will.

That program will have to be downloaded from http://cciss.sf.net

  • Adds support for the route command in mindi-busybox
  • Force block size back to 32768 in OBDR mode after skipping the 2 tape marks, to read the additional rootfs data corerctly - Fix #498 for good it seems
  • Adds support for a new pata_atiixp driver
  • Fix #525 and improve printing when no /etc/raidtab, but still md devices
  • Exclude /run similarly to /sys and /proc
  • Fix a bug in mindi when having multiple swap partiions with same starting string (/dev/dm-1 and /dev/dm-16). We now add a space in the grep to avoid mischoice.
  • Fix grub installation if we had to go in the hack part which wasn't using the correct variables to make decisions !
  • Remove all mention of mondorescue.com from code
  • Fix some website typo on the download page and precise that we now develop on Mageia
  • Exclude sysfs devpts and tmpfs partitions found in RHEL 6.2 from analyze by mindi (made error messages)
  • Force activation of first partition which should not be optional as everything is destroyed before
  • Fix a bug in analyze-my-lvm where LVs were created in random order (the one of lvscan) instead of using the dm-xxx order, which creates issues at restore time between the mapping created then and the one we had at backup time which could be inconssistent

-mondoarchive now exists if the mt command is missing when needed

  • Proper fix for analyze-my-lvm
  • Fix #500 and #473 by adding support of old metadata format for mdadm if using grub < 0.9x or lilo on a md boot device (to be tested)
  • Really never inject or eject when the -e option is passed or device is inappropriate (USB, Net, ...)
  • Fix #577 by having factor back as a float (not a long ! it's a decimal value) and making the appropriate cast.
  • Fix #578 by improving the regexp used for CD/DVD detection with -scanbus option
  • Adds more verbosity when LVM creation fails.
  • Fix #579 by checking with pipes on both sides of the string
  • debugfs should be excluded from the device considered for fstab analysis
Location:
branches/3.1/mindi
Files:
4 deleted
13 edited
3 copied

Legend:

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

    r2696 r2937  
    55Mindi has a script able to store the Hardware configuration and those parameters may be restored before launching mondorestore during the boot phase computed by mindi, in order to re-setup the machine as the original one.
    66
    7 For the moment, only HP Proliant systems are supported. If you have tools to allow support for other type of machines, feel free to contribute patches to that script.
     7For the moment, only HP ProLiant systems are supported. If you have tools to allow support for other type of machines, feel free to contribute patches to that script. For details on how to use ProLiant tools, please look at the README.ProLiant file
    88
    9 If you have a Proliant system you first need to get the Smart Start Scripting Toolkit. Due to licenses issues, mindi cannot provide those tools itself. You need to get them from http://www.hp.com/servers/sstoolkit
    10 
    11 Mindi expects to find those tools under /usr/local/bin as described in the deplist.d/proliant.conf configuration file. Here are the steps to set it up correctly:
    12 
    13 Older URL:
    14 wget ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p308169895/v40154/ss-scripting-toolkit-linux-1.70.tar.gz
    15 wget ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p308169895/v43548/ss-scripting-toolkit-linux-1.81.tar.gz
    16 
    17 cd /tmp
    18 wget ftp://ftp.hp.com/pub/softlib2/software1/pubsw-linux/p308169895/v44247/ss-scripting-toolkit-linux-1.90.tar.gz
    19 mkdir ssstk
    20 cd ssstk
    21 tar xvfz ../ss-scripting-toolkit-linux-1.90.tar.gz
    22 cp -a utilities/hponcfg /usr/local/bin
    23 cp -a utilities/conrep /usr/local/bin
    24 cp -a utilities/conrep.xml /usr/local/bin
    25 # For versions <= 1.90
    26 cp -a utilities/cpqacuxe/cpqacuxe /usr/local/bin
    27 cp -a utilities/cpqacuxe/bld /usr/local/bin
    28 mv /usr/local/bin/bld/*.so /usr/local/lib
    29 # For recent versions
    30 cp -a utilities/hpacucli /usr/local/bin
    31 echo /usr/local/lib >> /etc/ld.so.conf
    32 ldconfig
    33 
    34 You're now ready to check your configuration by running:
    35 mindi-bkphw /var/cache/mindi /etc/mindi
    36 [First parameter is the directory where files will be generated,
    37  Second parameter is the directory of the file proliant.files is located]
    38 
    39 For these tools to work you may have to install additional packages such as hpasm and hprsm from the HP Web site, as well as some libstdc++ compatibility packages (compat-libstdc++-33 and compat-libstdc++-296 on RHEL 5 e.g.)
    40 
    41 In order to have a working hponcfg binary you also need to install the hprsm/hpasm packages from HP Web site. Refer to http://welcome.hp.com/country/us/en/support.html?pageDisplay=drivers
    42 
     92011-10-07 Move ProLiant section to a specific file
    43102007-05-30 Initial file
  • branches/3.1/mindi/README.bootparam

    r2816 r2937  
    4040
    4141nohw
    42     Do not call the mindi-rsthw script which try to restore also your BIOSes configuration (Proliant only)
     42    Do not call the mindi-rsthw script which try to restore also your BIOSes configuration (ProLiant only for now)
    4343
    4444nolvm
  • branches/3.1/mindi/README.pxe

    r2499 r2937  
    1111label mondo
    1212        kernel vmlinuz-mondo
    13         append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ...
     13        append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [hwaddr=M:A:C:A:D:R] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ...
    1414
    1515ipdev is the device name (e.g. eth2)
     
    1919gateway is the default gateway (e.g. 192.168.1.254)
    2020dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface.
     21hwaddr is the MAC address of the device you want to use to restore through
    2122proto is the protocol to use for mounting the remote share (default is NFS, sshfs is also available)
    2223server is the ip addr of the Remote Network server
     
    4849CAVEAT: the limit to the number of char on the append line is 255. Use symlinks to reduce the size of your path if needed.
    4950
    50 Please report any problem around that tool to bruno@mondorescue.org
     51Please report any problem around that tool to bruno_at_mondorescue.org
    5152
     532011-10-09 adds support for hwaddr
    52542009-12-05 nfsopt added tp allow for custom options at mount time
    53552009-09-09 Changed to netfs for multi protocol support (nfs, sshfs, ...)
  • branches/3.1/mindi/analyze-my-lvm

    r2816 r2937  
    6060        done
    6161        list_of_devices="`echo $l | sort -u`"
    62         for ed in $MINDI_EXCLUDE_DEVS ; do
     62        for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    6363            if  [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then
    6464                echo "Not including device $LV_full_string as it was excluded"
     
    159159
    160160    if [ "$MINDI_EXCLUDE_DEVS" ] ; then
    161         for ed in $MINDI_EXCLUDE_DEVS ; do
     161        for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    162162            if  [ "`echo " $list_of_devices" | grep " $ed"`" != "" ]; then
    163163                echo $current_VG >> $MINDI_TMP/excludedvgs
     
    188188        list_of_devices="`echo $l | sort -u`"
    189189        if [ "$MINDI_EXCLUDE_DEVS" ] ; then
    190             for ed in $MINDI_EXCLUDE_DEVS ; do
     190            for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    191191                if  [ "`echo " $list_of_devices " | grep " $ed"`" != "" ]; then
    192192                    skip=1
     
    211211                list_of_devices="`echo $l | sort -u`"
    212212                if [ "$MINDI_EXCLUDE_DEVS" ] ; then
    213                     for ed in $MINDI_EXCLUDE_DEVS ; do
     213                    for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    214214                        if  [ "`echo " $list_of_devices " | grep " $ed"`" != "" ]; then
    215215                            skip=1
     
    266266        skip=0
    267267        if [ "$MINDI_EXCLUDE_DEVS" ] ; then
    268             for ed in $MINDI_EXCLUDE_DEVS ; do
     268            for ed in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    269269                if  [ "`echo " $rep " | grep " $ed"`" != "" ]; then
    270270                    skip=1
     
    291291}
    292292
     293ListAllLogicalVolumesSortedBydm() {
     294        for d in `ListAllLogicalVolumes` ; do
     295            dm=`mindi --readalllink $d | tail -1`
     296            echo "$dm|$d" >> $MINDI_TMP/sorteddm
     297        done
     298        sort -t'|' $MINDI_TMP/sorteddm | cut -d'|' -f2
     299}
    293300
    294301ListAllLogicalVolumes() {
     
    414421echo ""
    415422echo "Finally, create the LV's (logical volumes)."
    416 all_logical_volumes=`ListAllLogicalVolumes`
     423all_logical_volumes=`ListAllLogicalVolumesSortedBydm`
    417424for current_LV in $all_logical_volumes ; do
    418425    ProcessLogicalVolume $current_LV
  • branches/3.1/mindi/deplist.d/base.conf

    r2816 r2937  
    6363/usr/bin/cmp
    6464/sbin/ctrlaltdel
    65 /usr/bin/halt
    6665/bin/dd
    6766/usr/bin/eject
    6867/usr/bin/env
    6968/sbin/halt
     69/usr/bin/halt
    7070/sbin/ldconfig
    7171/usr/bin/wc
  • branches/3.1/mindi/deplist.d/minimal.conf

    r2850 r2937  
    123123/etc/sysconfig/udev
    124124/sbin/consoletype
     125# On SLES 10
     126/sbin/path_id
     127/sbin/scsi_id
     128/sbin/scsi_tur
     129/sbin/hwup
    125130
    126131# Modules
  • branches/3.1/mindi/mindi

    r2874 r2937  
    3636
    3737EXTRA_SPACE=80152       # increase if you run out of ramdisk space
    38 BOOT_SIZE=32768         # size of the boot disk
     38BOOT_SIZE=36864         # size of the boot disk
    3939
    4040PROMPT_MAKE_CD_IMAGE="yes"
     
    5454    # If set to "no", the kernel is not a Xen kernel
    5555    # If "yes", mindi will modify isolinux.cfg for the Xen kernel.
     56xenkernelpath=""
    5657 
    5758MY_FSTAB=/etc/fstab
     
    6061
    6162# 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 ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci libahci 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"
     63IDE_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 libahci sata_nv cmd64x pata_amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron pata_atiixp amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon"
    6364PCMCIA_MODS="pcmcia_core ds yenta_socket"
    6465USB_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 usbserial"
    65 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse libcrc32c crc32c netbk xenblktap r8169"
    66 CDROM_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"
     66NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse libcrc32c crc32c netbk xenblktap r8169 virtio_net"
     67CDROM_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 vfat fat"
    6768# 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 raid6_pq async_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 dm-region-hash dm-snapshot dm-log 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"
     69EXTRA_MODS="$CDROM_MODS loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq async_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 dm-region-hash dm-snapshot dm-log 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"
    6970# Replace with that line for HP OCMP e.g.
    7071#DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain"
     
    7273# Force some modules to be included
    7374FORCE_MODS=""
     75
     76# Find MBR in case of bootable USB device to build
     77MBRFILE=/usr/lib/syslinux/mbr.bin
     78[ ! -r "$MBRFILE" ] && MBRFILE=/usr/lib64/syslinux/mbr.bin
     79[ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/syslinux/mbr.bin
     80[ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib/syslinux/mbr.bin
     81[ ! -r "$MBRFILE" ] && MBRFILE=/usr/share/lib64/syslinux/mbr.bin
    7482
    7583LOGFILE=/var/log/mindi.log
     
    132140}
    133141
    134 LogIt() {
    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
     142LogOnly() {
    140143    echo -e "$1" >> $LOGFILE
    141144    if [ _"$2" != _"" ]; then
     
    143146    fi
    144147    rm -f "$2"
     148}
     149
     150# Function to log on screen only
     151LogScreen() {
     152    if [ -e /dev/stderr ] ; then
     153        echo -e "$1" >> /dev/stderr
     154    elif [ -e /usr/bin/logger ] ; then
     155        /usr/bin/logger -s $1
     156    fi
     157}
     158
     159# Function to log in log file only
     160LogFile() {
     161
     162    echo -e "$1" >> $LOGFILE
     163    if [ _"$2" != _"" ]; then
     164        grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
     165    fi
     166    rm -f "$2"
     167}
     168
     169# Function to log in both screen and logfile
     170LogAll() {
     171    LogScreen "$1"
     172    LogFile "$1" "$2"
     173}
     174
     175# Preserved for compatibility
     176LogIt() {
     177    LogAll "$1" "$2"
    145178}
    146179
     
    369402        mkdir -p $bigdir/etc/console
    370403        cp /etc/console/boottime.kmap.gz $bigdir/etc/console 2>> $LOGFILE
     404        echo ""
    371405        echo -e "$DONE"
    372406        return 0
     
    383417        mkdir -p $bigdir/etc/console-setup
    384418        cp $kbdfile $bigdir/etc/console-setup 2>> $LOGFILE
     419        echo ""
    385420        echo -e "$DONE"
    386421        return 0
     
    439474    KBDEPTH=0
    440475    AddKeyboardMappingFile $mappath
     476    echo ""
    441477    echo -e "$DONE"
    442478    rm -f $MINDI_TMP/keymaps.find
     
    453489    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib64/syslinux/mboot.c32
    454490    [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"`
    455     [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.com and click on 'Download'"
     491    [ ! -e "$MBOOTC32" ] && Die "Please install mboot.c32 first. If your syslinux RPM doesn't include mboot.c32, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml"
    456492    LogFile "Found mboot.c32 at $MBOOTC32"
    457493}
     
    465501    [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib64/syslinux/isolinux.bin
    466502    [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"`
    467     [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.com and click on 'Download'"
     503    [ ! -e "$ISOLINUX" ] && Die "Please install isolinux first. If your syslinux RPM doesn't include isolinux, you may download an isolinux RPM from Mondo's website - go to http://www.mondorescue.org/downloads.shtml"
    468504    LogFile "Found isolinux.bin at $ISOLINUX"
    469505}
     
    704740# $1: raid device (/dev/md...)
    705741GetRaidDevMembers() {
     742    if [ ! -f /etc/raidtab ]; then
     743        return
     744    fi
    706745    $AWK "/^[[:space:]]*#/ {next} /^[[:space:]]*raiddev/ {if(dev) exit; if(\$2 == \"$1\") dev=\$2} /^[[:space:]]*device/ {if(dev) {print \$2}}" < /etc/raidtab
    707746}
     
    9771016
    9781017MakeMountlist() {
    979     local scratchdir mountlist all_partitions current_partition \
     1018    local mountlist all_partitions current_partition \
    9801019partition_size partition_format outstring partition_number \
    9811020partition_mountpt c_p lwm_info psz lvm_dev unofficial_outstring \
     
    9901029    LogAll "-----------------------------------"
    9911030
    992 # scratchdir, mountlist(OUT)
    993     scratchdir=$MINDI_TMP
     1031# mountlist(OUT)
    9941032    mountlist=$1
    9951033
     
    10191057    printf "%-15s %-15s %-15s %s %s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE
    10201058    printf "%-15s %-15s %-15s %s %s\n" ------ ---------- ------  -------  ---------- | tee -a $LOGFILE
    1021     useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1"
     1059    useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1 tmpfs devpts sysfs proc debugfs"
    10221060    for c_p in $all_partitions ; do
    1023         # Skip evices, network FS, cisf
     1061        # Skip fd/cd devices, network FS, cifs
    10241062        [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -E "^//"`" != "" ]&& continue
    10251063        [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
     
    10321070        fi
    10331071        [ "$c_p" = "none" ] && continue
    1034         # Debian 5 does that
    1035         [ "$c_p" = "proc" ] && continue
    10361072        redhat_label=""
    10371073        label=""
     
    11101146                    [ "`echo $uname | grep "2.6.19"`" != "" ] && skip=1052
    11111147                    [ "`echo $uname | grep "2.6.[2-9]"`" != "" ] && skip=1052
     1148                    [ "`echo $uname | grep "3.[0-9]*.[0-9]*"`" != "" ] && skip=1052
    11121149                    if [ $skip = "" ]; then
    11131150                        Die "Your kernel is too old. I don't know how to support labelled swap spaces with it"
     
    12181255            list_of_devices="`echo $l | sort -u`"
    12191256
    1220             for d in $MINDI_EXCLUDE_DEVS ; do
     1257            for d in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    12211258                if  [ "`echo " $list_of_devices " | grep " $d"`" != "" ]; then
    12221259                    echo "Excluding $current_partition from mountlist (due to excluded device $d)" >> $LOGFILE
     
    12681305            [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue
    12691306            if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then
    1270                 partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition" | $AWK '{print $3}'`
     1307                partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition " | $AWK '{print $3}'`
    12711308                [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap"
    12721309                [ "$partition_format" != "swap" ] && partition_format="swap"
     
    14871524    LogFile "Transforming $USBDEVICE in a Bootable device" 
    14881525    LogFile "Checking $USBDEVICE"
    1489     $FDISK -l $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE
     1526    $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE
    14901527    if [ $? -ne 0 ]; then
    14911528        LogAll "Unable to access $USBDEVICE"
     
    14991536    # If your key has no MBR it may cause an issue
    15001537    # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE
     1538    if [ -r $MBRFILE ]; then
     1539        LogFile "Installing an MBR ($MBRFILE) on $USBDEVICE"
     1540        dd if=$MBRFILE of=$USBDEVICE
     1541    else
     1542        LogFile "You may need to install an MBR (usually in $MBRFILE, but not found on your system) "
     1543        LogFile "on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE"
     1544    fi
    15011545    LogFile "Preparing $USBDEVICE"
    1502     $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE << EOF
     1546    cat > $MINDI_TMP/fdisk.txt << EOF
    15031547d
    15041548d
     
    15161560w
    15171561EOF
     1562    $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt
    15181563    if [ $? -ne 0 ]; then
    15191564        LogAll "Unable to create a vfat Filesystem on $USBDEVICE"
     
    15221567        MindiExit -1
    15231568    fi
     1569    LogFile "fdisk build file"
     1570    LogFile "----------------"
     1571    cat $MINDI_TMP/fdisk.txt >> $LOGFILE
     1572    LogFile "----------------"
     1573    rm -f $MINDI_TMP/fdisk.txt
    15241574    LogFile "The USB device $USBDEVICE now looks like this:"
    15251575    $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
     
    20232073    local devpath drive res stub
    20242074    device=$1
     2075    if [ "`echo "$device" | grep -E "^/dev/"`" = "" ] ; then
     2076        Die "Cannot find $device's size - is your /etc/fstab sane?"
     2077    fi
    20252078    if [ "`echo "$device" | grep -F "/dev/md"`" != "" ] ; then
    20262079        res=`SizeOfRaidPartition $device`
     
    20912144
    20922145
     2146# WARNING: This function should just echo the final result !!!
     2147#
    20932148TryToFindKernelPath() {
    2094     local fname incoming res fkern_ver we_want_version possible_kernels noof_kernels kernelpath kdate duff_kernels
     2149    local fname fkern_ver we_want_version possible_kernels noof_kernels possible_xenkernels noof_xenkernels kp kdate duff_kernels output root
    20952150
    20962151    we_want_version=$KERVERRUN
    20972152    possible_kernels=""
    20982153    duff_kernels=""
     2154    output=""
    20992155   
    21002156    if [ "$ARCH" = "ia64" ] ; then
     
    21042160    fi
    21052161    # See if we're booted from a Xen kernel
    2106     if [ -d /proc/sys/xen ]; then
     2162    # From http://wiki.xensource.com/xenwiki/XenCommonProblems#head-26434581604cc8357d9762aaaf040e8d87b37752
     2163    if [ -f /proc/xen/capabilities ]; then
    21072164        # It's a Xen kernel
    21082165        KERNEL_IS_XEN="yes"
    2109         LogIt "It's a Xen kernel..."
     2166        LogFile "It's a Xen kernel..."
    21102167    fi
    21112168
     
    21682225        fi
    21692226    elif [ "$noof_kernels" -eq "1" ] ; then
    2170         kernelpath=`echo "$possible_kernels" | sed s/' '//`
    2171         LogFile "Your kernel is $kernelpath (v$KERVERRUN)"
    2172         output="$kernelpath"
     2227        kp=`echo "$possible_kernels" | sed s/' '//`
     2228        LogFile "Your kernel is $kp (v$KERVERRUN)"
     2229        output="$kp"
    21732230    else
    21742231        for i in $possible_kernels ; do
    2175             if echo $i | grep "$KERVERRUN" ; then
     2232            if [ "`echo $i | grep "$KERVERRUN"`" ]; then
    21762233                LogAll "OK, I used my initiative and found that "
    21772234                LogAll "$i is probably your kernel. "
    21782235                output="$i"
     2236                break
    21792237            fi
    21802238        done
    2181         if [ -n "$output" ]; then
    2182             if echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null ; then
     2239        if [ ! -n "$output" ]; then
     2240            if [ "`echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null`" ]; then
    21832241                output=/boot/vmlinuz
    2184                 echo "Schlomo, this one's for you." >> $LOGFILE
     2242                LogFile "Schlomo, this one's for you."
    21852243            else
    2186                 LogIt "Two or more possible kernels found. You may specify any one of them and the "
    2187                 LogIt "boot disks will still work, probably. If one does not work, try another."
    2188                 LogIt "$possible_kernels"
    2189                 echo ""
     2244                LogFile "Two or more possible kernels found. You may specify any one of them and the "
     2245                LogFile "boot disks will still work, probably. If one does not work, try another."
     2246                LogFile "$possible_kernels"
     2247                output=""
    21902248            fi
    21912249        fi
     
    21962254        elif [ "$noof_xenkernels" -eq "1" ]; then
    21972255            xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//`
    2198             echo "Your Xen kernel is $xenkernelpath (v$KERVERRUN)" >> $LOGFILE
     2256            LogFile "Your Xen kernel is $xenkernelpath (v$KERVERRUN)"
    21992257        else
    22002258            for i in $possible_xenkernels ; do
    2201                     if echo $i | grep "$KERVERRUN" ; then
    2202                     LogIt "OK, I used my initiative and found that "
    2203                         LogIt "$i is probably your Xen kernel. "
     2259                if [ "`echo $i | grep "$KERVERRUN"`" ]; then
     2260                    LogFile "OK, I used my initiative and found that "
     2261                    LogFile "$i is probably your Xen kernel. "
    22042262                    xenkernelpath="$i"
     2263                    break
    22052264                fi
    22062265            done
    2207             if [ -n "$xenkernelpath" ]; then
     2266            if [ ! -n "$xenkernelpath" ]; then
    22082267                new_possible_xenkernels=`echo "$possible_xenkernels" | tr -s ' ' '\n' | grep -E "^/boot" | sort -u | tr '\n' ' '`
    22092268                if [ ! -n "$new_possible_xenkernels" ]; then
    22102269                    xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1`
    2211                     LogIt "Using $xenkernelpath"
     2270                    LogFile "Using $xenkernelpath"
    22122271                else
    2213                         LogIt "Two or more possible Xen kernels found. You may specify any one of them and the "
    2214                     LogIt "boot disks will still work, probably. If one does not work, try another."
    2215                         LogIt "$possible_xenkernels"
    2216                     echo ""
     2272                    LogFile "Two or more possible Xen kernels found. You may specify any one of them and the "
     2273                    LogFile "boot disks will still work, probably. If one does not work, try another."
     2274                    LogFile "$possible_xenkernels"
     2275                    output=""
    22172276                    xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1`
    2218                     LogIt "Using $xenkernelpath"
     2277                    LogFile "Using $xenkernelpath"
    22192278                fi
    22202279            fi
    22212280        fi
    2222         xenkernelname=`basename $xenkernelpath`
    22232281        if [[ -z "$xenkernelpath" || ! -f "$xenkernelpath" ]]; then
    22242282            Die "Cannot find Xen kernel $xenkernelpath, aborting"
    22252283        fi
    22262284    fi
     2285    LogAll "TryToFindKernelPath found $output"
    22272286    echo "$output"
    22282287}
     
    22582317    echo `cat $MINDI_TMP/mnt.lis` `sort -u $MINDI_TMP/deps.lis` >> $MINDI_TMP/cp.lis
    22592318    rm -f $MINDI_TMP/deps.lis $MINDI_TMP/mnt.lis
     2319
     2320    # Copy of files mandatory for ssh to automate mount if sshfs is used
     2321    echo .ssh >> $MINDI_TMP/mkdir.lis
     2322    echo ~root/.ssh/* >> $MINDI_TMP/cp.lis
     2323    echo > $mountpoint/tmp/myssh << EOF
     2324ssh -o StrictHostKeyChecking=no $*
     2325EOF
     2326    chmod 755 $mountpoint/tmp/myssh
     2327    echo $mountpoint/tmp/myssh >> $MINDI_TMP/cp.lis
    22602328
    22612329    # Copy of files mandatory for ld.so
     
    22792347        # This avoids NIC remapping if on another machine at restore time on Ubuntu at least
    22802348        echo ./etc/udev/rules.d/[0-9][0-9]-persistent-net.rules >> $MINDI_TMP/rm.lis
     2349
     2350        # Do not do it if it's a link (Ubuntu 64 bits #503)
     2351        if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [  ! -h "/lib64/udev" ]; then
     2352            echo /lib64/udev >> $MINDI_TMP/mkdir.lis
     2353            echo /lib64/udev/* >> $MINDI_TMP/cp.lis
     2354        fi
     2355        if [ -e "/lib32/udev" ] && [ ! -h "/lib32" ] && [  ! -h "/lib32/udev" ]; then
     2356            echo /lib32/udev >> $MINDI_TMP/mkdir.lis
     2357            echo /lib32/udev/* >> $MINDI_TMP/cp.lis
     2358        fi
     2359        if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [  ! -h "/lib/udev" ]; then
     2360            echo /lib/udev >> $MINDI_TMP/mkdir.lis
     2361            echo /lib/udev/* >> $MINDI_TMP/cp.lis
     2362        fi
    22812363        if [ -x /sbin/udevd ]; then
    22822364            # Get only the files which exist in the udev.files list
     
    22962378    fi
    22972379
    2298     # Management of potential HW info (Proliant only at the moment)
     2380    # Management of potential HW info (ProLiant only at the moment)
    22992381    rm -rf $MINDI_CACHE/bkphw
    23002382    mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE
     
    23712453        echo "lib/firmware" >> $MINDI_TMP/mkdir.lis
    23722454        echo "/lib/firmware" >> $MINDI_TMP/cp.lis
     2455    fi
     2456
     2457    # Copy an additional ProLiant tool for OBDR support
     2458    if [ -f $MINDI_TMP/OBDR ]; then
     2459        if [ -x /usr/bin/hpsa_obdr_mode ]; then
     2460            echo $mountpoint/usr/bin >> $MINDI_TMP/mkdir.lis
     2461            echo /usr/bin/hpsa_obdr_mode >> $MINDI_TMP/cp.lis
     2462            LogIt "Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support"
     2463        else
     2464            LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode tool"
     2465            LogAll "         This may lead to a tape not going back to sequential mode after OBDR boot"
     2466        fi
    23732467    fi
    23742468
     
    24182512    # Finally remove useless stff
    24192513    (cd $mountpoint ; rm -f `cat $MINDI_TMP/rm.lis`) 2>&1 >> $LOGFILE
    2420 
    2421     # Copy of files mandatory for ssh to automate mount if sshfs is used
    2422     cp -rp ~root/.ssh/*.pub ~root/.ssh/config ~root/.ssh/known* $mountpoint/.ssh 2> /dev/null
    2423     cat > $mountpoint/bin/myssh << EOF
    2424 ssh -o StrictHostKeyChecking=no $*
    2425 EOF
    2426     chmod 755 $mountpoint/bin/myssh
    24272514
    24282515    # Finally integrate what we provide statically as part of mindi
     
    26952782if [ "$#" -ne "0" ] ; then
    26962783    if [ "$1" = "--findkernel" ] ; then
    2697         res=`TryToFindKernelPath`
     2784        resk=`TryToFindKernelPath`
    26982785        # Avoids logfile content for mondo
    26992786        export MONDO_SHARE=""
    2700         if [ "$res" = "" ] ; then
     2787        if [ "$resk" = "" ] ; then
    27012788            if [ $KERNEL_IS_XEN = "yes" ]; then
    27022789                echo "$xenkernelpath"
    2703                 MindiExit 0
     2790                LogOnly "xenkernelpath = $xenkernelpath"
     2791                MindiExit 0
    27042792            else
    2705                 MindiExit -1
     2793                MindiExit -1
    27062794            fi
    27072795        else
    2708             echo "$res"
    2709             MindiExit 0
     2796            echo "$resk"
     2797            LogOnly "kernelpath = $resk"
     2798            MindiExit 0
    27102799        fi
    27112800    elif [ "$1" = "--locatedeps" ] ; then
     
    27652854        if [ $KERNEL_IS_XEN = "yes" ]; then
    27662855            LogAll "xenkernelpath = $xenkernelpath"
    2767             LogAll "xenkernelname = $xenkernelname"
    27682856        fi
    27692857        kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'`
  • branches/3.1/mindi/mindi-bkphw

    r2709 r2937  
    1111# Handling Configuration files
    1212my $tool = "";
    13 my $tooldir = "";
    1413my $ret = 0;
     14my $productname = undef;
    1515
    1616die "No CACHE_DIR parameter" if ((not defined $ARGV[0]) || (! -d $ARGV[0]));
     
    2424mkdir $bkpdir,0755 if (! -d $bkpdir) ;
    2525open(SYSTEM,"/usr/sbin/dmidecode -s 'system-product-name' 2> /dev/null |") || die "You need /usr/sbin/dmidecode for mindi hardware support";
    26 my $productname = <SYSTEM>;
     26while (<SYSTEM>) {
     27    next if (/^#/);
     28    $productname = $_;
     29    chomp($productname);
     30    }
    2731close(SYSTEM);
    2832
    29 die "ERROR: No product name found for Hardware support\n" if (not defined $productname);
     33die "WARNING: No product name found for Hardware support\n" if (not defined $productname);
    3034
    31 chomp($productname);
    3235if ($productname =~ /proliant/i) {
    3336    print "Detected a $productname. Nice. Continue to support my job :-)\n";
    34     print "Activating Proliant support for mindi\n";
    35     open(PROLIANT,"$confdir/proliant.files") || die "Unable to open $confdir/proliant.files";
     37    print "Activating ProLiant support for mindi\n";
     38    print "You can install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced ProLiant support\n";
     39    print "Get it from http://www.hp.com/servers/sstoolkit\n";
     40    print "And use the SDR to get all other HP ProLiant packages\n";
     41    print "Get it from http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/\n";
     42    open(PROLIANT,"$confdir/deplist.d/ProLiant.conf") || die "Unable to open $confdir/deplist.d/ProLiant.conf";
     43    # generate a list of what need to be put on the backup media
    3644    open(TOOLS,"> $bkpdir/../tools.files") || die "Unable to open $bkpdir/../tools.files";
     45    # generate a script that will be launched at rstore time to perform the HW setup
    3746    open(SCRIPT,"> $bkpdir/../mindi-rsthw") || die "Unable to open $bkpdir/../mindi-rsthw";
    3847    print SCRIPT  << 'EOF';
    3948#!/bin/bash
    4049#
     50# Script generated by mindi
     51#
    4152# This script will restore potentially your HW configuration
    42 # on your system before partioning occurs
     53# on your system before partioning occurs.
     54#
    4355# You may want to reboot after that step if you think that
    4456# resetting BIOS parameters to the value restored
    45 # may have an impact on you restoration process
     57# may have an impact on your restoration process or if
     58# you want to benefit from any firmware update that could have happened.
    4659#
    47 # put dynamic libraries at an accessible place
    48 for l in /usr/local/lib/*; do
    49     ln -sf $l /usr/lib
    50 done
    5160EOF
    5261    while($tool = <PROLIANT>) {
     62        my $hasfound = 0;
    5363        next if ($tool =~ /^#/);
    5464        chomp($tool);
    55         $tooldir = dirname($tool);
     65        # skip non-executable/exising binaries
    5666        if (! (-x $tool)) {
    57             print "You could install the SmartStart Scripting toolkit tool $tool\nto benefit from mindi's enhanced hardware support\n";
    58             print "Get it from http://www.hp.com/servers/sstoolkit\n";
    5967            next;
    6068        } else {
    61             print "Found $tool, activating enhanced HP Proliant support in mindi\n";
     69            print "Found $tool, activating enhanced HP ProLiant support in mindi\n";
    6270            print TOOLS "$tool\n";
    6371        }
    6472        if ($tool =~ /\/conrep$/) {
    65             $ret = system("cd $tooldir ; $tool -s -f$bkpdir/conrep.dat");
    66             print SCRIPT "(cd $tooldir ; $tool -l -f$locbkpdir/conrep.dat)\n";
     73            # From the package
     74            if (! -f "/opt/hp/hp-scripting-tools/etc/conrep.xml") {
     75                $ret = system("$tool -s -x /opt/hp/hp-scripting-tools/etc/conrep.xml -f$bkpdir/conrep.dat");
     76            # From the SSSTK
     77            } elsif (! -f "/usr/share/conrep/conrep.xml") {
     78                $ret = system("$tool -s -x /usr/share/conrep/conrep.xml -f$bkpdir/conrep.dat");
     79            } else {
     80                next;
     81            }
     82            print SCRIPT "$tool -l -f$locbkpdir/conrep.dat\n";
    6783            print TOOLS "$tool.xml\n";
    6884        }
    69         if ($tool =~ /\/.acuxebin$/) {
     85        if ($tool =~ /\/hpacuscripting$/) {
     86            $hasfound = 1;
    7087            my $dir=basename($tool);
    71             $ret = system("export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -c $bkpdir/cpqacuxe.dat");
    72             print SCRIPT "export ACUXE_BIN_INSTALLATION_DIR=$dir ; export IM_CFGFILE_PATH=$dir ; export ACUXE_LOCK_FILES_DIR=$dir/locks ; $tool -i $locbkpdir/cpqacuxe.dat\n";
    73             print TOOLS "$tooldir/bld\n";
    74         }
    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";
     88            # Just backup internal info for a DR
     89            $ret = system("$tool -c $bkpdir/hpacuscripting.dat -internal");
     90            # We could want to reset it before.
     91            print SCRIPT "# $tool -reset -i $locbkpdir/hpacusripting.dat\n";
     92            print SCRIPT "$tool -i $locbkpdir/hpacusripting.dat\n";
    8093        }
    8194        if ($tool =~ /\/hponcfg$/) {
    82             $ret = system("$tool -w $bkpdir/hponcfg.dat");
    83             print SCRIPT "$tool -r $locbkpdir/hponcfg.dat\n";
     95            $ret = system("$tool -a -w $bkpdir/hponcfg.dat");
     96            print SCRIPT "$tool -f $locbkpdir/hponcfg.dat\n";
    8497        }
    8598        if ($tool =~ /\.scexe$/) {
    86             print "Found $tool, that firmware will be applied at restore time on your HP Proliant\n";
    87             print SCRIPT "./$tool\n";
     99            print "Found $tool, that firmware will be applied at restore time on your HP ProLiant\n";
     100            print SCRIPT "./$tool -s\n";
     101        }
     102        # Kept for compatibility with older version of tools
     103        if (($tool =~ /\/hpacucli$/) && ($hasfound == 0)) {
     104            my $dir=basename($tool);
     105            $ret = system("$tool -c $bkpdir/hpacucli.dat");
     106            print SCRIPT "$tool -i $locbkpdir/hpacucli.dat\n";
    88107        }
    89108        if ($ret != 0) {
     
    96115} else {
    97116    print "\nWARNING: No Hardware support for $productname.\nNot a big issue, just less features and risks ;-)\n";
    98     print "You may ask your manufacturer to contribute to the mindi project\n";
     117    print "You may ask your manufacturer to contribute to the mindi project (harmless)\n";
    99118}
    100119rmdir $bkpdir if (-d $bkpdir) ;
  • branches/3.1/mindi/rootfs/etc/init.d/rcS

    r2893 r2937  
    131131    mt -f $tapedev rewind
    132132    mt -f $tapedev fsf 2
     133    # 32k is DEFAULT_INTERNAL_TAPE_BLOCK_SIZE
     134    mt -f $tapedev setblk 32768
    133135    dd if=$tapedev bs=32k count=1024 | tar -zx
    134136    res=$?
     
    651653
    652654EnableCcissIfAppropriate() {
    653     local i fname
    654     for i in 0 1 2 3 ; do
    655         fname="/proc/driver/cciss/cciss$i"
    656         if [ -e "$fname" ] ; then
    657             LogIt "Engaging $fname"
    658             echo "engage scsi" > $fname
    659             LogIt "...result=$?"
    660         fi
     655    local f
     656
     657    # In some cases, the OBDR tape remains in CD-ROM mode. This branch solves that issue (#498)
     658    if [ "`grep -i 'obdr ' /tmp/mondo-restore.cfg 2>/dev/null`" ] && [ -x /usr/bin/hpsa_obdr_mode ]; then
     659        for lun in `/usr/bin/hpsa_obdr_mode -m query /dev/cciss/* 2>&1 | grep "is an OBDR device" | cut -d' ' -f4`; do
     660            /usr/bin/hpsa_obdr_mode -m query -l $lun /dev/cciss/* 2>&1 | grep -q "is in CD-ROM mode"
     661            if [ $? -eq 0 ]; then
     662                # This tape/lun should be brought back in Sequential mode
     663                LogIt "Putting back tape $lun in Sequential mode..."
     664                /usr/bin/hpsa_obdr_mode -m tape -l $lun /dev/cciss/* 2>&1 > /dev/null
     665            fi
     666        done
     667    fi
     668
     669    # Now engage all Smart Array controllers to detect attached devices
     670    for f in /proc/driver/cciss/cciss* ; do
     671        LogIt "Engaging $f"
     672        echo "engage scsi" > $f
     673        LogIt "...result=$?"
    661674    done
    662675}
     
    743756done
    744757#/bin/update
     758mkdir /proc 2> /dev/null
    745759mount /proc/ /proc -v -t proc
    746760mkdir /sys 2> /dev/null
  • branches/3.1/mindi/rootfs/sbin/find-and-mount-cdrom

    r2816 r2937  
    3333        fi
    3434        LogIt "$device has a CD-ROM in it"
    35         umount /mnt/cdrom
     35        umount -d /mnt/cdrom
    3636        ln -sf $device /dev/cdrom
    3737        if [ "$?" -ne "0" ]; then
  • branches/3.1/mindi/rootfs/sbin/install-additional-tools

    r2594 r2937  
    44#
    55########################################################################
    6 
    7 
    8 Die() {
    9     echo "Fatal error! $1" >> /dev/stderr
    10     exit 1
    11 }
    12 
    136
    147
     
    6053    cd $old_pwd
    6154    echo -e -n "\r"
    62     [ ! -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && [ -e "$tarball" ] && umount $mountpoint
     55    [ ! -e "$MINDI_CACHE/CDROM-LIVES-HERE" ] && [ -e "$tarball" ] && umount -d $mountpoint
    6356    sleep 1
    6457fi
  • branches/3.1/mindi/rootfs/sbin/post-init

    r2591 r2937  
    2626else
    2727    if [ "$iso$nuke$compare$interactive$pxe" != "" ] ; then
    28         LogIt "FYI, this CD was made by Mindi, not Mondo." 1
     28        LogIt "The mondorestore command was not found on your backup media" 1
     29        LogIt "It may mean your device is not seen correctly." 1
     30        LogIt "Check driver list and error messages." 1
    2931        exit 0
    3032    else
  • branches/3.1/mindi/rootfs/sbin/start-netfs

    r2709 r2937  
    1010ipcount=3
    1111
    12 ipconf=""
    13 pre=""
    14 post=""
     12# Get info from config file
    1513ipdev=""
     14hwaddr=""
    1615ipaddress=""
    1716ipnetmask=""
     
    1918ipgateway=""
    2019proto=""
     20ipconf=""
     21pre=""
     22post=""
    2123netfsmount=""
    2224imgname=""
     
    2628if [ -f $MINDI_CACHE/mondorestore.cfg ]; then
    2729    ipdev=`grep netfs-dev $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     30    hwaddr=`grep netfs-client-hwaddr $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    2831    ipaddress=`grep netfs-client-ipaddr $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    2932    ipnetmask=`grep netfs-client-netmask $MINDI_CACHE/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     
    4649for i in `cat $CMDLINE` ; do
    4750    echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`
     51    echo $i | grep -qi hwaddr= && hwaddr=`echo $i | cut -d= -f2`
    4852    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`
    4953    echo $i | grep -qi netfsmount= && export netfsmount=`echo $i | cut -d= -f2`
     
    9397            ipgateway=`echo $ipconf | cut -d: -f5`
    9498        fi
     99
     100        # If same system, map to the right MAC address
     101        hwaddr_found=`ifconfig $ipdev | /bin/grep HWaddr | awk '{print $NF}'`
     102        if [ "$hwaddr" != "$hwaddr_found" ]; then
     103            ipdev_new=`ifconfig -a | /bin/grep $hwaddr | awk '{print $1}'`
     104            if [ "$ipdev_new" != "" ]; then
     105                LogIt "Interface $ipdev changed to $ipdev_new (MAC: $hwaddr)"
     106                ipdev=$ipdev_new
     107            else
     108                LogIt "NOTE: Interface $ipdev kept despite it doesn't match the $hwaddr MAC address"
     109            fi
     110        fi
     111
    95112        LogIt "Configuring $ipdev statically ($ipaddress/$ipnetmask)"
    96113        ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast
    97114        route add default gw $ipgateway
     115
    98116    fi
     117
     118    # Leave time to the satck to wake up (reported by some users)
     119    sleep 5
    99120
    100121    # ping server helps waking interface up
Note: See TracChangeset for help on using the changeset viewer.