Changeset 3357 in MondoRescue


Ignore:
Timestamp:
Mar 5, 2015, 9:54:31 PM (9 years ago)
Author:
Bruno Cornec
Message:
  • Fix mindi for RHEL5 support (as well as lots of older distros) by avoiding using option -n of cp not portable, creating a /bin subdir in case it's needed, creating a link for /sbin/init if needed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3353 r3357  
    7171USB_MODS="usb-storage usb_storage usb-ohci usb-uhci input hid hid_generic uhci_hcd uhci-hcd ehci-hcd ehci-pci ohci-hcd ohci_hcd ohci-pci xhci xhci-hcd usbkbd usbhid keybdev mousedev scsi_mod ff-memless ums_cypress ums-cypress cp210x usbserial"
    7272NET_MODS="nfs nfsv2 nfsv3 nfsv4 nfsd loop mii 3c59x e100 bcm5700 cnic be2net bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse netbk xenblktap r8169 virtio_net via_rhine ipv6 ptp"
    73 CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS cdrom isocd isofs sg sr_mod iso9660 nls_iso8859-1 vfat fat loop md-mod lvm-mod dm-mod dm_mod dm-multipath dm-emc dm-hp-sw dm-rdac dm-region-hash multipath jfs xfs btrfs reiserfs ext2 ext3 minix nfs nfsd ext4 ocfs2 configfs vxfs "
     73CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS cdrom isocd isofs sg sr_mod iso9660 nls_iso8859-1 vfat fat loop md-mod lvm-mod dm-mod dm_mod dm-multipath dm-emc dm-hp-sw dm-rdac dm-region-hash multipath jfs xfs btrfs reiserfs ext2 ext3 minix nfs nfsd ext4 ocfs2 configfs vxfs nls_utf8"
    7474# Replace with that line for HP OCMP e.g.
    7575#DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain"
     
    253253    fi
    254254
    255     #cp -a -n --parents -t $mappath $bigdir 2>> $MINDI_TMP/$$.log || LogAll "WARNING: AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
    256255    tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll "WARNING: AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
    257256    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
     
    23992398        fi
    24002399    fi
    2401     LogAll "TryToFindKernelPath found $output"
     2400    #LogAll "TryToFindKernelPath found $output"
    24022401    echo "$output"
    24032402}
     
    24412440        fi
    24422441    done
     2442
    24432443    LogFile "INFO: what is now in $mountpoint"
    24442444    ls -alR $mountpoint >> $LOGFILE
    24452445   
    24462446    # Check files before copying to discover configuration issues or McAfee preventing mindi reading these files
     2447    # copy from rootfs into mountpoint
    24472448    for f in $tgz_dir_fname/*; do
    24482449        if [ ! -r $f ]; then
    24492450            Die "ERROR: Unable to copy $f to the target dir. Check your installation or McAfee presence"
    24502451        else
    2451             cp -Rdf $f . 2>&1 >> $LOGFILE
     2452            cp -af $f . 2>&1 >> $LOGFILE
    24522453        fi
    24532454    done
     
    25122513    for f in `sort -u $MINDI_TMP/minimal.lis`; do
    25132514        if [ -e $f -a ! -d $f ] || [ -h $f ]; then
    2514             finallist="$finallist $f"
     2515            # Do not overwrite files already in destination (avoid using option -n of cp not portable)
     2516            if [ ! -e "$mountpoint/$f" ]; then
     2517                finallist="$finallist $f"
     2518            fi
    25152519        fi
    25162520    done
     2521    rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis
     2522
    25172523    #tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log
    2518     echo "cp -a -n --parents $finallist -t $mountpoint" 2>&1 >> $MINDI_TMP/$$.log
    2519     cp -a -n --parents $finallist -t $mountpoint 2>> $MINDI_TMP/$$.log || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log
     2524    echo "INFO: Copy the minimal env with cp -a --parents $finallist -t $mountpoint" 2>&1 >> $MINDI_TMP/$$.log
     2525    cp -a --parents $finallist -t $mountpoint 2>> $MINDI_TMP/$$.log || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log
     2526
     2527    # In case target /bin dir still doesn't exist, create it before using it
     2528    if [ ! -d $mountpoint/bin ]; then
     2529        mkdir -p $mountpoint/bin
     2530    fi
     2531
     2532    # For older distributions expecting /sbin/init provides it
     2533    if [ ! -e sbin/init ]; then
     2534        (cd sbin ; ln -sf ../usr/sbin/init .)
     2535    fi
    25202536
    25212537    # To improve support for distribution scripts, we now prefer to use bash as the std shell. Also fixes #600
    25222538    ln -sf /bin/bash bin/sh
    25232539    LogIt "INFO: Using bash as default shell"
    2524     rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis
    25252540
    25262541    # Avoids an issue on some distro (RHEL5)
     
    25812596            for f in `sort -u $MINDI_TMP/udev.lis`; do
    25822597                if [ -e $f -a ! -d $f ] || [ -h $f ]; then
    2583                     finallist="$finallist $f"
     2598                    # Do not overwrite files already in destination (avoid using option -n of cp not portable)
     2599                    if [ ! -e "$mountpoint/$f" ]; then
     2600                        finallist="$finallist $f"
     2601                    fi
    25842602                fi
    25852603            done
    25862604            #tar cf - -C / $lis `sort -u $MINDI_TMP/udev.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in udev.lis analysis" $MINDI_TMP/$$.log
    2587             echo "cp -a -n --parents $finallist -t $mountpoint/" 2>&1 >> $MINDI_TMP/$$.log
    2588             cp -a -n --parents $finallist -t $mountpoint/ 2>> $MINDI_TMP/$$.log  || LogIt "ERROR: Problem in udev.lis analysis" $MINDI_TMP/$$.log
     2605            echo "INFO: Copying udev related files with cp -a --parents $finallist -t $mountpoint/" 2>&1 >> $MINDI_TMP/$$.log
     2606            cp -a --parents $finallist -t $mountpoint/ 2>> $MINDI_TMP/$$.log  || LogIt "ERROR: Problem in udev.lis analysis" $MINDI_TMP/$$.log
    25892607            rm -f $MINDI_TMP/udev.lis
    25902608        else
Note: See TracChangeset for help on using the changeset viewer.