Changeset 735 in MondoRescue


Ignore:
Timestamp:
Aug 3, 2006, 12:30:23 PM (18 years ago)
Author:
Bruno Cornec
Message:

Attempt to fix for Bug #8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r718 r735  
    230230    [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)"
    231231    if [ -e "$bigdir/$mappath" ] ; then
    232     echo "$mappath already added" >> $LOGFILE
    233     return
     232        echo "$mappath already added" >> $LOGFILE
     233        return
    234234    elif [ -d "$bigdir/$mappath" ] ; then
    235235        echo "Cannot add $mappath: it's a directory. Sorry."
     
    244244        fi
    245245    else
    246     echo -en "`basename $mappath | tr '.' '#' | sed s/#kmap#gz// | sed s/#inc#gz//` " | tr '#' '.'
     246        echo -en "`basename $mappath | tr '.' '#' | sed s/#kmap#gz// | sed s/#inc#gz//` " | tr '#' '.'
    247247    fi
    248248
     
    555555    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share
    556556    if [ ! -e "$KEYDIR" ] ; then
    557     LogIt "Keyboard mapping directory not found. I shall use default map at boot-time.\n"
    558     return 0
     557        LogIt "Keyboard mapping directory not found. I shall use default map at boot-time.\n"
     558        return 0
    559559    fi
    560560    if [ -e "/etc/sysconfig/keyboard" ] ; then
    561     echo "Red Hat-style config detected." >> $LOGFILE
    562     keyfile=/etc/sysconfig/keyboard
     561        echo "Red Hat-style config detected." >> $LOGFILE
     562        keyfile=/etc/sysconfig/keyboard
    563563    elif [ -e "/etc/rc.d/rc.keymap" ] ; then
    564     echo "Slackware-style config detected." >> $LOGFILE
    565     keyfile=/etc/rc.d/rc.keymap
     564        echo "Slackware-style config detected." >> $LOGFILE
     565        keyfile=/etc/rc.d/rc.keymap
    566566    elif [ -e "/etc/rc.config" ] ; then
    567567        echo "Debian-style config detected." >> $LOGFILE
    568     keyfile=/etc/rc.config
     568        keyfile=/etc/rc.config
    569569    elif [ -e "/etc/console/boottime.kmap.gz" ] ; then
    570570        echo "Debian-style config detected." >> $LOGFILE
    571     echo -en "Adding the following keyboard mapping tables: "
    572     mkdir -p $bigdir/tmp
    573     echo "/etc/console/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE
    574     KBDEPTH=0
    575     mkdir -p $bigdir/etc/console
    576     cp /etc/console/boottime.kmap.gz $bigdir/etc/console
    577     echo -e "$DONE"
    578     return 0
    579     else
    580     echo -en "Searching for rc.config ..."
    581     keyfile=`find /etc -name rc.config | head -n1`
    582     if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then
    583         LogIt "Unknown config detected. Default keyboard map will be used.\n"
    584         return
    585     else
    586         echo "Found $keyfile" >> $LOGFILE
    587     fi
     571        echo -en "Adding the following keyboard mapping tables: "
     572        mkdir -p $bigdir/tmp
     573        echo "/etc/console/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE
     574        KBDEPTH=0
     575        mkdir -p $bigdir/etc/console
     576        cp /etc/console/boottime.kmap.gz $bigdir/etc/console
     577        echo -e "$DONE"
     578        return 0
     579    else
     580        echo -en "Searching for rc.config ..."
     581        keyfile=`find /etc -name rc.config | head -n1`
     582        if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then
     583            LogIt "Unknown config detected. Default keyboard map will be used.\n"
     584            return
     585        else
     586            echo "Found $keyfile" >> $LOGFILE
     587        fi
    588588    fi
    589589    if [ ! -e "$KEYDIR/keymaps" ] ; then
     
    595595    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    596596    echo "locale=$locale" >> $LOGFILE
    597     mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep -F "${locale}." | grep -vx " *#.*"`
     597    mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep -F "/${locale}." | grep -vx " *#.*"`
    598598    [ ! "$mp" ] && mp=`find $KEYDIR/keymaps | grep "i[3-8]86" | grep "$locale[^r][^/]" | grep -vx " *#.*"`
     599    # If we have multiple keymaps then log it !!
     600    echo "$mp" | grep -q " "
     601    if [ $? -eq 0 ]; then
     602        echo "WARNING: Multiple keymaps found: $mp" | tee -a $LOGFILE
     603        echo "The following one will be used" >> $LOGFILE
     604    fi
    599605    for i in $mp ; do
    600606        mappath=$i
     
    606612    echo "mappath = $mappath" >> $LOGFILE
    607613    if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then
    608     LogIt "Keyboard mapping file not found. Default keyboard map will be used.\n"
    609     return
     614        LogIt "Keyboard mapping file not found. Default keyboard map will be used.\n"
     615        return
    610616    fi
    611617    echo -en "Adding the following keyboard mapping tables: "
Note: See TracChangeset for help on using the changeset viewer.