Ignore:
Timestamp:
Dec 1, 2014, 11:35:39 PM (6 years ago)
Author:
Bruno Cornec
Message:
  • Backport most mindi modifications done in the 3.2 branch into 3.0 in order to have soon a 2.1.8 version which is probably Fedora 17+ compatible (all modifications up to 2014-10-16)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/mindi

    r3260 r3319  
    373373    local r res mapfile mappath included_item included_list keyfile mp locale
    374374    LogAll "INFO: Analyzing your keyboard's configuration."
    375     KEYDIR=/lib/kbd
     375    KEYDIR=/usr/lib/kbd
    376376    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd     # Slackware
    377377    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/lib/kbd
    378     [ ! -e "$KEYDIR" ] && KEYDIR=/lib/kbd
    379378    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share
    380379    [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole
    381380    [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup
     381    [ ! -e "$KEYDIR" ] && KEYDIR=/lib/kbd
    382382    if [ ! -e "$KEYDIR" ] ; then
    383383        LogAll "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time."
     
    387387        LogFile "INFO: Red Hat-style config detected."
    388388        keyfile=/etc/sysconfig/keyboard
     389    elif [ -e "/etc/vconsole.conf" ] ; then
     390        LogFile "INFO: New Fedora style config detected."
     391        keyfile=/etc/vconsole.conf
    389392    elif [ -e "/etc/rc.d/rc.keymap" ] ; then
    390393        LogFile "INFO: Slackware-style config detected."
     
    445448    locale=`grep -F KEYTABLE "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2 | sed 's/.map.gz$//'`
    446449    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    447     [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2`     # Gentoo & ArchLinux
     450    [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2`     # Gentoo, ArchLinux & New fedora
    448451    [ ! "$locale" ] && locale=`grep -E 'XkbLayout' "$keyfile" | grep -v '^#' | awk '{print $3}' | tr -d '"'`        #  Fedora 19
    449452    LogFile "INFO: locale=$locale"
     
    487490FindLdlinux32Binary() {
    488491    LDLINUXC32=/usr/lib/syslinux/ldlinux.c32
    489     [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib/syslinux/ldlinux.c32
    490492    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib64/syslinux/ldlinux.c32
    491493    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/syslinux/ldlinux.c32
    492494    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/lib/syslinux/ldlinux.c32
    493495    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/share/lib64/syslinux/ldlinux.c32
     496    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib/syslinux/modules/bios/ldlinux.c32
     497    [ ! -e "$LDLINUXC32" ] && LDLINUXC32=/usr/lib64/syslinux/modules/bios/ldlinux.c32
    494498    #[ ! -e "$LDLINUXC32" ] && LDLINUXC32=`find / -name ldlinux.c32 | grep -x "/.*/ldlinux.c32"`
    495499    if [ ! -e "$LDLINUXC32" ]; then
     
    504508FindMboot32Binary() {
    505509    MBOOTC32=/usr/lib/syslinux/mboot.c32
    506     [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib/syslinux/mboot.c32
    507510    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib64/syslinux/mboot.c32
    508511    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/syslinux/mboot.c32
    509512    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib/syslinux/mboot.c32
    510513    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/share/lib64/syslinux/mboot.c32
     514    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib/syslinux/modules/bios/mboot.c32
     515    [ ! -e "$MBOOTC32" ] && MBOOTC32=/usr/lib64/syslinux/modules/bios/mboot.c32
    511516    [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"`
    512517    [ ! -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"
     
    521526    [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib/syslinux/isolinux.bin
    522527    [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/share/lib64/syslinux/isolinux.bin
     528    [ ! -e "$ISOLINUX" ] && ISOLINUX=/usr/lib/ISOLINUX/isolinux.bin
    523529    [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"`
    524530    [ ! -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"
     
    729735    local lcMagicExt2fs="EXT2-fs: blocksize too small for device."
    730736    local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device."
    731     local lcMagicInitfs="<6>checking if image is initramfs...|[<]6[>]Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs"
     737    local lcMagicInitfs="<6>checking if image is initramfs...|[<]*6[>]*Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs"
    732738
    733739    # local variables
     
    17601766            if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
    17611767                echo -en "Press <enter> to continue.\n"
     1768                echo -en "$BOOT_MEDIA_MESSAGE"
    17621769            elif [ ! "$MINDI_TMP" ] ; then
    17631770                echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
     
    23852392        if [ "$?" -eq "0" ] ; then
    23862393            # Used by ia64
    2387             fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`
     2394            fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    23882395        else
    2389             fkern_ver=`strings $fname 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`
     2396            fkern_ver=`strings $fname 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    23902397        fi
    23912398        echo "$fkern_ver"
     
    25862593    # Copy of files mandatory for ssh to automate mount if sshfs is used
    25872594    mkdir $mountpoint/.ssh
    2588     cp -rp ~root/.ssh/* $mountpoint/.ssh 2> /dev/null
    2589     echo > $mountpoint/tmp/myssh << EOF
     2595    cp -a ~root/.ssh/* $mountpoint/.ssh 2> /dev/null
     2596    cat > $mountpoint/tmp/myssh << EOF
    25902597ssh -o StrictHostKeyChecking=no $*
    25912598EOF
     
    25932600
    25942601    # Copy of files mandatory for ld.so
    2595     cp -rp /etc/ld.so.c* $mountpoint/etc
     2602    cp -a /etc/ld.so.c* $mountpoint/etc
    25962603
    25972604    # Handle the case where busybox and mount are dynamically linked
     
    26022609    fi
    26032610
    2604     # Copy of files from the minimal env needed as per the deplist.d/minimal.conf file (which includes all busybox deps)
     2611    # Copy of files from the minimal env needed as per the deplist.d/minimal.conf & udev.conf file (which includes all busybox deps)
    26052612    rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis
    2606     for f in `grep -v " *#.*" $DEPLIST_DIR/minimal.conf | sort -u`; do
    2607         if [ -r $f ]; then
    2608             echo $f >> $MINDI_TMP/minimal.lis
    2609             LocateDeps $f >> $MINDI_TMP/minimal2.lis
     2613    for f in `cat $DEPLIST_DIR/minimal.conf $DEPLIST_DIR/udev.conf | grep -vE " *#.*|^#" | sort -u` ; do
     2614        if [ -d $f ]; then
     2615            for g in `find $f`; do
     2616                echo $g >> $MINDI_TMP/minimal.lis
     2617                LocateDeps $g  >> $MINDI_TMP/minimal2.lis
     2618            done
     2619        else
     2620            if [ -r $f ]; then
     2621                echo $f >> $MINDI_TMP/minimal.lis
     2622                LocateDeps $f >> $MINDI_TMP/minimal2.lis
     2623            fi
    26102624        fi
    26112625    done
     
    26402654        LogIt "INFO: udev device manager found"
    26412655        tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /etc/udev analysis" $MINDI_TMP/$$.log
    2642         # This avoids NIC remapping if on another machine at restore time on Debian at least
    2643         rm -f ./etc/udev/rules.d/z[0-9][0-9]_persistent-net.rules
    2644         # This avoids NIC remapping if on another machine at restore time on Ubuntu at least
    2645         rm -f ./etc/udev/rules.d/[0-9][0-9]-persistent-net.rules
     2656        # This avoids NIC remapping if on another machine at restore time on Debian/Ubuntu at least
     2657        rm -f ./etc/udev/rules.d/[z]*[0-9][0-9][-_]persistent-net.rules
    26462658        # Do not do it if it's a link (Ubuntu 64 bits #503)
    2647         if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [  ! -h "/lib64/udev" ]; then
     2659        if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ ! -h "/lib64/udev" ]; then
    26482660            tar cf - -C / /lib64/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib64/udev analysis" $MINDI_TMP/$$.log
    26492661        fi
     
    26532665        if [ -e "/lib/udev" ] && [ ! -h "/lib" ] && [  ! -h "/lib/udev" ]; then
    26542666            tar cf - -C / /lib/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /lib/udev analysis" $MINDI_TMP/$$.log
     2667        fi
     2668        if [ -e "/usr/lib/udev" ] && [ ! -h "/usr/lib" ] && [  ! -h "/usr/lib/udev" ]; then
     2669            tar cf - -C / /usr/lib/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /usr/lib/udev analysis" $MINDI_TMP/$$.log
    26552670        fi
    26562671        if [ -x /sbin/udevd ] || [ -x /usr/bin/udevd ] || [ -x /usr/lib/systemd/systemd-udevd ]; then
     
    26642679                    while [ -h $j ]; do
    26652680                        lis="$lis $j"
    2666                         j=`readlink $j`
     2681                        j=`readlink -f $j`
    26672682                    done
    26682683                    lis="$lis $j"
     
    26782693                    [ "$j" != "" ] && rm -f $j
    26792694                fi
     2695                echo "$i" >> $MINDI_TMP/udev.lis
    26802696            done
    26812697            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
     
    27762792    # Copy FW in case some drivers needs it
    27772793    for d in "/lib" "/usr/lib"; do
    2778         if [ -d "$d/firmware" ]; then
     2794        if [ -d "$d/firmware" -a ! -h $d ]; then
    27792795            cp -a "$d/firmware" "$mountpoint/$d"
    27802796        fi
     
    27832799    # Copy multipath dynamic libraries in case multipath is used (RHEL 6.4 and later)
    27842800    for d in "/lib" "/usr/lib" "/lib64" "/usr/lib64"; do
    2785         if [ -d "$d/multipath" ]; then
     2801        if [ -d "$d/multipath" -a ! -h $d ]; then
    27862802            cp -a "$d/multipath" "$mountpoint/$d"
    27872803        fi
Note: See TracChangeset for help on using the changeset viewer.