Changeset 2293


Ignore:
Timestamp:
Jul 23, 2009, 1:53:09 AM (10 years ago)
Author:
bruno
Message:
  • Fix #160 and #346 by rewriting the message.txt file with more valid information gathered in mindi
Location:
branches/2.2.10/mindi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/mindi

    r2291 r2293  
    1515### Which arch are we on (useful for ia64 port)
    1616ARCH=`/bin/uname -m`
     17KERVERRUN=`/bin/uname -r`
     18# By default we use the running kernel as a reference
     19KERVER=$KERVERRUN
    1720
    1821ADDITIONAL_BOOT_PARAMS="devfs=nomount noresume selinux=0 barrier=off"
     
    719722
    720723HackPathsToFailsafe() {
    721     local incoming newpath kver stub i pwd
    722     kver=`uname -r`
     724    local incoming newpath stub i pwd
    723725    incoming=`ReadLine`
    724726    pwd=`pwd`
     
    772774### Sq-Modification ... Use kernelname for module search path if specified
    773775###
    774     # kern="`uname -r`"
    775776    if [ "${kernelname}" != "" -a "${kernelname}" != "FAILSAFE" ]
    776777    then
    777778        kern=${kernelname}
    778779    else
    779         kern="`uname -r`"
    780     fi
     780        kern="$KERVERRUN"
     781    fi
     782    export KERVER=$kern
    781783###
    782784### Sq-Mod End
     
    10641066            if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then
    10651067                    skip=""
    1066                     uname="`uname -r`"
     1068                    uname=$KERVERRUN
    10671069                    [ "`echo $uname | grep "2.4.[0-9]"`" != "" ] && skip=16
    10681070                    # 2.6.12 needs 16 (FC3)
     
    14901492
    14911493MakeMessageFile() {
    1492     iss="/dev/null"
    1493     [ -e /etc/issue ] && iss="/etc/issue"
    1494     [ -e /etc/issue.net ] && iss="/etc/issue.net"
    1495     if [ "`grep -Fi "debian" $iss 2> /dev/null`" ] ; then
    1496         sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s%DDDDD%"Debian GNU\/`uname -s` `cut -d ' ' -f 3 $iss` `hostname`"% | sed s/KKKKK/"Kernel `uname  -r` on a `uname -m`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/
    1497     else
    1498         sed s/ZZZZZ/$MINDI_VERSION/ $MINDI_LIB/msg-txt | sed s/YYYYY/"Mondo Rescue"/ | sed s/XXXXX/"a cousin of"/ | sed s/DDDDD/"`grep -i "linux" $iss | sed s~/~~ | head -n1 | tr -s ' ' ' '`"/ | sed s/KKKKK/"`grep -i "kernel" $iss | sed s~/~~ | head -n1 | tr -s ' ' ' '`"/ | sed s/TTTTT/"`LC_TIME=C date`"/ | sed s/' 'r' 'on' 'an' 'm/' '`uname -r`' 'on' 'an' '`uname -m`/ | sed s/%r/"`uname -r`"/ | sed s/%t/"`hostname`"/
    1499     fi
     1494   
     1495    if [ -x "/bin/lsb_release" ]; then
     1496        DESC=`/bin/lsb_release -d | cut -d: -f2 | sed "s/[ \t]*//"`
     1497    elif [ -x "/usr/bin/pbdistrocheck" ]; then
     1498        # For pb >= 0.9.8
     1499        DESC=`/usr/bin/pbdistrocheck -d`
     1500    else
     1501        iss="/dev/null"
     1502        [ -r /etc/issue.net ] && iss="/etc/issue.net"
     1503        [ -r /etc/issue ] && iss="/etc/issue"
     1504        DESC=`head -1 $iss`
     1505    fi
     1506    sed "s/ZZZZZ/$MINDI_VERSION/" $MINDI_LIB/msg-txt | sed "s/KKKKK/Kernel $KERVER/" | sed "s/AAAAA/on a $ARCH architecture/" | sed "s/TTTTT/`LC_TIME=C date`/" | sed "s/MMMMM/`hostname`/" | sed "s/DDDDD/$DESC/"
    15001507    if [ _"$MONDO_SHARE" != _"" ]; then
    15011508        if [ "$CDRECOVERY" != "yes" ] ; then
     
    20682075}
    20692076
    2070 
    2071 TryToFindKernelPath() {
    2072     local fname incoming res fkern_ver we_want_version possible_kernels noof_kernels kernelpath kdate duff_kernels
    2073 
    2074     we_want_version=`uname -r`
    2075     possible_kernels=""
    2076     duff_kernels=""
    2077    
    2078     if [ "$ARCH" = "ia64" ] ; then
    2079        root="/boot/efi/efi"
    2080     else
    2081        root="/"
    2082     fi
    2083     for fname in `find $root -maxdepth 2 -type f | grep -E 'lin|kern' | grep -Ev '^/proc/|^/net/'` ; do
    2084         [ ! -e "$fname" ] && continue
    2085         [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel
     2077KernelVer() {
     2078        local fkern_ver fname
     2079
     2080        fname=$1
    20862081        file $fname | grep -q gzip
    20872082        if [ "$?" -eq "0" ] ; then
     
    20912086            fkern_ver=`strings $fname 2> /dev/null | grep "[2-9]+*[.][0-9]+*[.][0-9]+*[^\@]*@"`
    20922087        fi
     2088        echo "$fkern_ver"
     2089}
     2090
     2091
     2092TryToFindKernelPath() {
     2093    local fname incoming res fkern_ver we_want_version possible_kernels noof_kernels kernelpath kdate duff_kernels
     2094
     2095    we_want_version=$KERVERRUN
     2096    possible_kernels=""
     2097    duff_kernels=""
     2098   
     2099    if [ "$ARCH" = "ia64" ] ; then
     2100       root="/boot/efi/efi"
     2101    else
     2102       root="/"
     2103    fi
     2104    for fname in `find $root -maxdepth 2 -type f | grep -E 'lin|kern' | grep -Ev '^/proc/|^/net/'` ; do
     2105        [ ! -e "$fname" ] && continue
     2106        [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel
     2107        fkern_ver=`KernelVer $fname`
    20932108        [ "$fkern_ver" = "" ] && continue
    20942109        [ "`echo "$fkern_ver" |grep -F "$we_want_version "`" = "" ] && continue
     
    21412156    elif [ "$noof_kernels" -eq "1" ] ; then
    21422157        kernelpath=`echo "$possible_kernels" | sed s/' '//`
    2143         echo "Your kernel is $kernelpath (v`uname -r`)" >> $LOGFILE
     2158        echo "Your kernel is $kernelpath (v$KERVERRUN)" >> $LOGFILE
    21442159        output="$kernelpath"
    21452160    else
    21462161        for i in $possible_kernels ; do
    2147             if echo $i | grep "`uname -r`" ; then
     2162            if echo $i | grep "$KERVERRUN" ; then
    21482163                LogIt "OK, I used my initiative and found that "
    21492164                LogIt "$i is probably your kernel. "
     
    23192334            needed_modules_path=lib/modules/${kernelname}
    23202335        else
    2321             needed_modules_path=lib/modules/`uname -r`
     2336            needed_modules_path=lib/modules/$KERVERRUN
    23222337        fi
    23232338    fi
     
    24932508[ ! -e "$FDISK" ] && Die "Cannot find $FDISK"
    24942509
    2495 [ "`uname -r | grep "2.4.[0-6]" | grep -v "2.4.[0-9][0-9]"`" != "" ] &&  echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7"
     2510[ "`echo $KERVERRUN | grep "2.4.[0-6]" | grep -v "2.4.[0-9][0-9]"`" != "" ] &&  echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7"
    24962511
    24972512# Update the PATH variable if incomplete
     
    27022717           LogIt "Module path for ${kernelpath} not found..."
    27032718           LogIt "using running kernel\'s modules."
    2704            kernelname=`uname -r`
     2719           kernelname=$KERVERRUN
    27052720        else
    27062721           LogIt "Using modules for kernel: ${kernelname}"
     
    27432758           LogIt "Module path for ${kernelpath} not found..."
    27442759           LogIt "using running kernel\'s modules."
    2745            kernelname=`uname -r`
     2760           kernelname=$KERVERRUN
    27462761        else
    27472762           LogIt "Using modules for kernel: ${kernelname}"
     
    27832798
    27842799# for Mandrake 9.2, which comes with two aes.o.gz modules :-/
    2785 insmod /lib/modules/`uname -r`/*/*/misc/aes.*o.gz >> $LOGFILE 2>> $LOGFILE
     2800insmod /lib/modules/$KERVERRUN/*/*/misc/aes.*o.gz >> $LOGFILE 2>> $LOGFILE
    27862801for i in loop cdrom ide-cd isofs linear raid0 raid1 raid5 ; do
    27872802    insmod $i >> $LOGFILE 2>> $LOGFILE
  • branches/2.2.10/mindi/msg-txt

    r30 r2293  
    1 Welcome to MINDI-LINUX vZZZZZ, XXXXX YYYYY
     1Welcome to Mindi vZZZZZ, a cousin of MondoRescue
    22
    33Creation date: TTTTT
    44These disks were generated on the following system:-
     5             MMMMM
    56             DDDDD
    67             KKKKK
     8             AAAAA
    79
Note: See TracChangeset for help on using the changeset viewer.