Changeset 2603 in MondoRescue


Ignore:
Timestamp:
Mar 22, 2010, 1:56:30 PM (14 years ago)
Author:
Bruno Cornec
Message:

r3757@localhost: bruno | 2010-03-17 15:05:13 +0100

  • Adds a new interface param between mondoarchive and mindi for backup-media-type which was missing
  • Improve again logging
  • Try to improve keymap support
  • Remove some remaining hard coded /proc/cmdline
  • Adds a cache for the find command for modules launched twice to make it quicker on my Atom netboot in a QEMU VM
  • Remove dependency at build time on mindi to only use MINDI_CONF env var
Location:
branches/2.2.10
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/mindi

    r2599 r2603  
    900900    outfile=$1
    901901    > $outfile
     902    [ "$BACKUP_MEDIA_TYPE" ]        && echo "backup-media-type $BACKUP_MEDIA_TYPE" >> $outfile
    902903    [ "$TAPESIZE" ]     && echo "media-size $TAPESIZE" >> $outfile
    903904    [ "$TAPEDEV" ]          && echo "media-dev $TAPEDEV" >> $outfile
     
    13771378    old_pwd=`pwd`
    13781379    cd $MINDI_TMP/iso
     1380    LogFile "-------------------"
     1381    LogFile "Content of the ISO:"
     1382    LogFile "-------------------"
     1383    ls -Rla >> $LOGFILE
     1384    LogFile "-------------------"
     1385
    13791386    if [ "$ARCH" != "ia64" ] ; then
    13801387        if [ _"$MONDO_SHARE" != _"" ]; then
     
    15101517    cat $MINDI_TMP/usb/syslinux.cfg |tee -a $LOGFILE
    15111518    LogAll "------------------------------------------"
     1519    LogFile "--------------------------"
     1520    LogFile "Content of the USB device:"
     1521    LogFile "--------------------------"
     1522    (cd $MINDI_TMP/usb ; ls -Rla) >> $LOGFILE
     1523    LogFile "--------------------------"
     1524
    15121525    umount $MINDI_TMP/usb
    15131526    if [ "$ARCH" != "ia64" ] ; then
     
    18081821        Die "You have $res files present in dependency list\nbut absent from filesystem."
    18091822    fi
    1810     FindAndAddUserKeyboardMappingFile
     1823    FindAndAddUserKeyboardMappingFile 
    18111824    mkdir -p $bigdir/tmp
    18121825    [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     
    21262139    # ln.lis will contain the list of files to link to existing files
    21272140    # rm.lis will contain the list of files to remove after the copies
     2141
     2142    # Get kbd conf from data disk preparation
     2143    echo $MINDI_CACHE/KEYMAP-LIVES-HERE >> $MINDI_TMP/cp.lis
    21282144    # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs
    21292145    if [ -h "/lib64" ]; then
     
    22512267        MakeMondoConfigFile $MINDI_CACHE/mondorestore.cfg
    22522268        echo $MINDI_CACHE/mondorestore.cfg >> $MINDI_TMP/cp.lis
     2269        LogFile "-----------------------------------"
     2270        LogFile "Content of mondorestore.cfg:       "
     2271        LogFile "-----------------------------------"
     2272        cat $MINDI_CACHE/mondorestore.cfg >> $LOGFILE
     2273        LogFile "-----------------------------------"
    22532274    fi
    22542275    echo proc >> $MINDI_TMP/mkdir.lis
     
    26612682        USE_GZIP="${19}"
    26622683        USE_LZMA="${20}"
     2684        BACKUP_MEDIA_TYPE="${21}"
    26632685        [ "$USE_COMP" = "" ] && USE_COMP=yes
    26642686        [ "$USE_GZIP" = "" ] && USE_GZIP=no
  • branches/2.2.10/mindi/rootfs/sbin/hack-cfg-if-necessary

    r2591 r2603  
    1717
    1818if [ -f $MINDI_CACHE/mondorestore.cfg ]; then
    19     if [ !  grep "backup-media-type iso" $MINDI_CACHE/mondorestore.cfg 2 > /dev/null] ; then
     19    grep -q "backup-media-type iso" $MINDI_CACHE/mondorestore.cfg 2> /dev/null
     20    if [ $? -ne 0 ] ; then
    2021        LogIt "Config file is fine, BTW."
    2122        exit 0
    2223    fi
    23 fi
    24 
    25 if [ -f $MINDI_CACHE/mondorestore.cfg ]; then
    2624    LogIt "Re-jigging mondorestore.cfg because you backed up to ISOs and then burned them to CDs" 1
    2725    sed -i 's/backup-media-type iso/backup-media-type cdr/' $MINDI_CACHE/mondorestore.cfg
  • branches/2.2.10/mindi/rootfs/sbin/init

    r2597 r2603  
    9191    openvt -l /bin/sh /sbin/wait-for-petris
    9292    openvt -l /usr/bin/tail -f $LOGFILE
     93    serial="/foo"
    9394    # By default first serial line is configured as tty
    9495    # Required to have a correct serial console support (MP on ia64 or VSP with iLO2 e.g.)
    95     for i in `cat /proc/cmdline` ; do
     96    for i in `cat $CMDLINE` ; do
    9697        echo $i | grep -qi serial= && serial=`echo $i | cut -d= -f2`
    9798    done
     
    376377
    377378StartLvms() {
    378     if [ "`grep -i nolvm /proc/cmdline`" ]; then
     379    if [ "`grep -i nolvm $CMDLINE`" ]; then
    379380        return;
    380381    fi
     
    497498    local raid_devices i
    498499
    499     if [ "`grep -i noraid /proc/cmdline`" ]; then
     500    if [ "`grep -i noraid $CMDLINE`" ]; then
    500501        return;
    501502    fi
     
    512513        done
    513514    elif which mdrun > /dev/null 2> /dev/null ; then
    514         if [ "`grep -i nomd /proc/cmdline`" ]; then
     515        if [ "`grep -i nomd $CMDLINE`" ]; then
    515516            return;
    516517        fi
     
    518519        mdrun
    519520    elif which mdadm > /dev/null 2> /dev/null ; then
    520         if [ "`grep -i nomd /proc/cmdline`" ]; then
     521        if [ "`grep -i nomd $CMDLINE`" ]; then
    521522            return;
    522523        fi
     
    636637ModprobeAllModules() {
    637638
    638     lismod=`find /lib/modules -name '*\.ko*' -o -name '*\.o*'`
     639    echo "Preparing to install modules..."
     640    # Create a cache first time
     641    if [ ! -f /tmp/lismod.txt ]; then
     642        find /lib/modules -name '*\.ko*' -o -name '*\.o*' > /tmp/lismod.txt
     643    fi
     644    lismod=`cat /tmp/lismod.txt`
    639645    # loading forced modules first
    640646    for m in $lismod; do
     
    650656        k=`basename $m | sed 's/\.ko.*$//'`
    651657        j=`basename $k | sed 's/\.o.*$//'`
     658        lsmod | grep -qE '^$j$'
     659        if [ $? -eq 0 ];then
     660            # Already loaded
     661            continue
     662        fi
    652663        echo "$DENY_MODS" | grep -q "$j "
    653664        if [ $? -eq 0 ]; then
     
    730741    export FORCE_MODS=" "
    731742fi
    732 if [ "`grep -i excludedevs /proc/cmdline`" ]; then
    733     export MINDI_EXCLUDE_DEVS="`cat /proc/cmdline | sed 's~.*excludedevs=\"\(.*\)\".*~\1~'` mondonone"
     743if [ "`grep -i excludedevs $CMDLINE`" ]; then
     744    export MINDI_EXCLUDE_DEVS="`cat $CMDLINE | sed 's~.*excludedevs=\"\(.*\)\".*~\1~'` mondonone"
    734745    for d in $MINDI_EXCLUDE_DEVS ; do
    735746        echo "Mountlist exclusion == $d"
  • branches/2.2.10/mondo/configure.in

    r2602 r2603  
    4949AC_DEFINE_UNQUOTED(MAX_NOOF_MEDIA, $max_noof_media, [Maximum number of media])
    5050AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])
     51
     52# We need to know where is mindi conf dir in order to add content to it
     53if [ "_$MINDI_CONF" != "_" ]; then
     54    export MINDI_CONF
     55else
     56    export MINDI_CONF=/usr/local/etc/mindi
     57fi
     58
    5159
    5260# ( which automake 2>/dev/null >/dev/null && ( automake --version 2>&1 | grep -q 1.5 || automake --version 2>&1 | grep -q 1.7 || AC_MSG_ERROR([Automake must be version 1.5 or 1.7, if you have it at all]) ) )
  • branches/2.2.10/mondo/deplist.d/Makefile.am

    r2602 r2603  
    1 mindiconfdir = `mindi --printvar MINDI_CONF`
    2 deplistdir = $(mindiconfdir)/deplist.d
     1conf=`if [ "_$(MINDI_CONF)" = "_" ]; then echo $(sysconfdir)/mindi; else echo $(MINDI_CONF); fi`
     2deplistdir = $(conf)/deplist.d
    33
    4 deplistdir_DATA = mondo.conf
     4deplist_DATA = mondo.conf
  • branches/2.2.10/mondo/src/common/libmondo-archive.c

    r2601 r2603  
    757757        fatal_error("Unknown backup_media_type");
    758758    }
    759     mr_free(value);
    760759
    761760    if ((bkpinfo->backup_media_type == usb) && (bkpinfo->media_device)) {
     
    808807            use_gzip_sz,        // parameter #19 (STRING)
    809808            use_lzma_sz,        // parameter #20 (STRING)
     809            value,              // parameter #21 (STRING)
    810810            MONDO_LOGFILE);
    811811
     812    mr_free(value);
    812813    mr_free(tmp2);
    813814    mr_free(tape_device);
  • branches/2.2.10/mondo/src/mondorestore/mondo-prep.c

    r2508 r2603  
    214214#endif
    215215
    216     tmp = call_program_and_get_last_line_of_output("cat /proc/cmdline");
     216    tmp = call_program_and_get_last_line_of_output("cat "CMDLINE);
    217217    if (strstr(tmp, "nolvm")) {
    218218        mr_free(tmp);
Note: See TracChangeset for help on using the changeset viewer.