Changeset 3147 in MondoRescue for branches/3.1/mindi/mindi


Ignore:
Timestamp:
Jun 19, 2013, 8:34:46 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • First pass on svn merge -r 2935:3146 ../3.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mindi/mindi

    r2937 r3147  
    2121# In case of problem with udev you can try to add udevdebug
    2222MINDI_ADDITIONAL_BOOT_PARAMS="devfs=nomount noresume selinux=0 barrier=off udevtimeout=10"
     23MINDI_DEFAULT_BOOT_OPTION="interactive"
     24# For a CD Recovery use 10000 instead rather. Beware till Hardcoded below. Planned to be changed on the perl version
     25# So this parameter only applies to non CD recovery.
     26MINDI_BOOT_TIMEOUT="300"
    2327
    2428MINDI_REV=PBREV
     
    3539TMPDIR=/tmp
    3640
    37 EXTRA_SPACE=80152       # increase if you run out of ramdisk space
    38 BOOT_SIZE=36864         # size of the boot disk
     41EXTRA_SPACE=120000      # increase if you run out of ramdisk space
     42BOOT_SIZE=65600         # size of the boot disk
    3943
    4044PROMPT_MAKE_CD_IMAGE="yes"
     
    5862MY_FSTAB=/etc/fstab
    5963TAPE_MODS="ht st osst ide-tape ide_tape"
    60 SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc hpsa dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi iscsi_tcp libiscsi scsi_transport_iscsi libiscsi_tcp isp megaraid megaraid_mm megaraid_mbox megaraid_sas mega_sr mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcp dc395x diskdumplib scsi_dump_register arcmsr"
     64SCSI_MODS="3w-xxxx 3w_xxxx 3w_9xxx 3w-9xxx 53c7,8xx a100u2w a320raid aacraid adpahci advansys aha152x aha1542 aha1740 aic79xx aic79xx_mod aic7xxx aic7xxx_mod aic7xxx_old AM53C974 atp870u BusLogic cciss cpqfc hpsa dmx3191d dpt_i2o dtc eata eata_dma eata_pio fdomain gdth g_NCR5380 i2o_block i2o_core ide-scsi ieee1394 imm in2000 initio ips iscsi be2iscsi cxgb3i cxgb3 cxgb4i cxgb4 libcxgbi iscsi_boot_sysfs iscsi_target_mod iscsi_tcp libiscsi libiscsi2 scsi_transport_iscsi scsi_transport_iscsi2 libiscsi_tcp uio isp megaraid megaraid_mm megaraid_mbox megaraid_sas mega_sr mptbase mptscsih mptsas mptspi mptfc mptscsi mptctl NCR53c406a ncr53c8xx nsp32 pas16 pci2000 pci2220i pcmcia ppa psi240i qla1280 qla2200 qla2300 qla2400 qla2xxx qla2xxx_conf qlogicfas qlogicfc qlogicisp qlogicfas qlogicfas408 raw1394 scsi_mod scsi_transport_sas scsi_transport_spi scsi_transport_fc sd_mod crc_t10dif crc-t10dif seagate sg sim710 sr_mod sym53c416 sym53c8xx sym53c8xx_2 t128 tmscsim u14-34f ultrastor wd7000 vmhgfs intermodule scsi_dh scsi_tgt emcpdm emcpgpx emcpmpx emcp scsi_dh_emc scsi_dh_alua dc395x diskdumplib scsi_dump_register arcmsr"
    6165
    6266# ide-probe-mod
    63 IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide_cd_mod ide-cd_mod ide-cs ide-core ide_core ide-gd_mod ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci libahci sata_nv cmd64x pata_amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron pata_atiixp amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon"
     67IDE_MODS="ide ide-floppy floppy ide-generic ide-detect ide-mod ide-disk ide_disk ide-cd ide_cd ide_cd_mod ide-cd_mod ide-cs ide-core ide_core ide-gd_mod ide_gd_mod edd paride ata_generic ide_pci_generic ata_piix libata dock via82cxxx generic nvidia ahci libahci sata_nv cmd64x pata_via pata_amd pata_marvell pata_serverworks pata_sis pata_sil680 pata_jmicron pata_atiixp pata_acpi amd74xx sis5513 jmicron sata_promise sata_via serverworks sata_svw blkbk virtio virtio_ring virtio_pci virtio_blk virtio_balloon"
    6468PCMCIA_MODS="pcmcia_core ds yenta_socket"
    65 USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_storage input hid uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd xhci usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x usbserial"
    66 NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse libcrc32c crc32c netbk xenblktap r8169 virtio_net"
     69USB_MODS="usb-storage usb-ohci usb-uhci usbcore usb_common usb-common usb_storage input hid hid_generic uhci_hcd ehci_hcd uhci-hcd ehci-hcd ohci-hcd ohci_hcd xhci usbkbd usbhid keybdev mousedev libusual scsi_mod ff-memless ums_cypress ums-cypress cp210x usbserial"
     70NET_MODS="auth_rpcgss sunrpc nfs nfs_acl lockd fscache loop mii 3c59x e100 bcm5700 cnic be2net 8021q bnx2 bnx2x bnx2i mdio e1000 e1000e igb dca eepro100 ne2k-pci tg3 libphy pcnet32 8139cp 8139too 8390 forcedeth vmxnet vmxnet3 vmnet exportfs fuse crc32c libcrc32c netbk xenblktap r8169 virtio_net via_rhine garp"
    6771CDROM_MODS="$TAPE_MODS $IDE_MODS $USB_MODS $PCMCIA_MODS $SCSI_MODS $NET_MODS af_packet cdrom isocd isofs inflate_fs nls_iso8859-1 nls_base nls_cp437 nls_utf8 sg sr_mod zlib_inflate iso9660 vfat fat"
    6872# Those modules will only go on the backup media, not the boot media.
    69 EXTRA_MODS="$CDROM_MODS loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq async_pq xor async_tx async_memcpy async_xor lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac dm-region-hash dm-snapshot dm-log multipath jfs xfs xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs"
     73EXTRA_MODS="$CDROM_MODS loop md-mod linear raid0 raid1 xor raid10 raid5 raid456 raid6_pq async_pq xor async_tx async_memcpy async_xor lvm-mod dm-mod dm_mod dm-snapshot dm_snapshot dm-zero dm_zero dm-mirror dm_mirror dm-multipath dm-round-robin dm-emc dm-hp-sw dm-rdac dm-region-hash dm-snapshot dm-log multipath jfs xfs btrfs zlib_deflate xfs_support pagebuf reiserfs ext2 ext3 minix nfs nfs_acl nfsd lockd sunrpc jbd mbcache ext4 jbd2 crc16 ocfs2 ocfs2_dlm ocfs2_nodemanager configfs vxodm vxgms vxglm gab llt dmpaa vxspec vxio vxdmp vxportal fdd vxfs "
    7074# Replace with that line for HP OCMP e.g.
    7175#DENY_MODS="MPS_Driver_Mapper mps octtldrv tscttl streams kqemu fdomain"
    72 DENY_MODS="kqemu"
     76DENY_MODS="kqemu vxfen"
    7377# Force some modules to be included
    7478FORCE_MODS=""
     
    118122fi
    119123
     124
     125# Function to log on screen only
     126LogScreen() {
     127    if [ -e /dev/stderr ] ; then
     128        echo -e "$1" >> /dev/stderr
     129    elif [ -e /usr/bin/logger ] ; then
     130        /usr/bin/logger -s $1
     131    fi
     132}
     133
     134# Function to log in log file only
     135LogFile() {
     136
     137    echo -e "$1" >> $LOGFILE
     138    if [ _"$2" != _"" ]; then
     139        grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
     140    fi
     141    rm -f "$2"
     142}
     143
     144# Function to log in both screen and logfile
     145LogAll() {
     146    LogScreen "$1"
     147    LogFile "$1" "$2"
     148}
     149
     150# Preserved for compatibility
     151LogIt() {
     152    LogAll "$1" "$2"
     153}
     154
    120155# Last function called before exiting
    121156# Parameter is exit code value
     
    126161    if [ _"$MONDO_SHARE" != _"" ] ; then
    127162        echo "------------- mindi logfile included -------------------------" >> /var/log/mondoarchive.log
    128         cat $LOGFILE >> /var/log/mondoarchive.log
     163        if [ -f $LOGFILE ]; then
     164            cat $LOGFILE >> /var/log/mondoarchive.log
     165        else
     166            echo "No LOGFILE available in that mindi run"  >> /var/log/mondoarchive.log
     167        fi
    129168        echo "--------------------------------------------------------------">> /var/log/mondoarchive.log
    130169    fi
     
    139178    exit $1
    140179}
    141 
    142 LogOnly() {
    143     echo -e "$1" >> $LOGFILE
    144     if [ _"$2" != _"" ]; then
    145         grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
    146     fi
    147     rm -f "$2"
    148 }
    149 
    150 # Function to log on screen only
    151 LogScreen() {
    152     if [ -e /dev/stderr ] ; then
    153         echo -e "$1" >> /dev/stderr
    154     elif [ -e /usr/bin/logger ] ; then
    155         /usr/bin/logger -s $1
    156     fi
    157 }
    158 
    159 # Function to log in log file only
    160 LogFile() {
    161 
    162     echo -e "$1" >> $LOGFILE
    163     if [ _"$2" != _"" ]; then
    164         grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
    165     fi
    166     rm -f "$2"
    167 }
    168 
    169 # Function to log in both screen and logfile
    170 LogAll() {
    171     LogScreen "$1"
    172     LogFile "$1" "$2"
    173 }
    174 
    175 # Preserved for compatibility
    176 LogIt() {
    177     LogAll "$1" "$2"
    178 }
    179 
    180180
    181181Die() {
     
    239239    [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)"
    240240    if [ -e "$bigdir/$mappath" ] ; then
    241         LogFile "$mappath already added"
     241        LogFile "INFO: $mappath already added"
    242242        return
    243243    elif [ -d "$bigdir/$mappath" ] ; then
     
    245245        return
    246246    fi
    247     LogFile "Added kbd map $mappath"
     247    LogFile "INFO: Added kbd map $mappath"
    248248    if [ ! -e "$mappath" ] ; then
    249249        mappath=`grep "i[3-8]86" $MINDI_TMP/keymaps.find | grep "$locale[^r][^/]" | grep -vx " *#.*"`
    250250        if [ ! -e "$mappath" ] ; then
    251             LogAll "Cannot add $mappath: kbd map file not found"
     251            LogAll "WARNING: Cannot add $mappath: kbd map file not found"
    252252            return
    253253        fi
     254    else
     255        echo -en "`basename $mappath | tr '.' '#' | sed s/#kmap#gz// | sed s/#inc#gz//` " | tr '#' '.'
    254256    fi
    255257
     
    257259    mkdir -p $bigdir/etc
    258260    # TODO: why not use the cp.lis here ?
    259     tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
     261    tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll "WARNING: AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
    260262    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    261         included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     263        included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'//g | cut -d' ' -f2`
    262264    else
    263         included_list=`grep -Fi include $mappath | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     265        included_list=`grep -Fi include $mappath | sed s/'"'//g | cut -d' ' -f2`
    264266    fi
    265267    for included_item in $included_list ; do
     
    278280
    279281CopyDependenciesToDirectory() {
    280     local outdir incoming fname counter d found
     282    local outdir incoming counter d found tdir
    281283    outdir=$1
    282     noof_lines=$2
    283284    mkdir -p $outdir
    284285    incoming=`ReadLine`
    285     progress=0
     286    counter=0
    286287    while [ "$incoming" != "" ] ; do
    287288        # Non absolute file names should not arrive till here => skipped
    288289        if [ `echo "$incoming" | cut -c1` != '/' ]; then
    289             LogAll "Unable to handle $incoming"
     290            LogAll "WARNING: Unable to handle $incoming"
    290291            incoming=`ReadLine`
    291292            continue
     
    298299            d=`dirname "$d"`
    299300        done
    300         if [ -d "$incoming" ] && [ ! -h "$incoming" ]; then
     301        if [ -d "$incoming" ]; then
    301302            find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0
    302303        elif [ -e "$incoming" ] && [ $found = "false" ]; then
    303             tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log
    304 
     304            if [ ! -h "$incoming" ]; then
     305                tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log
     306            else
     307                tdir=`dirname "$incoming"`
     308                if [ ! -e "$outdir/$tdir" ]; then
     309                    mkdir -p "$outdir/$tdir"
     310                fi
     311                cp --no-dereference --preserve=all $incoming "$outdir/$tdir"
     312            fi
    305313            # Only uncompress modules if not using udevd
    306314            if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    307                 gunzip -f $outdir/$incoming || LogAll "Cannot gunzip $outdir/$incoming"
    308             fi
    309             [ -x "$outdir" ] && StripExecutable $outdir "-$filename-"
    310             progress=$(($progress+1))
    311             LogProgress $progress $noof_lines
     315                gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming"
     316            fi
     317            [ -x "$outdir" ] && StripExecutable $outdir
     318            counter=$(($counter+1))
     319            LogProgress $counter $2
    312320        fi
    313321        incoming=`ReadLine`
     
    326334
    327335
    328 
    329336DropOptimizedLibraries() {
    330     local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res progress
     337    local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res
    331338    filelist=$1
    332339    outdir=$2
    333340
    334     progress=0
    335341    list_of_optimized_libraries=`grep "lib/i[5-7]86/" $filelist`
    336342    if [ "$list_of_optimized_libraries" = "" ] ; then
    337343        return 0
    338     else
    339         noof_lines=`echo $list_of_optimized_libraries | tr ' ' '\n' | wc -l`
    340344    fi
    341345    echo -en "Dropping i686-optimized libraries if appropriate"
    342346    for optimized_lib_name in $list_of_optimized_libraries ; do
     347        echo -en "."
    343348        reason=""
    344349        vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
    345350        echo "$vanilla_lib_name" >> $filelist
    346         LogFile "Adding $vanilla_lib_name to filelist"
     351        LogFile "INFO: Adding $vanilla_lib_name to filelist"
    347352        mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null
    348353        rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null
     
    350355        # This may return multiple files
    351356        for resolved in `ReadAllLink $vanilla_lib_name`; do
    352             LogFile "Adding as deps $resolved to filelist"
     357            LogFile "INFO: Adding as deps $resolved to filelist"
    353358            vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
    354359            if [ "$vanilla_resolved_name" != "$resolved" ]; then
     
    356361                rmdir $outdir$resolved > /dev/null 2> /dev/null
    357362                ln -sf $vanilla_resolved_name $outdir$resolved
    358                 LogFile "Excluding deps $resolved"
     363                LogFile "INFO: Excluding deps $resolved"
    359364                grep -Fvx "$resolved" "$filelist" > $filelist.tmp
    360                 LogFile "Replacing it with $vanilla_resolved_name"
     365                LogFile "INFO: Replacing it with $vanilla_resolved_name"
    361366                echo "$vanilla_resolved_name" >> $filelist.tmp
    362367                mv -f $filelist.tmp $filelist
    363368            fi
    364369        done
    365         progress=$(($progress+1))
    366         LogProgress $progress $noof_lines
    367370    done
    368371    $AWK '{ print $1; }' $filelist | sort -u > $filelist.tmp
     
    374377FindAndAddUserKeyboardMappingFile() {
    375378    local r res mapfile mappath included_item included_list keyfile mp locale
    376     LogFile "Analyzing your keyboard's configuration."
     379    LogAll "INFO: Analyzing your keyboard's configuration."
    377380    KEYDIR=/lib/kbd
    378381    [ ! -e "$KEYDIR" ] && KEYDIR=/usr/share/kbd     # Slackware
     
    382385    [ ! -e "$KEYDIR" ] && KEYDIR=/etc/condole-setup
    383386    if [ ! -e "$KEYDIR" ] ; then
    384         LogAll "Keyboard mapping directory not found. I shall use default map at boot-time."
     387        LogAll "WARNING: Keyboard mapping directory not found. I shall use default map at boot-time."
    385388        return 0
    386389    fi
    387     LogFile "Adding the following keyboard mapping tables: "
    388390    if [ -e "/etc/sysconfig/keyboard" ] ; then
    389         LogFile "Red Hat-style config detected."
     391        LogFile "INFO: Red Hat-style config detected."
    390392        keyfile=/etc/sysconfig/keyboard
    391393    elif [ -e "/etc/rc.d/rc.keymap" ] ; then
    392         LogFile "Slackware-style config detected."
     394        LogFile "INFO: Slackware-style config detected."
    393395        keyfile=/etc/rc.d/rc.keymap
    394396    elif [ -e "/etc/rc.config" ] ; then
    395         LogFile "Debian-style config detected."
     397        LogFile "INFO: Debian-style config detected."
    396398        keyfile=/etc/rc.config
    397399    elif [ -e "/etc/console/boottime.kmap.gz" ] ; then
    398         LogFile "Debian-style config detected."
     400        LogFile "INFO: Debian-style config detected."
    399401        mkdir -p $bigdir/tmp
    400402        echo "/etc/console/boottime.kmap.gz" > $MINDI_CACHE/KEYMAP-LIVES-HERE
     
    406408        return 0
    407409    elif [ -e "/etc/console-setup/boottime.kmap.gz" ] || [ -e "/etc/console-setup/cached.kmap.gz" ] ; then
    408         LogFile "Ubuntu-style config detected."
     410        LogFile "INFO: Ubuntu-style config detected."
    409411        mkdir -p $bigdir/tmp
    410412        if [ -e "/etc/console-setup/boottime.kmap.gz" ] ; then
     
    421423        return 0
    422424    elif [ -e "/etc/rc.conf" ] ; then
    423         echo "ArchLinux config detected." >> $LOGFILE
     425        LogFile "INFO: ArchLinux config detected."
    424426        keyfile=/etc/rc.conf
    425427    elif [ -e "/etc/conf.d/keymaps" ] ; then
    426         LogFile "Gentoo-style config detected."
     428        LogFile "INFO: Gentoo-style config detected."
    427429        keyfile=/etc/conf.d/keymaps
    428430    else
    429         LogAll "Searching for rc.config ..."
     431        LogFile "Searching for rc.config ..."
    430432        keyfile=`find /etc -name rc.config | head -n1`
    431433        if [ "$keyfile" = "" ] || [ ! -e "$keyfile" ] ; then
    432             LogAll "Unknown config detected. Default keyboard map will be used."
     434            LogAll "WARNING: Unknown config detected. Default keyboard map will be used."
    433435            return
    434436        else
    435             LogFile "Found $keyfile"
     437            LogFile "INFO: Found $keyfile"
    436438        fi
    437439    fi
    438440    if [ ! -e "$KEYDIR/keymaps" ] ; then
    439         LogAll "Keyboard mapping directory not found. Default keyboard map will be used."
     441        LogAll "WARNING: Keyboard mapping directory not found. Default keyboard map will be used."
    440442        return
    441443    fi
    442     LogFile "keyfile=$keyfile"
    443     locale=`grep -F KEYTABLE "$keyfile" | tr -d '"' |cut -d'=' -f2`
     444    LogFile "INFO: keyfile=$keyfile"
     445    # For SLES we need to remove the .map.gz extension Cf #614
     446    locale=`grep -F KEYTABLE "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2 | sed 's/.map.gz$//'`
    444447    [ ! "$locale" ] && locale=`grep '.map$' "$keyfile" | sed 's/^.* //'`        # Slackware
    445     [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | tr -d '"' |cut -d'=' -f2`        # Gentoo & ArchLinux
    446     LogFile "locale=$locale"
     448    [ ! "$locale" ] && locale=`grep -E '^KEYMAP=' "$keyfile" | grep -v '^#' | tr -d '"' |cut -d'=' -f2`     # Gentoo & ArchLinux
     449    LogFile "INFO: locale=$locale"
    447450    #
    448451    # Process the keymaps dir once for all
     
    455458    echo "$mp" | grep -q " " >> $LOGFILE
    456459    if [ $? -eq 0 ]; then
    457         LogAll "WARNING: Multiple keymaps found: $mp" 
    458         LogFile "The following one will be used"
     460        LogAll "WARNING: Multiple keymaps found: $mp"
     461        LogFile "INFO: The following one will be used"
    459462    fi
    460463    for i in $mp ; do
     
    463466    done
    464467    if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then
    465             mappath=$(find / -name "*/kbd/keymaps/*/$locale")
    466     fi
    467     LogFile "mappath = $mappath"
     468        mappath=$(find / -wholename "*/kbd/keymaps/*/$locale | head -1")
     469    fi
     470    LogFile "INFO: mappath = $mappath"
    468471    if [ ! -e "$mappath" ] || [ -d "$mappath" ] ; then
    469         LogAll "Keyboard mapping file not found. Default keyboard map will be used."
     472        LogAll "WARNING: Keyboard mapping file not found. Default keyboard map will be used."
    470473        return
    471474    fi
     475    LogAll "INFO: Adding the following keyboard mapping tables: "
    472476    mkdir -p $bigdir/tmp
    473477    echo "$mappath" > $MINDI_CACHE/KEYMAP-LIVES-HERE
     
    490494    [ ! -e "$MBOOTC32" ] && MBOOTC32=`find / -name mboot.c32 | grep -x "/.*/mboot.c32"`
    491495    [ ! -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"
    492     LogFile "Found mboot.c32 at $MBOOTC32"
     496    LogFile "INFO: Found mboot.c32 at $MBOOTC32"
    493497}
    494498
     
    502506    [ ! -e "$ISOLINUX" ] && ISOLINUX=`find / -name isolinux.bin | grep -x "/.*/isolinux.bin"`
    503507    [ ! -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"
    504     LogFile "Found isolinux.bin at $ISOLINUX"
     508    LogFile "INFO: Found isolinux.bin at $ISOLINUX"
    505509}
    506510
     
    510514
    511515    if [ ! -e "$1" ] ; then
    512         LogAll "WARNING - cannot search specific path '$1'"
     516        LogAll "WARNING: cannot search specific path '$1'"
    513517        return 1
    514518    fi
    515519    # Find all files and links (required for some VMWare VMs)
    516     modpaths=`find "$1" -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2 -type f -o -type l`
     520    modpaths=`find "$1" -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2.ko.xz -o -name $2 -type f -o -type l`
    517521    echo "$modpaths"
    518522}
     
    541545        filelist=`GenerateListForFile "$incoming"`
    542546        r=$?
    543         [ "$r" -ne "0" ] && LogAll "$incoming not found"
     547        [ "$r" -ne "0" ] && LogAll "WARNING: $incoming not found"
    544548        res=$(($res+$r))
    545 #       LogFile "'$incoming' generates filelist '$filelist'"
     549#       LogFile "INFO: '$incoming' generates filelist '$filelist'"
    546550        for fname in $filelist ; do
    547551            [ "$fname" != "" ] && echo "$fname" >> $tempfile
     
    610614    progress=0
    611615    noof_lines=`cat $tempfile | wc -l`
    612     LogFile "---------------------------------" 
    613     LogFile "List of dependencies:             " 
    614     LogFile "---------------------------------" 
     616    LogFile "---------------------------------"
     617    LogFile "List of dependencies:             "
     618    LogFile "---------------------------------"
    615619    for fname in `cat $tempfile` ; do
    616620        echo "$fname" | tee -a $LOGFILE >> $outfile.pre
     
    624628        mkdir -p $bigdir/bin
    625629        if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then
    626             LogAll "\nIncorporating post-nuke tarball"
     630            LogAll "\nINFO: Incorporating post-nuke tarball"
    627631            old_pwd=`pwd`
    628632            cd "$bigdir"
    629             tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "Error occurred when untarring post-nuke tarball" $MINDI_TMP/$$.log
     633            tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "ERROR: when untarring post-nuke tarball" $MINDI_TMP/$$.log
    630634            cd "$old_pwd"
    631635        fi
    632         cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogAll "\nMondo v1.2x defaults to LILO as the bootloader, BTW."
     636        if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin 2>> $LOGFILE ; then
     637            LocateDeps $bigdir/usr/bin/mondo*restore >> $outfile.pre
     638        else
     639            LogIt "ERROR: Cannot find mondo*restore in mondo's tempdir, $MINDI_TMP"
     640            LogIt "       I bet you've got a spare copy of Mondo or Mindi floating around on your system."
     641            LogIt "       If Mindi was called by Mondo then send me a bug report."
     642            LogIt "       It not, type 'ps ax' to see which Mondo-related process is still running then kill it. :-)"
     643            LogIt "       Finally, run Mindi again."
     644            Die "Odd."
     645        fi
     646        cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nINFO: Mondo v1.2x defaults to LILO as the bootloader, BTW."
    633647        if [ -e "$MINDI_TMP/NETFS-DEV" ] ; then
    634             LogAll "\nIncorporating NFS-related settings"
    635             for r in NETFS-* ; do
     648            LogAll "\nINFO: Incorporating Network-related settings"
     649            for r in NETFS-* ISO-PREFIX ; do
    636650                cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?"
    637                 LogFile "Copying $r to ramdisk"
     651                LogFile "INFO: Copying $r to ramdisk"
    638652            done
    639653        fi
     
    693707    local lcMagicExt2fs="EXT2-fs: blocksize too small for device."
    694708    local lcMagicExt3fs="<3>EXT3-fs: blocksize too small for journal device."
    695     local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as
    696 initramfs"
     709    local lcMagicInitfs="<6>checking if image is initramfs...|<6>Unpacking initramfs...|<6>Trying to unpack rootfs image as initramfs"
    697710
    698711    # local variables
     
    702715
    703716    # say where we are.
    704     LogFile "  GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"
     717    LogFile "INFO: GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"
    705718
    706719    # verify that file exists
    707720    [ ! -f $lvKernelImage ] && Die "File $lvKernelImage not found. Terminating."
    708721
    709     # Kernel may be gzip compressed
     722    # Kernel may be gzip compressed - Case of RHEL5 - SLES11SP1
    710723    file $lvKernelImage 2>&1 | grep -q gzip
    711724    if [ $? -eq 0 ]; then
    712         lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"`
    713 
    714         # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs
    715         if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then
    716             lvUseFilesystem="ext2fs"
    717         elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then
    718             lvUseFilesystem="ext3fs"
    719         elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then
    720             lvUseFilesystem="initramfs"
    721         elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then
    722             lvUseFilesystem="cramfs"
     725        LogFile "INFO: Found a gzip compressed kernel $lvKernelImage"
     726        lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null`
     727    else
     728        LogFile "INFO: Found a non gzip compressed kernel $lvKernelImage"
     729        # kernel is x86 boot sector in RHEL3/4 with embedded gzip content
     730        # get offet of gzip magic "1f8b0800" in file (for these older kernels)
     731        lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}' 2> /dev/null`
     732        if [ $lvOffset -eq 0 ]; then
     733            LogFile "INFO: gzip magic not found in file $lvKernelImage. Supposing initramfs."
     734            lvScanRes=$lcMagicInitfs
    723735        else
    724             lvUseFilesystem="UNSUPPORTED"
    725         fi
    726 
     736            lvOffset=`expr $lvOffset / 2`
     737            LogFile "INFO: GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset."
     738            # scan again  kernel image
     739            lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null`
     740        fi
     741    fi
     742
     743    # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs
     744    if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then
     745        lvUseFilesystem="ext2fs"
     746    elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then
     747        lvUseFilesystem="ext3fs"
     748    elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then
     749        lvUseFilesystem="initramfs"
     750    elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then
     751        lvUseFilesystem="cramfs"
    727752    else
    728         # In that case, we are after 2.6.30 and use the supported initramfs
     753        # In that case, we are most probably after 2.6.30 and use the supported initramfs
     754        LogFile "No automatic detection found previously. Supposing initramfs."
     755        LogFile "Report on the MondoRescue mailing-list withyour log files"
    729756        lvUseFilesystem="initramfs"
    730757    fi
     758
    731759    # say what we are using
    732     LogFile "  GetInitrdFilesystemToUse(): Filesytem to use for initial ramdisk is $lvUseFilesystem."
     760    LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem."
    733761
    734762    # return file system to use
     
    804832        r=`find /lib/modules/$kern -type f | grep "/${module}\..*o" | tail -n1`
    805833        if [ -z "$r" ]; then
    806             echo "$MODULES" | grep -wq $module
    807             if [ $? -ne 0 ]; then
     834            if [ "`echo "$MODULES" | grep -w $module`" ]; then
    808835                r="[live module file not found]"
    809836            else
     
    813840            [ -f "$r" ] && echo "$r" >> $outfile
    814841        fi
    815         LogFile "module $module --> $r"
    816         [ -f "$r" ] && echo "$r" >> $outfile
     842        LogFile "INFO: module $module --> $r"
    817843        progress=$(($progress+1))
    818844        LogProgress $progress $noof_lines
     
    830856    for fname in $incoming ; do
    831857        if [ ! -e "$fname" ] ; then
    832             LogFile "WARNING - $fname does not exist; cannot be LDD'd."
     858            LogFile "WARNING: $fname does not exist; cannot be LDD'd."
    833859            if echo $fname | grep lvm &> /dev/null ; then
    834                 LogFile "This warning only affects you if you are using LVM."
     860                LogFile "          This warning only affects you if you are using LVM."
    835861                if echo "$MODULES" | grep lvm &> /dev/null ; then
    836                     LogFile "I think you are, so please take heed!"
     862                    LogFile "          I think you are, so please take heed!"
    837863                else
    838                     LogFile "I don't think you are, so don't worry about it."
     864                    LogFile "          I don't think you are, so don't worry about it."
    839865                fi
    840866            fi
    841867        elif [ -h "$fname" ] && [ -x "$fname" ] ; then
    842             LogFile "$fname is softlink"
     868            LogFile "INFO: $fname is softlink"
    843869        else
    844870            ldd $fname 2> /dev/null | ProcessLDD
     
    850876# Give all symlinks recursively of a full path name
    851877ReadAllLink() {
    852 
    853     incoming="$*"
    854 
    855     for file in $incoming ; do
    856         if [ ! -f $file ]; then
    857             continue
    858         fi
    859         echo "$file"
    860         if [ ! -h $file ]; then
    861             continue
    862         fi
    863    
    864         link=`readlink $file`
    865         d=`dirname $file`
    866         fchar=`echo $link | cut -c1`
    867         # If mother dir is a link print it
    868         if [ -h "$d" ]; then
    869             echo "$d"
    870             d=`readlink $d`
    871         fi
    872         if [ "$fchar" != "/" ]; then
    873             # Relative or local link
    874             ReadAllLink "$d/$link"
    875         else
    876             # Absolute path
    877             ReadAllLink $link
    878         fi
    879     done
     878    file="$1"
     879
     880    while [ `echo $file | grep -Ec '\.\./'` -ne 0 ]; do
     881        # We need to normalise the path with .. in it
     882        file=`echo $file | perl -pi -e 's|([^/]*)/([^/]+)/\.\./([^/]+)|$1/$3|g'`
     883    done
     884    echo "$file"
     885    if [ ! -h $file ]; then
     886        return 0
     887    fi
     888
     889    link=`readlink $file`
     890    d=`dirname $file`
     891    fchar=`echo $link | cut -c1`
     892    # If mother dir is a link print it
     893    if [ -h "$d" ]; then
     894        echo "$d"
     895        d=`readlink $d`
     896    fi
     897    if [ "$fchar" != "/" ]; then
     898        # Relative or local link
     899        ReadAllLink "$d/$link"
     900    else
     901        # Absolute path
     902        ReadAllLink $link
     903    fi
    880904}
    881905
     
    933957}
    934958
    935 # Function to log on screen only
    936 LogScreen() {
    937     if [ -e /dev/stderr ] ; then
    938         echo -e "$1" >> /dev/stderr
    939     elif [ -e /usr/bin/logger ] ; then
    940         /usr/bin/logger -s $1
    941     fi
    942 }
    943 
    944 # Function to log in log file only
    945 LogFile() {
    946 
    947     echo -e "$1" >> $LOGFILE
    948     if [ _"$2" != _"" ]; then
    949         grep -Ev "tar: Removing \`/\'" "$2" >> $LOGFILE
    950     fi
    951     rm -f "$2"
    952 }
    953 
    954 # Function to log in both screen and logfile
    955 LogAll() {
    956     LogScreen "$1"
    957     LogFile "$1" "$2"
    958 }
    959 
    960959# Called by TurnTgzIntoRdz, to make mondorestore.cfg
    961960MakeMondoConfigFile() {
     
    963962    outfile=$1
    964963    > $outfile
    965     [ "$BACKUP_MEDIA_TYPE" ]        && echo "backup-media-type $BACKUP_MEDIA_TYPE" >> $outfile
    966964    [ "$TAPESIZE" ]     && echo "media-size $TAPESIZE" >> $outfile
    967965    [ "$TAPEDEV" ]          && echo "media-dev $TAPEDEV" >> $outfile
     
    978976    echo "use-lzo $use_lzo" >> $outfile
    979977    echo "use-gzip $use_gzip" >> $outfile
     978    echo "use-star $use_star" >> $outfile
    980979    echo "use-lzma $use_lzma" >> $outfile
    981980    echo "use-comp $use_comp" >> $outfile
    982     echo "use-star $use_star" >> $outfile
    983981    echo "use-udev $use_udev" >> $outfile
    984982    echo "datestamp `date`" >> $outfile
    985983    [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile
     984    AddFileToCfgIfExists $MINDI_TMP/NETFS-DEV           netfs-dev           $outfile
     985    AddFileToCfgIfExists $MINDI_TMP/NETFS-PROTO         netfs-proto           $outfile
     986    AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-IPADDR netfs-client-ipaddr $outfile
     987    AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-NETMASK netfs-client-netmask $outfile
     988    AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-BROADCAST netfs-client-broadcast $outfile
     989    AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-HWADDR netfs-client-hwaddr $outfile
     990    AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-DEFGW  netfs-client-defgw  $outfile
    986991    AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-MOUNT  netfs-server-mount  $outfile
    987992    AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-USER  netfs-server-user  $outfile
    988993    AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-PATH   netfs-server-path   $outfile
    989994    AddFileToCfgIfExists $MINDI_TMP/NETFS-SERVER-IPADDR netfs-server-ipaddr $outfile
    990     AddFileToCfgIfExists $MINDI_TMP/NETFS-PROTO         netfs-proto           $outfile
    991     AddFileToCfgIfExists $MINDI_TMP/NETFS-DEV           netfs-dev           $outfile
    992     AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-IPADDR netfs-client-ipaddr $outfile
    993     AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-NETMASK netfs-client-netmask $outfile
    994     AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-BROADCAST netfs-client-broadcast $outfile
    995     AddFileToCfgIfExists $MINDI_TMP/NETFS-CLIENT-DEFGW  netfs-client-defgw  $outfile
    996995    AddFileToCfgIfExists $MINDI_TMP/ISO-DEV           iso-dev           $outfile
    997996    AddFileToCfgIfExists $MINDI_TMP/ISO-MNT           iso-mnt           $outfile
     
    1000999    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile
    10011000    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME   bootloader.name   $outfile
     1001    AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.VER    bootloader.ver   $outfile
     1002    AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile
    10021003    AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile
     1004    AddFileToCfgIfExists $MINDI_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile
     1005    AddFileToCfgIfExists $MINDI_TMP/DIFFERENTIAL      differential      $outfile
     1006    AddFileToCfgIfExists $MINDI_TMP/ACL      acl      $outfile
     1007    AddFileToCfgIfExists $MINDI_TMP/XATTR      xattr      $outfile
     1008    AddFileToCfgIfExists $MINDI_TMP/OBDR      obdr      $outfile
    10031009}
    10041010
     
    10211027absolute_partition old_partition_fmt current_lvolume uname skip
    10221028
    1023     LogFile "------------------------------------" 
    1024     LogFile "Your raw fstab file looks like this:" 
    1025     LogFile "------------------------------------" 
     1029    LogFile "------------------------------------"
     1030    LogFile "Your raw fstab file looks like this:"
     1031    LogFile "------------------------------------"
    10261032    cat $MY_FSTAB >> $LOGFILE
    1027     LogAll "-----------------------------------" 
    1028     LogAll "Your mountlist will look like this:" 
    1029     LogAll "-----------------------------------" 
     1033    LogAll "-----------------------------------"
     1034    LogAll "Your mountlist will look like this:"
     1035    LogAll "-----------------------------------"
    10301036
    10311037# mountlist(OUT)
     
    10421048   
    10431049    if [ $LVM != "false" ]; then
    1044         LogFile "Analyzing LVM..."
     1050        LogAll "INFO: Analyzing LVM..."
    10451051        $MINDI_DATA/analyze-my-lvm > $MINDI_TMP/lvm.res
    10461052        if [ $? -ne 0 ]; then
     
    10551061    done
    10561062    [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`"
    1057     printf "%-15s %-15s %-15s %s %s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE
    1058     printf "%-15s %-15s %-15s %s %s\n" ------ ---------- ------  -------  ---------- | tee -a $LOGFILE
     1063    printf "%-15s %-15s %-15s %-13s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE MB" LABEL/UUID | tee -a $LOGFILE
     1064    printf "%-15s %-15s %-15s %-13s %-15s\n" ------ ---------- ------  -------  ---------- | tee -a $LOGFILE
    10591065    useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1 tmpfs devpts sysfs proc debugfs"
    10601066    for c_p in $all_partitions ; do
     
    10641070        if [ -h "$c_p" ] && [ "`echo "$c_p" | grep -F "/dev/hd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/sd"`" = "" ] && [ "`echo "$c_p" | grep -F "/dev/md"`" = "" ] ; then
    10651071            current_partition=`readlink -f $c_p`
    1066             [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ] && current_partition="$c_p"
     1072            if [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ]; then
     1073                current_partition="$c_p"
     1074            elif [ "`echo $current_partition | grep -E '^/dev/dm-'`" ]; then
     1075                # For SLES 11 type of distro, do not use dm devices as they are unable to be handled by lvm commands
     1076                current_partition=`$MINDI_LIB/analyze-my-lvm --givevglvofdm $current_partition`
     1077            fi
    10671078            [ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue
    10681079        else
     
    10741085        uuid=""
    10751086        absolute_partition=`readlink -f $c_p`
    1076         partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    1077 
    1078         # Detects noauto partitions not mounted and exclude them
    1079         partition_option=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$current_partition" | /bin/grep -vx " *#.*" | $AWK '{print $4}' | head -n1`
    1080         if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" =  "" ] ; then
    1081             continue
    1082         fi
     1087        partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    10831088
    10841089        # set default in case we dont't find it
     
    10871092        # This part tries to retrieve the correct device from a LABEL line in /etc/fstab
    10881093        # current_partition contains only first column of /etc/fstab
    1089         if [ "`echo "$current_partition" | /bin/grep -i "LABEL="`" != "" ]; then
     1094        if [ "`echo "$current_partition" | grep -i "LABEL="`" != "" ]; then
    10901095            redhat_label=`echo "$current_partition" | cut -d'=' -f2`
    10911096            actual_dev=""
     
    10981103            # 2nd try : blkid, the good way for all LABEL except swap
    10991104            if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then
    1100                 actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | cut -d':' -f1`
     1105                actual_dev=`/sbin/blkid | grep "$redhat_label" | grep LABEL= | cut -d':' -f1`
    11011106                # For LVM FS it will give a /dev/dm-# which should then be converted
    11021107                if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then
     
    11171122            # For LVM gives a /dev/mapper entry
    11181123            if [ "x$actual_dev" = "x" ]; then
    1119                 actual_dev=`/bin/mount -l | /bin/grep "\[$redhat_label\]" | cut -d' ' -f1`
     1124                actual_dev=`/bin/mount -l | grep "\[$redhat_label\]" | cut -d' ' -f1`
    11201125            fi
    11211126   
     
    11231128            # SWAP only
    11241129            if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
    1125                 list_swaps=`cat /proc/swaps | /bin/grep "/dev/" | $AWK '{ print $1 }' `
     1130                list_swaps=`cat /proc/swaps | grep "/dev/" | $AWK '{ print $1 }' `
    11261131                for dev_swap in $list_swaps ; do
    1127                     dev_exists=`/sbin/vol_id $dev_swap | /bin/grep "$redhat_label"`
     1132                    dev_exists=`/sbin/vol_id $dev_swap | grep "$redhat_label"`
    11281133                    if [ "x$dev_exists" != "x" ]; then
    11291134                        actual_dev=$dev_swap
     
    11371142            # or could be a string that isn't a complete device name (eg. LABEL =SWAP-cciss/c0d0p)
    11381143            # SWAP only
    1139             if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | /bin/grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then
     1144            if [ "x$actual_dev" = "x" -a  _"`echo $current_partition | grep -iE 'LABEL=SWAP|LABEL=SW-'`" != _"" ]; then
    11401145                    skip=""
    11411146                    uname=$KERVERRUN
     
    11681173        # This part tries to retrieve the correct device from a UUID line in /etc/fstab
    11691174        # current_partition contains only first column of /etc/fstab
    1170         elif [ "`echo "$current_partition" | /bin/grep -i "UUID="`" != "" ]; then
     1175        elif [ "`echo "$current_partition" | grep -i "UUID="`" != "" ]; then
    11711176            uuid=`echo "$current_partition" | cut -d'=' -f2`
    11721177            actual_dev=""
     
    11791184            # 2nd try : blkid, the good way for all UUID except swap
    11801185            if [ "x$actual_dev" = "x" -a -x "/sbin/blkid" ]; then
    1181                 actual_dev=`/sbin/blkid | /bin/grep "$uuid" | grep UUID= | cut -d':' -f1`
     1186                actual_dev=`/sbin/blkid | grep "$uuid" | grep UUID= | cut -d':' -f1`
    11821187                # For LVM FS it will give a /dev/dm-# which should then be converted
    11831188                if [ $LVM = "v2" ] && [ "`echo $actual_dev | grep '/dev/dm'`" ]; then
     
    11971202            # 3th try, with vol_id
    11981203            if [ "x$actual_dev" = "x" -a -x "/sbin/vol_id" ]; then
    1199                 list_dev=`mount | /bin/grep -E '^/' | $AWK '{ print $1 }' `
     1204                list_dev=`mount | grep -E '^/' | $AWK '{ print $1 }' `
    12001205                for dev in $list_dev ; do
    1201                     dev_exists=`/sbin/vol_id $dev | /bin/grep "$uuid"`
     1206                    dev_exists=`/sbin/vol_id $dev | grep "$uuid"`
    12021207                    if [ "x$dev_exists" != "x" ]; then
    12031208                        actual_dev=$dev
     
    12091214            # 4th try, with dumpuuid (VMWare only ?) for swap
    12101215            if [ "x$actual_dev" = "x" -a -x "/sbin/dumpuuid" ]; then
    1211                 list_dev=`cat /proc/swaps | /bin/grep -E '^/' | $AWK '{ print $1 }' `
     1216                list_dev=`cat /proc/swaps | grep -E '^/' | $AWK '{ print $1 }' `
    12121217                for dev in $list_dev ; do
    1213                     dev_exists=`/sbin/dumpuuid $dev | /bin/grep "$uuid"`
     1218                    dev_exists=`/sbin/dumpuuid $dev | grep "$uuid"`
    12141219                    if [ "x$dev_exists" != "x" ]; then
    12151220                        actual_dev=$dev
     
    12301235            if [ _"$partition_mountpt" = _"" ]; then
    12311236                # set default in case we dont't find it
    1232                 for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -Ev "^#" | $AWK '{print $1}'`; do
    1233                         if [ _"`readlink -f $tmpp`" = _"$current_partition" ]; then
     1237                for tmpp in `tr -s '\t' ' ' < $MY_FSTAB | grep -Ev "^#" | $AWK '{print $1}'`; do
     1238                        if [ _"`readlink -f $tmpp`" = _"`readlink -f $current_partition`" ]; then
    12341239                            str_to_find_fmt_with=$tmpp
    1235                             partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | /bin/grep -w "$tmpp" | /bin/grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
     1240                            partition_mountpt=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$tmpp" | grep -vx " *#.*" | $AWK '{print $2}' | head -n1`
    12361241                            break;
    12371242                        fi
    12381243                done
    12391244            fi
     1245        fi
     1246
     1247        # Detects noauto partitions not mounted and exclude them
     1248        partition_option=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$str_to_find_fmt_with" | grep -vx " *#.*" | $AWK '{print $4}' | head -n1`
     1249        if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" =  "" ] ; then
     1250                LogFile "INFO: Excluding $current_partition from mountlist (due to noauto option in fstab)"
     1251            continue
     1252        fi
     1253        # Detects bind partitions and exclude them
     1254        if [ "`echo "$partition_option" | grep -iw bind`" != "" ]; then
     1255                LogFile "INFO: Excluding $current_partition from mountlist (due to bind option in fstab)"
     1256            continue
    12401257        fi
    12411258
     
    12571274            for d in `echo $MINDI_EXCLUDE_DEVS | sed 's/|/ /g'`; do
    12581275                if  [ "`echo " $list_of_devices " | grep " $d"`" != "" ]; then
    1259                     echo "Excluding $current_partition from mountlist (due to excluded device $d)" >> $LOGFILE
     1276                    LogFile "INFO: Excluding $current_partition from mountlist (due to excluded device $d)"
    12601277                    skip=1
    12611278                    continue
     
    12681285
    12691286        partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
     1287        # Detects iso9660 ISO images and exclude them
     1288        if [ "`echo "$partition_format" | grep -iw iso9660`" != "" ]; then
     1289                LogFile "INFO: Excluding $current_partition from mountlist (due to iso9660 format in fstab)"
     1290            continue
     1291        fi
    12701292        # Some distributions such as Debian do not put /dev/<VG>/<LV> in fstab
    12711293        # for LVM partitions but use /dev/mapper/<VG>-<LV> instead. Fortunately,
     
    12801302        # into any of the LVM tools if possible.
    12811303
    1282         current_lvolume="$current_partition"
     1304        current_lvolume="$current_partition"
    12831305        if [ $LVM = "v2" ] && [ "`echo $current_partition | grep -E '^/dev/mapper/'`" ]; then
    12841306            # .static dir are a Debian specificity
     
    12861308            echo $current_lvolume | grep -q ' '
    12871309            if [ $? -eq 0 ]; then
    1288                 LogFile "WARNING: Multiple Logical Volumes found. Report to dev team" 
     1310                LogFile "WARNING: Multiple Logical Volumes found. Report to dev team"
    12891311            fi
    12901312            # if it's not found, it may well be a real device such as a multipath one
     
    13011323            partition_size="lvm"
    13021324        else
    1303             partition_size=`SizeOfPartition $current_partition`
    13041325            [ "`echo "$current_partition" | grep "[0-9]"`" = "" ] && continue
    13051326            [ "`echo "$current_partition" | grep -c "^/"`" -ne "1" ] && continue
    13061327            if [ "$partition_format" = "swap" ] || [ "$partition_mountpt" = "swap" ] ; then
     1328                # Skip swap files
     1329                [ "`echo "$current_partition" | grep -E "^/dev"`" = "" ] && continue
    13071330                partition_size=`grep -Fv "Priority" /proc/swaps | tr -s '\t' ' ' | grep -F "$current_partition " | $AWK '{print $3}'`
    13081331                [ "$partition_mountpt" != "swap" ] && partition_mountpt="swap"
     
    13171340                    [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
    13181341                    [ "$partition_size" -lt "125000" ] && partition_size=125000
    1319                     LogFile "I'm guessing $c_p is $(($partition_size/1024))MB"
     1342                    LogFile "INFO: I'm guessing $c_p is $(($partition_size/1024))MB"
    13201343                fi
     1344            else
     1345                partition_size=`SizeOfPartition $current_partition`
    13211346            fi
    13221347        fi
     
    13351360        fi
    13361361        psz=$partition_size
    1337         LogFile "Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)"
     1362        LogFile "INFO: Examining $current_partition (mount=$partition_mountpt fmt=$partition_format psz=$psz)"
    13381363        [ "$psz" != "lvm" ] && psz=$(($psz/1024))
    13391364        if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then
     
    13431368            partition_size=$(($partition_size+1)); # just in case
    13441369            if [ "$partition_format" = "Linux" ] ; then
    1345                 LogFile "Are you imaging a mounted swap partition? Silly..."
    1346                 LogFile "Reverting format from $old_partition_fmt to $partition_format"
     1370                LogFile "WARNING: Are you imaging a mounted swap partition? Silly..."
     1371                LogFile "WARNING: Reverting format from $old_partition_fmt to $partition_format"
    13471372                partition_format=$old_partition_fmt
    13481373            fi
     
    13501375
    13511376        if [ ! "$partition_mountpt" ] ; then
    1352             LogFile "------- $FDISK -l $qq log ------------" 
     1377            LogFile "------- $FDISK -l $qq log ------------"
    13531378            for qq in "" `find /dev/ida/c*d* ! -name '*p*' 2> /dev/null`; do
    13541379                partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`
    13551380                [ "$partition_format" ] && break
    13561381            done
    1357             LogFile "------- $FDISK log end ------------" 
     1382            LogFile "------- $FDISK log end ------------"
    13581383            if [ "$partition_format" = "Compaq diagnostics" ] ; then
    13591384                partition_format="compaq"
    13601385            elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    1361                 LogAll "Unable to find mountpoint of $current_partition - ignoring"
     1386                LogAll "WARNING: Unable to find mountpoint of $current_partition - ignoring"
    13621387                continue
    13631388            fi
     
    13721397        unofficial_outstring=`printf "%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"`
    13731398        if [ "$current_partition" = "" ] ; then
    1374             LogFile "Unknown partition (outstring = $unofficial_outstring)"
     1399            LogFile "WARNING: Unknown partition (outstring = $unofficial_outstring)"
    13751400        elif [ "$partition_mountpt" = "" ] && [ -f "/etc/raidtab" ] ; then
    13761401            if [ "`grep -F device /etc/raidtab 2>/dev/null | grep -F $current_partition`" ] ; then
     
    13801405                printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist
    13811406            else
    1382                 LogFile "Unknown mountpoint (outstring = $unofficial_outstring)"
     1407                LogFile "WARNING: Unknown mountpoint (outstring = $unofficial_outstring)"
    13831408            fi
    13841409        elif [ "$partition_format" = "" ] ; then
    1385             LogFile "Unknown format (outstring = $unofficial_outstring)"
     1410            LogFile "WARNING: Unknown format (outstring = $unofficial_outstring)"
    13861411        elif [ "$partition_size" = "" ] ; then
    1387             LogFile "Unknown partition size (outstring = $unofficial_outstring)"
     1412            LogFile "WARNING: Unknown partition size (outstring = $unofficial_outstring)"
    13881413        elif [ "$partition_mountpt" = "/proc" ] || [ "$partition_mountpt" = "/dev/pts" ] ; then
    13891414            continue
    13901415        else
    13911416            if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then
    1392                 LogFile "vfat should be used instead of dos/msdos as a partition format"
     1417                LogFile "WARNING: vfat should be used instead of dos/msdos as a partition format"
    13931418                partition_format="vfat"
    13941419            fi
     
    14041429    # Coherency verification
    14051430    ML01=`cat $file | wc -l`
    1406     ML02=`grep -v ' lvm ' $file | wc -l`
     1431    ML02=`grep -vE ' lvm | raid | swap ' $file | wc -l`
    14071432    ML1=`$AWK '{print $1}' $file | sort -u | wc -l`
    1408     ML2=`grep -v ' lvm ' $file | $AWK '{print $2}' | sort -u | wc -l`
     1433    ML2=`grep -vE ' lvm | raid | swap ' $file | $AWK '{print $2}' | sort -u | wc -l`
    14091434    if [ "$ML01" -ne "$ML1" ]; then
    14101435        LogFile "--------------------------------------------"
    1411         echo "WARNING: Duplicate device entry in mountlist" | tee -a $LOGFILE
     1436        LogAll "WARNING: Duplicate device entry in mountlist"
    14121437        LogFile "--------------------------------------------"
    14131438    fi
    14141439    if [ "$ML02" -ne "$ML2" ]; then
    14151440        LogFile "--------------------------------------------"
    1416         echo "WARNING: Duplicate mountpoint entry in mountlist" | tee -a $LOGFILE
     1441        LogAll "WARNING: Duplicate mountpoint entry in mountlist"
    14171442        LogFile "------------------------------------------------"
    14181443    fi
     
    14221447    local i old_pwd
    14231448    if [ -z "$ISO_CMD" ]; then
    1424         LogFile "Neither mkisofs nor genisoimage found, unable to make CD image"
     1449        LogAll "ERROR: Neither mkisofs nor genisoimage found, unable to make CD image"
    14251450        return
    14261451    fi
     
    14321457    rm -Rf $MINDI_TMP/iso
    14331458    mkdir -p $MINDI_TMP/iso/{images,archives}
    1434     cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogAll "OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"
    1435     LogFile "mindi_lib = $MINDI_DATA"
     1459    LogFile "INFO: mindi_lib = $MINDI_DATA"
     1460    cp -f $MINDI_CACHE/{*.gz,*.img} $MINDI_TMP/iso/images 2>> $LOGFILE || LogAll "WARNING: OfferToMakeBootableISO: Cannot copy $MINDI_CACHE/*.gz to $MINDI_TMP/iso/images"
    14361461    for i in memdisk memtest.bin memtest.img ; do
    14371462        j=$MINDI_DATA/$i
    14381463        k=$MINDI_TMP/iso
    14391464        if [ -e "$j" ] ; then
    1440             LogAll "Copying $j to $k"
     1465            LogAll "INFO: Copying $j to $k"
    14411466            cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k"
    14421467            cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP"
     
    14461471        fi
    14471472    done
    1448     MakeMessageFile > $MINDI_TMP/iso/message.txt
     1473    MakeMessageFile | cut -c1-80 > $MINDI_TMP/iso/message.txt
    14491474    if [ $KERNEL_IS_XEN = "yes" ]; then
    14501475        cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?"
     
    14871512    fi
    14881513    if [ "$?" -ne "0" ] ; then
    1489         LogFile "----------- $ISO_CMD's errors --------------"
    1490         cat $MINDI_TMP/mkisofs.log >> $LOGFILE
    1491         echo "$ISO_CMD returned the following errors:-"
    1492         cat $MINDI_TMP/mkisofs.log
    1493         LogAll "Failed to create ISO image."
     1514        LogFile "----------- $ISO_CMD's errors --------------"
     1515        LogAll "$ISO_CMD returned the following errors:"
     1516        cat $MINDI_TMP/mkisofs.log | tee -a $LOGFILE
     1517        LogAll "ERROR: Failed to create ISO image."
    14941518    else
    1495         LogAll "Created bootable ISO image at $MINDI_CACHE/mindi.iso"
     1519        LogAll "INFO: Created bootable ISO image at $MINDI_CACHE/mindi.iso"
    14961520    fi
    14971521    rm -f $MINDI_TMP/mkisofs.log
     
    15221546    echo -en "Transforming $USBDEVICE in a Bootable device "
    15231547    echo -en "."
    1524     LogFile "Transforming $USBDEVICE in a Bootable device" 
    1525     LogFile "Checking $USBDEVICE"
     1548    LogFile "INFO: Transforming $USBDEVICE in a Bootable device"
     1549    LogFile "INFO: Checking $USBDEVICE"
    15261550    $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE
    15271551    if [ $? -ne 0 ]; then
    1528         LogAll "Unable to access $USBDEVICE"
    1529         LogAll "Make sure your USB device is pluged in"
    1530         exit -1
     1552        LogAll "ERROR: Unable to access $USBDEVICE"
     1553        LogAll "       Make sure your USB device is plugged in"
     1554        MindiExit -1
    15311555    fi
    15321556    echo -en "."
    15331557    # Some distro do auto mount at that point (Ubuntu)
    1534     LogFile "Unmounting $USBPART just in case"
     1558    LogFile "INFO: Unmounting $USBPART just in case"
    15351559    umount $USBPART 2>> $LOGFILE 1>> $LOGFILE
    15361560    # If your key has no MBR it may cause an issue
    15371561    # Use dd if=mbr.bin of=$USBDEVICE or ms-sys -s $USBDEVICE
    15381562    if [ -r $MBRFILE ]; then
    1539         LogFile "Installing an MBR ($MBRFILE) on $USBDEVICE"
     1563        LogAll "INFO: Installing an MBR ($MBRFILE) on $USBDEVICE"
    15401564        dd if=$MBRFILE of=$USBDEVICE
    15411565    else
    1542         LogFile "You may need to install an MBR (usually in $MBRFILE, but not found on your system) "
    1543         LogFile "on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE"
    1544     fi
    1545     LogFile "Preparing $USBDEVICE"
     1566        LogAll "WARNING: You may need to install an MBR (usually in $MBRFILE, but not found on your system)"
     1567        LogAll "         on $USBDEVICE with dd if=$MBRFILE of=$USBDEVICE"
     1568    fi
     1569    LogFile "INFO: Preparing $USBDEVICE"
    15461570    cat > $MINDI_TMP/fdisk.txt << EOF
    15471571d
     
    15621586    $FDISK $USBDEVICE 2>> $LOGFILE 1>> $LOGFILE < $MINDI_TMP/fdisk.txt
    15631587    if [ $? -ne 0 ]; then
    1564         LogAll "Unable to create a vfat Filesystem on $USBDEVICE"
    1565         LogAll "Make sure your USB device is pluged in"
     1588        LogAll "ERROR: Unable to create a vfat Filesystem on $USBDEVICE"
     1589        LogAll "       Make sure your USB device is plugged in"
    15661590        $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    15671591        MindiExit -1
     
    15721596    LogFile "----------------"
    15731597    rm -f $MINDI_TMP/fdisk.txt
    1574     LogFile "The USB device $USBDEVICE now looks like this:"
     1598    LogFile "INFO: The USB device $USBDEVICE now looks like this:"
    15751599    $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    15761600    echo -en "."
     1601    # Calling kpartx in case devices were not created
     1602    if [ -x "/sbin/kpartx" ]; then
     1603        /sbin/kpartx -a $USBDEVICE
     1604    fi
    15771605    # Some distro do auto mount at that point (Ubuntu)
    1578     LogFile "Unmounting $USBPART just in case again"
     1606    LogFile "INFO: Unmounting $USBPART just in case again"
    15791607    umount $USBPART 2>> $LOGFILE 1>> $LOGFILE
    15801608    echo -en "."
    1581     LogFile "Creating a vfat filesystem on $USBPART"
     1609    # Some distro have a dmsetup conf at that point so removing it Cf: http://trac.mondorescue.org/ticket/651
     1610    if [ "`which dmsetup`" != "" ]; then
     1611        block_id="`echo $USBPART | sed 's|/dev/||g'`"
     1612        if [[ "`dmsetup ls | awk '{print $1}' | grep $block_id`" != "" ]]; then
     1613            LogFile "INFO: Removing $block_id from device mapper."
     1614            sleep 1
     1615            dmsetup remove $block_id
     1616        fi
     1617    fi
     1618    echo -en "."
     1619    LogFile "INFO: Creating a vfat filesystem on $USBPART"
    15821620    mkdosfs -F 32 $USBPART 2>&1 >> $LOGFILE
    15831621    if [ $? -ne 0 ]; then
    1584         LogAll "Unable to create a vfat filesystem on $USBPART"
    1585         LogAll "Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)"
     1622        LogAll "ERROR: Unable to create a vfat filesystem on $USBPART"
     1623        LogAll "       Make sure your USB device is plugged in and partitioned ($USBPART must exist on it)"
    15861624        $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    15871625        MindiExit -1
    15881626    fi
    15891627    echo -en "."
    1590     LogFile "Mounting $USBPART on $MINDI_TMP/usb"
     1628    LogFile "INFO: Mounting $USBPART on $MINDI_TMP/usb"
    15911629    mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE
    15921630    if [ $? -ne 0 ]; then
    1593         LogAll "Unable to mount $USBPART on $MINDI_TMP/usb"
    1594         LogAll "Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)"
     1631        LogAll "ERROR: Unable to mount $USBPART on $MINDI_TMP/usb"
     1632        LogAll "       Make sure your USB device is plugged in, partitioned and formated ($USBPART must exist on it)"
    15951633        $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE
    15961634        MindiExit -1
     
    15981636    echo -en "."
    15991637    mkdir -p $MINDI_TMP/usb/images
    1600     cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogAll "OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"
     1638    cp -f $MINDI_CACHE/*.img $MINDI_CACHE/*.gz $MINDI_TMP/usb/images 2>> $LOGFILE || LogAll "ERROR: OfferToMakeBootableUSB: Cannot copy $i to $MINDI_TMP/usb/images"
    16011639    echo -en "."
    1602     LogFile "mindi_lib = $MINDI_DATA"
     1640    LogFile "INFO: mindi_lib = $MINDI_DATA"
    16031641    for i in memdisk memtest.bin memtest.img ; do
    16041642        j=$MINDI_DATA/$i
    16051643        k=$MINDI_TMP/usb
    16061644        if [ -e "$j" ] ; then
    1607             LogAll "Copying $j to $k"
     1645            LogIt "INFO: Copying $j to $k"
    16081646            cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k"
    16091647            cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP"
     
    16111649    done
    16121650    echo -en "."
    1613     MakeMessageFile > $MINDI_TMP/usb/message.txt
     1651    MakeMessageFile | cut -c1-80 > $MINDI_TMP/usb/message.txt
    16141652    echo -en "."
    16151653    cp $kernelpath $MINDI_TMP/usb/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/usb/vmlinuz). Did you run out of disk space?"
     
    16301668    umount $MINDI_TMP/usb
    16311669    if [ "$ARCH" != "ia64" ] ; then
    1632         syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log
    1633         if [ "$?" -ne "0" ] ; then
     1670        syslinux -v 2>&1 | grep -q 4.02
     1671        if [ $? -eq 0 ]; then
     1672            # This buggy version of syslinux requires a call to --stupid and not -s
     1673            syslinux --stupid $USBPART 2>> $MINDI_TMP/syslinux.log
     1674            res=$?
     1675        else
     1676            syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log
     1677            res=$?
     1678        fi
     1679        if [ $res -ne 0 ] ; then
    16341680            LogAll "----------- syslinux's errors --------------"
    16351681            cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE
    1636             echo "------------------------------------------"
    1637             LogAll "Failed to create USB image."
     1682            LogAll "------------------------------------------"
     1683            LogIt "ERROR: Failed to create USB image."
    16381684        else
    16391685            echo -e "$DONE"
    1640             LogFile "Created bootable USB image on $USBDEVICE"
     1686            LogFile "INFO: Created bootable USB image on $USBDEVICE"
    16411687        fi
    16421688        rm -f $MINDI_TMP/syslinux.log
    16431689    else
    1644         echo "No USB boot support for ia64"
     1690        LogAll "ERROR: No USB boot support for ia64"
    16451691        MindiExit -1
    16461692    fi
     
    17181764            echo -en "default${sep}iso\n"
    17191765        else
    1720             echo -en "default${sep}interactive\n"
     1766            echo -en "default${sep}${MINDI_DEFAULT_BOOT_OPTION}\n"
    17211767        fi
    17221768    else
     
    17261772    # Handle timeout
    17271773    if [ "$CDRECOVERY" != "yes" ] ; then
    1728         echo -en "timeout${sep}300\n"
     1774        echo -en "timeout${sep}${MINDI_BOOT_TIMEOUT}\n"
    17291775    else
    17301776        echo -en "timeout${sep}10000\n"
     
    17461792    for i in $options ; do
    17471793        ooo=$i
    1748         [ "$ooo" = "RESTORE" ] && ooo="nuke"
     1794        [ "$ooo" = "RESTORE" ] && ooo="RESTORE nuke"
    17491795        if [ "$type" = "elilo" ]; then
    17501796            outstr="image=/vmlinuz\n\tlabel=$i\n\tinitrd=/initrd.img\n\troot=/dev/ram0 append=\" rw ramdisk_size=$ramdisk_size $ooo $MINDI_ADDITIONAL_BOOT_PARAMS \"\n"
     
    18021848    fi
    18031849
    1804     mount -t vfat -o loop $imagefile $mountpoint || LogAll "Cannot mount (PBDI)"
     1850    mount -t vfat -o loop $imagefile $mountpoint || LogAll "ERROR: Cannot mount (PBDI)"
    18051851
    18061852    # copy Mindi's skeleton fs & lilo/syslinux/whatever stuff into it
     
    18081854    liloconf=$mountpoint/elilo.conf
    18091855
    1810     MakeMessageFile > $mountpoint/message.txt
     1856    MakeMessageFile | cut -c1-80 > $mountpoint/message.txt
    18111857
    18121858    if [ "$ARCH" != "ia64" ] ; then
     
    18331879    fi
    18341880
    1835     LogFile "Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."
     1881    LogFile "INFO: Copying $MINDI_TMP/initrd.img to $mountpoint/initrd.img..."
    18361882    cp -f $MINDI_TMP/initrd.img $mountpoint/initrd.img 2>> $LOGFILE
    18371883    if [ "$?" -ne "0" ] ; then
    1838         LogAll "Failed to copy $MINDI_TMP/initrd.img to $mountpoint"
     1884        LogAll "ERROR: Failed to copy $MINDI_TMP/initrd.img to $mountpoint"
    18391885        cat $MINDI_TMP/mtpt.$$ >> $LOGFILE
    1840         LogAll "Please unload some of your modules and try again."
     1886        LogAll "       Please unload some of your modules and try again."
    18411887        rm -f $MINDI_TMP/mtpt.$$
    1842         LogAll "Cannot incorporate initrd.img in bootdisk (kernel / modules too big?). Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
     1888        LogAll "       Cannot incorporate initrd.img in bootdisk (kernel / modules too big?)."
     1889        LogAll "       Try to increase EXTRA_SPACE and BOOT_SIZE in $MINDI_CONFIG"
    18431890        retval=$(($retval+1))
    18441891    fi
     
    18581905 
    18591906    if [ "$retval" -ne "0" ] ; then
    1860         LogFile "Files at mountpoint ($mountpoint) :-"
     1907        LogFile "INFO: Files at mountpoint ($mountpoint) :"
    18611908        du -sk $mountpoint/* >> $LOGFILE
    1862         LogFile "--- end of list of files ---" 
     1909        LogFile "--- end of list of files ---"
    18631910        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE
    18641911        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    18651912        cd "$old_pwd"
    18661913        umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    1867         rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)"
     1914        rmdir $mountpoint || LogAll "ERROR: Cannot rmdir (PBDI)"
    18681915
    18691916        rm -f $imagefile
     
    18711918    fi
    18721919    max_kernel_size=$(($free_space+`du -sk $kernelpath | cut -f1`))
    1873     LogFile "Free space left on image = $free_space KB"
    1874     LogFile "Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K"
     1920    LogFile "INFO: Free space left on image = $free_space KB"
     1921    LogFile "INFO: Max kernel size on $BOOT_SIZE KB image (est'd) = $max_kernel_size K"
    18751922
    18761923    # make it bootable
     
    18831930    umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    18841931    echo -en "..."
    1885     rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)"
     1932    rmdir $mountpoint || LogAll "ERROR: Cannot rmdir (PBDI)"
    18861933
    18871934    if [ "$retval" -eq "0" ] ; then
    18881935        echo -en "...$DONE\n"
    1889         LogAll "$BOOT_SIZE KB boot disk was created OK\n"
     1936        if [ "$KERN_DISK_MADE" ] ; then
     1937            [ "$imagefile" != "" ] && rm -f $imagefile
     1938            LogAll "INFO: $BOOT_SIZE KB boot disks were created OK\n"
     1939        fi
    18901940    else
    18911941        echo -en "...failed\n"
    1892         LogAll "$BOOT_SIZE KB boot disk was NOT created\n"
    1893         rm -f $imagefile
    1894     fi
    1895     [ "$retval" -ne "0" ] && LogAll "PrepareBootDiskImage() is returning nonzero"
     1942        LogAll "WARNING: $BOOT_SIZE""KB boot disk was NOT created\n"
     1943        [ "$imagefile" != "" ] && rm -f $imagefile
     1944    fi
     1945    [ "$retval" -ne "0" ] && LogAll "ERROR: PrepareBootDiskImage() is returning nonzero"
    18961946    return $retval
    18971947}
     
    19441994        Die "You have $res files present in dependency list\nbut absent from filesystem."
    19451995    fi
    1946     FindAndAddUserKeyboardMappingFile 
     1996    FindAndAddUserKeyboardMappingFile
    19471997    mkdir -p $bigdir/tmp
    19481998    [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO
     
    19622012    i=`cat $MINDI_TMP/BOOTLOADER.DEVICE 2> /dev/null`
    19632013    if [ "$i" ] ; then
    1964         LogAll "Backing up $i's MBR"
     2014        LogAll "INFO: Backing up $i's MBR"
    19652015        dd if=$i of=$bigdir/BOOTLOADER.MBR bs=446 count=1 >> $LOGFILE 2>> $LOGFILE
    19662016        sleep 1
     
    19682018        j=$i
    19692019        [ -h "$j" ] && j=`readlink -f $j`
    1970         LogAll "Creating /dev/boot_device ($j)"
     2020        LogAll "INFO: Creating /dev/boot_device ($j)"
    19712021        mkdir -p $bigdir/dev
    19722022        cp -pRdf $j $bigdir/dev/boot_device 2>> $LOGFILE || Die "Unable to create /dev/boot_device on ramdisk"
     
    19802030    if [ -d /$ti ]; then
    19812031        mkdir -p $ti
    1982         cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogAll "WARNING - error occurred while copying terminfo"
     2032        cp -Rdf /$ti/* $ti 2>> $LOGFILE || LogAll "ERROR: issue copying terminfo"
    19832033    fi
    19842034    if [ -e "$MONDO_SHARE/restore-scripts" ]; then
     
    19872037    fi
    19882038    if [ -d "/lib/dev-state" ]; then
    1989         tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Unable to handle /lib/dev-state" $MINDI_TMP/$$.log
     2039        tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "ERROR: Unable to handle /lib/dev-state" $MINDI_TMP/$$.log
    19902040    fi
    19912041    cd "$old_pwd"
     
    20062056        fi
    20072057    fi
     2058    LogFile "Your mountlist.txt file content is:"
     2059    LogFile "-----------------------------------"
     2060    cat $bigdir/$MINDI_CACHE/mountlist.txt >> $LOGFILE
     2061    LogFile "-----------------------------------"
    20082062
    20092063    echo -en "Tarring and zipping the data content..."
    20102064    size_of_all_tools=`du -sk $bigdir | cut -f1`
    2011     (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll "Problem creating all.tar.gz" $MINDI_TMP/$$.log)
     2065    (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll "ERROR: Problem creating all.tar.gz" $MINDI_TMP/$$.log)
    20122066    LogFile "Size of the data content"
    20132067    LogFile "------------------------"
     
    21242178    if [ "$?" -eq "0" ] ; then
    21252179        cp -f $tmpfile $1 2>> $LOGFILE
    2126         LogFile "Stripped binary $2"
     2180        LogFile "INFO: Stripped binary $2"
    21272181    fi
    21282182    rm -f $tmpfile
     
    21642218        # It's a Xen kernel
    21652219        KERNEL_IS_XEN="yes"
    2166         LogFile "It's a Xen kernel..."
    2167     fi
    2168 
    2169     for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/'` ; do
     2220        LogFile "INFO: It's a Xen kernel..."
     2221    fi
     2222
     2223    for fname in `find $root -maxdepth 2 -type f | grep -Ei 'lin|kern|xen' | grep -Ev '^/proc/|^/net/|^/mnt|^/lib|^/lib64|^/bin|^/sbin|^/usr|^/tmp'` ; do
    21702224        [ ! -e "$fname" ] && continue
    21712225        [ "$fname" = "/boot/vmlinuz.shipped" ] && [ -f "/boot/vmlinuz" ] && continue; # ignore SuSE's extra kernel
     
    22002254    fi
    22012255    if [ ! "$possible_kernels" ] ; then
    2202         LogAll "No kernel matches exactly. Are there any duff kernels?"
     2256        LogAll "INFO: No kernel matches exactly. Are there any duff kernels?"
    22032257        possible_kernels="$duff_kernels"
    22042258        if [ ! "$possible_kernels" ] ; then
    2205             LogAll "Sorry, no duff kernels either"
     2259            LogAll "INFO: Sorry, no duff kernels either"
    22062260        else
    2207             LogAll "I bet you're running Debian or Gentoo, aren't you?"
    2208             LogAll "Your kernel doesn't have a sane builddate. Oh well..."
     2261            LogAll "INFO: I bet you're running Debian or Gentoo, aren't you?"
     2262            LogAll "INFO: Your kernel doesn't have a sane builddate. Oh well..."
    22092263        fi
    22102264    fi
     
    22192273        LogAll "Could not find your kernel."
    22202274        if [ -e "/boot/vmlinuz" ] ; then
    2221             LogAll "Using /boot/vmlinuz as a last resort."
     2275            LogAll "INFO: Using /boot/vmlinuz as a last resort."
    22222276            output=/boot/vmlinuz
    22232277        else
     
    22262280    elif [ "$noof_kernels" -eq "1" ] ; then
    22272281        kp=`echo "$possible_kernels" | sed s/' '//`
    2228         LogFile "Your kernel is $kp (v$KERVERRUN)"
     2282        LogFile "INFO: Your kernel is $kp (v$KERVERRUN)"
    22292283        output="$kp"
    22302284    else
    22312285        for i in $possible_kernels ; do
    22322286            if [ "`echo $i | grep "$KERVERRUN"`" ]; then
    2233                 LogAll "OK, I used my initiative and found that "
    2234                 LogAll "$i is probably your kernel. "
     2287                LogAll "INFO: OK, I used my initiative and found that "
     2288                LogAll "INFO: $i is probably your kernel. "
    22352289                output="$i"
    22362290                break
     
    22402294            if [ "`echo " $possible_kernels " | grep -F "/boot/vmlinuz " &> /dev/null`" ]; then
    22412295                output=/boot/vmlinuz
    2242                 LogFile "Schlomo, this one's for you."
     2296                LogFile "INFO: Schlomo, this one's for you."
    22432297            else
    2244                 LogFile "Two or more possible kernels found. You may specify any one of them and the "
    2245                 LogFile "boot disks will still work, probably. If one does not work, try another."
    2246                 LogFile "$possible_kernels"
     2298                LogFile "INFO: Two or more possible kernels found. You may specify any one of them and the "
     2299                LogFile "INFO: boot disks will still work, probably. If one does not work, try another."
     2300                LogFile "INFO: $possible_kernels"
    22472301                output=""
    22482302            fi
     
    22542308        elif [ "$noof_xenkernels" -eq "1" ]; then
    22552309            xenkernelpath=`echo "$possible_xenkernels" | sed s/' '//`
    2256             LogFile "Your Xen kernel is $xenkernelpath (v$KERVERRUN)"
     2310            LogFile "INFO: Your Xen kernel is $xenkernelpath (v$KERVERRUN)"
    22572311        else
    22582312            for i in $possible_xenkernels ; do
    22592313                if [ "`echo $i | grep "$KERVERRUN"`" ]; then
    2260                     LogFile "OK, I used my initiative and found that "
    2261                     LogFile "$i is probably your Xen kernel. "
     2314                    LogFile "INFO: OK, I used my initiative and found that "
     2315                    LogFile "INFO: $i is probably your Xen kernel. "
    22622316                    xenkernelpath="$i"
    22632317                    break
     
    22682322                if [ ! -n "$new_possible_xenkernels" ]; then
    22692323                    xenkernelpath=`echo $new_possible_xenkernels | tr -s ' ' '\n' | head -1`
    2270                     LogFile "Using $xenkernelpath"
     2324                    LogFile "INFO: Using $xenkernelpath"
    22712325                else
    2272                     LogFile "Two or more possible Xen kernels found. You may specify any one of them and the "
    2273                     LogFile "boot disks will still work, probably. If one does not work, try another."
    2274                     LogFile "$possible_xenkernels"
     2326                    LogFile "INFO: Two or more possible Xen kernels found. You may specify any one of them and the "
     2327                    LogFile "INFO: boot disks will still work, probably. If one does not work, try another."
     2328                    LogFile "INFO: $possible_xenkernels"
    22752329                    output=""
    22762330                    xenkernelpath=`echo $possible_xenkernels | tr -s ' ' '\n' | head -1`
    2277                     LogFile "Using $xenkernelpath"
     2331                    LogFile "INFO: Using $xenkernelpath"
    22782332                fi
    22792333            fi
     
    23022356    # Get kbd conf from data disk preparation
    23032357    cat $MINDI_CACHE/KEYMAP-LIVES-HERE >> $MINDI_TMP/cp.lis
    2304     # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs
     2358    # AL04Oct08: Check whether /lib64 or /lib is a link and if so explicitly create one in rootfs
    23052359    if [ -h "/lib64" ]; then
    23062360        echo lib  >> $MINDI_TMP/mkdir.lis
    23072361        echo ln -s lib lib64  >> $MINDI_TMP/ln.lis
     2362    fi
     2363    if [ -h "/lib" ]; then
     2364        echo usr/lib  >> $MINDI_TMP/mkdir.lis
     2365        mv lib/* usr/lib
     2366        echo ln -s usr/lib lib  >> $MINDI_TMP/ln.lis
     2367    fi
     2368    # Check whether /sbin and /bin are a link and if so explicitly create one in rootfs (Fedora 17 crazyness)
     2369    if [ -h "/sbin" ]; then
     2370        echo usr/sbin  >> $MINDI_TMP/mkdir.lis
     2371        mv sbin/* usr/sbin
     2372        echo ln -s usr/sbin sbin >> $MINDI_TMP/ln.lis
     2373    fi
     2374    if [ -h "/bin" ]; then
     2375        echo usr/bin  >> $MINDI_TMP/mkdir.lis
     2376        mv bin/* usr/bin
     2377        echo ln -s usr/bin bin >> $MINDI_TMP/ln.lis
    23082378    fi
    23092379
     
    23302400    echo /etc/ld.so.c* >> $MINDI_TMP/cp.lis
    23312401
    2332     # Avoid an issue on some distro (RHEL5)
     2402    # Handle the case where busybox and mount are dynamically linked
     2403    file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically"
     2404    if [ $? -eq 0 ]; then
     2405        # We want to use the real mount and all the supported variants (nfs, cifs, ...)
     2406        rm -f bin/mount
     2407    fi
     2408
     2409    # Copy of files from the minimal env needed as per the deplist.d/minimal.conf file (which includes all busybox deps)
     2410    rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis
     2411    for f in `grep -v " *#.*" $DEPLIST_DIR/minimal.conf | sort -u`; do
     2412        if [ -r $f ]; then
     2413            echo $f >> $MINDI_TMP/minimal.lis
     2414            LocateDeps $f >> $MINDI_TMP/minimal2.lis
     2415        fi
     2416    done
     2417    for f in `cat $MINDI_TMP/minimal.lis` `sort -u $MINDI_TMP/minimal2.lis`; do
     2418        ReadAllLink $f >> $MINDI_TMP/minimal.lis
     2419    done
     2420    # Initial / are trucated by tar
     2421    finallist=""
     2422    # Remove directories from the list, as tar will create them anyway
     2423    # and it may hurt if /lib is in it as on Debian/Ubuntu
     2424    for f in `sort -u $MINDI_TMP/minimal.lis`; do
     2425        if [ ! -d $f ]; then
     2426            finallist="$finallist $f"
     2427        fi
     2428    done
     2429    tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log
     2430
     2431    # To improve support for distribution scripts, we now prefer to use bash as the std shell. Also fixes #600
     2432    ln -sf /bin/bash bin/sh
     2433    LogIt "INFO: Using bash as default shell"
     2434    rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis
     2435
     2436    # Avoids an issue on some distro (RHEL5)
    23332437    echo ./etc/ld.so.conf.d/kernelcap* >> $MINDI_TMP/rm.lis
    23342438
     
    23412445    if [ $? -eq 0 ]; then
    23422446        USE_UDEV="yes"
    2343         LogFile "udev device manager found"
     2447        LogFile "INFO: udev device manager found"
    23442448        echo /etc/udev /lib*/udev >> $MINDI_TMP/cp.lis
    23452449        # This avoids NIC remapping if on another machine at restore time on Debian at least
     
    23732477            rm -f $MINDI_TMP/udev.lis
    23742478        else
    2375             LogAll "udevd daemon not in standard place (/sbin)"
    2376             LogAll "mindi will use static devices which may cause problems"
     2479            LogAll "WARNING: udevd daemon not in standard place (/sbin or /usr/bin)"
     2480            LogAll "         mindi will use static devices which may cause problems"
    23772481        fi
    23782482    fi
     
    23822486    mindi-bkphw $MINDI_CACHE $MINDI_CONF | tee -a $LOGFILE
    23832487    if [ -d $MINDI_CACHE/bkphw ]; then
    2384         LogAll "Hardware Information found and saved ..."
     2488        LogAll "INFO: Hardware Information found and saved ..."
    23852489        echo $MINDI_CACHE/bkphw >> $MIDNDI_TMP/cp.lis
    23862490        if [ -f $MINDI_CACHE/tools.files ]; then
     
    24212525    fi
    24222526    for i in $DENY_MODS; do
    2423         LogFile "Removing $i from the list of modules to load"
     2527        LogFile "INFO: Removing $i from the list of modules to load"
    24242528        list_of_groovy_mods=`echo ${list_of_groovy_mods} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '`
    24252529    done
    24262530
    2427     [ -e "$needed_modules_path" ] || LogAll "path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."
     2531    [ -e "$needed_modules_path" ] || LogAll "WARNING: path $needed_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS."
    24282532    for i in $list_of_groovy_mods ; do
    24292533        needed_modules="$needed_modules `FindSpecificModuleInPath $needed_modules_path $i`"
     
    24572561    # Copy an additional ProLiant tool for OBDR support
    24582562    if [ -f $MINDI_TMP/OBDR ]; then
     2563        found=0
    24592564        if [ -x /usr/bin/hpsa_obdr_mode ]; then
    24602565            echo $mountpoint/usr/bin >> $MINDI_TMP/mkdir.lis
    24612566            echo /usr/bin/hpsa_obdr_mode >> $MINDI_TMP/cp.lis
    2462             LogIt "Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved OBDR support"
    2463         else
    2464             LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode tool"
     2567            LogIt "INFO: Copying /usr/bin/hpsa_obdr_mode to ramdisk for improved Smart Array OBDR support"
     2568            found=1
     2569        fi
     2570        if [ -x /usr/bin/sg_wr_mode ]; then
     2571            mkdir -p $mountpoint/usr/bin
     2572            lis="/usr/bin/sg_map /usr/bin/sg_inq /usr/bin/sg_reset /usr/bin/rev"
     2573            LocateDeps $lis > $MINDI_TMP/obdr.lis
     2574            (cd $mountpoint ; tar cf - $lis -C /  `sort -u $MINDI_TMP/obdr.lis` 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "ERROR: Problem in obdr.lis analysis" $MINDI_TMP/$$.log)
     2575            LogIt "INFO: Copying /usr/bin/sg_reset to ramdisk for improved SCSI OBDR support"
     2576            found=1
     2577        fi
     2578        if [ $found -eq 0 ]; then
     2579            LogAll "WARNING: You're using OBDR mode without having the /usr/bin/hpsa_obdr_mode nor the /usr/bin/sg_wr_mode tool"
    24652580            LogAll "         This may lead to a tape not going back to sequential mode after OBDR boot"
    24662581        fi
     
    25232638    LogFile "Content of initial ramdisk:"
    25242639    LogFile "---------------------------"
     2640    mkdir -p $mountpoint/proc
    25252641    (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE
    25262642    LogFile "---------------------------"
    25272643
    25282644    # Determine what filesystem to use for initrd image
    2529     LogFile "Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd."
     2645    LogFile "INFO: Call GetInitrdFilesystemToUse() with parameter ${kernelpath} to get filesystem to use for initrd."
    25302646    gvFileSystem=`GetInitrdFilesystemToUse ${kernelpath}`
    25312647    [ -z  gvFileSystem ] && Die "GetFilesystemToUse() failed. Terminating."
    2532     if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ]; then
     2648    if [ "$gvFileSystem" = "ext2fs" ] || [ "$gvFileSystem" = "ext3fs" ] || [ "$gvFileSystem" = "ext4fs" ]; then
    25332649        # say what will be used
    2534         LogFile "Creating an $gvFileSystem initrd image..."
     2650        LogFile "INFO: Creating an $gvFileSystem initrd image..."
    25352651        # kernel expects linuxrc in ext2 filesystem
    25362652        ( cd "$mountpoint" && ln -sf sbin/init linuxrc )
     
    25382654        umount $mountpoint || Die "Cannot unmount $tempfile"
    25392655        dd if=$tempfile bs=1k 2> /dev/null > ${rdz_fname}.tmp 2> /dev/null
    2540         bs=`tune2fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'`
     2656        if [ "$gvFileSystem" = "ext4fs" ] && [ -x "/sbin/tune4fs" ]; then
     2657            bs=`/sbin/tune4fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'`
     2658        else
     2659            bs=`tune2fs -l ${rdz_fname}.tmp | grep -E '^Block size:' | cut -d: -f2 | sed 's/^ *//'`
     2660        fi
    25412661        MINDI_ADDITIONAL_BOOT_PARAMS="$MINDI_ADDITIONAL_BOOT_PARAMS ramdisk_blocksize=$bs"
    25422662        gzip -c9 ${rdz_fname}.tmp > $rdz_fname
    25432663        rm -f ${rdz_fname}.tmp
    25442664        # log that we are done
    2545         LogFile "...done."
     2665        LogFile "      ...done."
    25462666    elif [ "$gvFileSystem" = "initramfs" ]; then
    25472667        # say what will be used
    2548         LogFile "Creating a gzip'ed cpio (AKA initramfs) initrd image..."
     2668        LogFile "INFO: Creating a gzip'ed cpio (AKA initramfs) initrd image..."
    25492669        # make sure that cpio is there
    25502670        which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again."
     
    25582678        umount $mountpoint || Die "Cannot unmount $tempfile"
    25592679        # log that we are done
    2560         LogFile "...done."
     2680        LogFile "      ...done."
    25612681    else
    25622682        Die "Filesystem $gvFileSystem not supported for initrd image. Terminating."
     
    25852705fi
    25862706
     2707# --nolog needs to be first, and is used in analyze-my-lvm
     2708if [ "$1" = "--nolog" ] ; then
     2709    shift
     2710    LOGFILE=/dev/stderr
     2711else
     2712    > $LOGFILE
     2713fi
    25872714if [ "$1" = "--printvar" ] ; then
    25882715    shift
     
    25942721
    25952722> $LOGFILE
    2596 LogFile "mindi v$MINDI_VERSION" 
    2597 LogFile "$ARCH architecture detected" 
    2598 LogFile "mindi called with the following arguments:" 
    2599 LogFile "$*"
    2600 LogFile "Start date : `date`" 
    2601 LogFile "-----------------------------" 
     2723LogFile "mindi v$MINDI_VERSION"
     2724LogFile "$ARCH architecture detected"
     2725LogFile "mindi called with the following arguments:"
     2726echo "$@">> $LOGFILE
     2727LogFile "Start date : `date`"
     2728LogFile "-----------------------------"
    26022729
    26032730# Log some capital variables
     
    26092736LogFile "MINDI_CONF = $MINDI_CONF"
    26102737if [ -f $MINDI_CONFIG ]; then
    2611     LogFile "-----------------------------" 
    2612     LogFile " Mindi configuration file    " 
    2613     LogFile "-----------------------------" 
     2738    LogFile "-----------------------------"
     2739    LogFile " Mindi configuration file    "
     2740    LogFile "-----------------------------"
    26142741    grep -Ev '^#' $MINDI_CONFIG >> $LOGFILE
    2615     LogFile "-----------------------------"
    2616 fi
    2617 
     2742    LogFile "-----------------------------"
     2743fi
     2744LogFile "In Mindi"
     2745LogFile "--------"
     2746LogFile "EXTRA_SPACE = $EXTRA_SPACE"
     2747LogFile "BOOT_SIZE = $BOOT_SIZE"
     2748LogFile "--------"
    26182749
    26192750trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT
     
    26262757if which awk &> /dev/null ; then
    26272758    if ! which gawk &> /dev/null ; then
    2628         LogAll "You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"
     2759        LogIt "INFO: You have awk but not gawk.\nPlease note that mindi works fine with a _sane_ awk binary.\nIf your awk binary misbehaves then please contact your vendor\nor distribution's mailing list for technical support.\n"
    26292760    fi
    26302761fi
     
    26322763[ ! -e "$FDISK" ] && Die "Cannot find $FDISK"
    26332764
    2634 [ "`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"
     2765[ "`echo $KERVERRUN | grep -E "2\.4\.[0-6]" | grep -vE "2\.4\.[0-9][0-9]"`" != "" ] &&  echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7"
    26352766
    26362767# Update the PATH variable if incomplete
     
    26382769    PATH=$PATH:/sbin:/usr/sbin
    26392770    export PATH
    2640     LogFile "Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily."
    2641     LogFile "However, you may wish to ask your vendor to provide a permanent fix..."
    2642     LogFile " Or you might like to call 'su -' instead of 'su', for example."
     2771    LogFile "INFO: Your PATH did not include /sbin or /usr/sbin. I have fixed that, temporarily."
     2772    LogFile "INFO: However, you may wish to ask your vendor to provide a permanent fix..."
     2773    LogFile "INFO:  Or you might like to call 'su -' instead of 'su', for example."
    26432774fi
    26442775
     
    26822813fi
    26832814
    2684 LogFile "LVM set to $LVM"
    2685 LogFile "----------" 
    2686 LogFile "mount result:" 
    2687 LogFile "-------------" 
     2815LogFile "INFO: LVM set to $LVM"
     2816LogFile "----------"
     2817LogFile "mount result:"
     2818LogFile "-------------"
    26882819mount >> $LOGFILE
    2689 LogFile "-------------"
    26902820if [ -e /etc/raidtab ]; then
    2691     LogFile "-------------" 
    2692     LogFile "/etc/raidtab content:" 
    2693     LogFile "-------------" 
     2821    LogFile "-------------"
     2822    LogFile "/etc/raidtab content:"
     2823    LogFile "-------------"
    26942824    cat /etc/raidtab >> $LOGFILE
     2825else
     2826    LogFile "No file /etc/raidtab"
     2827fi
     2828if [ -e /etc/mdadm.conf ]; then
     2829    LogFile "-------------"
     2830    LogFile "/etc/mdadm.conf content:"
     2831    LogFile "-------------"
     2832    cat /etc/mdadm.conf >> $LOGFILE
     2833else
     2834    LogFile "-------------"
     2835    LogFile "No file /etc/mdadm.conf"
    26952836fi
    26962837LogFile "-------------"
     
    27022843LogFile "-------------"
    27032844cat /proc/swaps >> $LOGFILE
    2704 LogFile "-------------"
    2705 LogFile "cat /proc/partitions:"
    2706 LogFile "-------------"
     2845LogFile "-------------"
     2846if [ -e /proc/mdstat ]; then
     2847    LogFile "cat /proc/mdstat:"
     2848    LogFile "-------------"
     2849    cat /proc/mdstat >> $LOGFILE
     2850else
     2851    LogFile "No pseudo file /proc/mdstat"
     2852fi
     2853LogFile "-------------"
     2854LogFile "cat /proc/partitions:"
     2855LogFile "-------------"
    27072856cat /proc/partitions >> $LOGFILE
    2708 LogFile "-------------" 
    2709 LogFile "cat /proc/filesystems:" 
    2710 LogFile "-------------" 
     2857LogFile "-------------"
     2858LogFile "cat /proc/filesystems:"
     2859LogFile "-------------"
    27112860cat /proc/filesystems >> $LOGFILE
    2712 LogFile "-------------" 
    2713 LogFile "lsmod result:" 
    2714 LogFile "-------------" 
     2861LogFile "-------------"
     2862LogFile "lsmod result:"
     2863LogFile "-------------"
    27152864lsmod >> $LOGFILE
    27162865MODULES="`cat /proc/modules | $AWK '{print $1}'`"
    27172866if [ -x /usr/sbin/esxcfg-module ]; then
    2718     LogFile "-------------" 
    2719     LogFile "VMWare ESX server detected - Enabling dedicated support"
    2720     LogFile "-------------" 
    2721     LogFile "VMWare modules" 
    2722     LogFile "-------------" 
     2867    LogFile "-------------"
     2868    LogFile "INFO: VMWare ESX server detected - Enabling dedicated support"
     2869    LogFile "-------------"
     2870    LogFile "VMWare modules"
     2871    LogFile "-------------"
    27232872    /usr/sbin/esxcfg-module -l >> $LOGFILE
    27242873    MODULES="$MODULES `/usr/sbin/esxcfg-module -l | $AWK '{print $1}'`"
    27252874fi
    2726 LogFile "FORCE_MODS:"
    2727 LogFile "-------------"
    2728 LogFile $FORCE_MODS
    2729 LogFile "-------------"
    2730 LogFile "DENY_MODS:"
    2731 LogFile "-------------"
    2732 LogFile $DENY_MODS
    2733 LogFile "-------------"
    2734 LogFile "df result:"
    2735 LogFile "----------"
    2736 df -T >> $LOGFILE
    2737 LogFile "-------------"
    27382875LogFile "Liste of extra modules is:"
    27392876LogFile "-------------"
    27402877LogFile "$EXTRA_MODS"
    27412878LogFile "-------------"
     2879LogFile "FORCE_MODS:"
     2880LogFile "-------------"
     2881LogFile "$FORCE_MODS"
     2882LogFile "-------------"
     2883LogFile "DENY_MODS:"
     2884LogFile "-------------"
     2885LogFile "$DENY_MODS"
     2886LogFile "-------------"
     2887LogFile "df result:"
     2888LogFile "----------"
     2889df -aT >> $LOGFILE
     2890LogFile "-------------"
     2891LogFile "df -i result:"
     2892LogFile "----------"
     2893df -i >> $LOGFILE
     2894LogFile "-------------"
     2895if [ -r /boot/grub/menu.lst ]; then
     2896    LogFile "-------------"
     2897    LogFile "INFO: /boot/grub/menu.lst content"
     2898    LogFile "-------------"
     2899    cat /boot/grub/menu.lst >> $LOGFILE
     2900    LogFile "-------------"
     2901fi
     2902if [ -r /boot/grub/grub.conf ]; then
     2903    LogFile "-------------"
     2904    LogFile "INFO: /boot/grub/grub.conf content"
     2905    LogFile "-------------"
     2906    cat /boot/grub/grub.conf >> $LOGFILE
     2907    LogFile "-------------"
     2908fi
     2909if [ -r /boot/grub/grub.cfg ]; then
     2910    LogFile "-------------"
     2911    LogFile "INFO: /boot/grub/grub.cfg content"
     2912    LogFile "-------------"
     2913    cat /boot/grub/grub.cfg >> $LOGFILE
     2914    LogFile "-------------"
     2915fi
     2916if [ -r /boot/grub/device.map ]; then
     2917    LogFile "-------------"
     2918    LogFile "INFO: /boot/grub/device.map content"
     2919    LogFile "-------------"
     2920    cat /boot/grub/device.map >> $LOGFILE
     2921    LogFile "-------------"
     2922fi
     2923if [ -r /etc/lilo.conf ]; then
     2924    LogFile "-------------"
     2925    LogFile "INFO: /etc/lilo.conf content"
     2926    LogFile "-------------"
     2927    cat /etc/lilo.conf >> $LOGFILE
     2928fi
     2929LogFile "Full fdisk info"
     2930LogFile "---------------"
     2931$FDISK -l >> $LOGFILE
     2932LogFile "----------------"
     2933LogFile "List of extra modules is:"
     2934LogFile "$EXTRA_MODS"
     2935LogFile "-------------"
    27422936
    27432937# Compute libata version
     
    27472941    if [ "$laver" = "2" ]; then
    27482942        DENY_MODS="$DENY_MODS ide-generic"
    2749         LogFile "ide-generic removed from module list as your system uses libata v2+"
    2750         LogFile "-------------"
    2751     fi
     2943        LogFile "INFO: ide-generic removed from module list as your system uses libata v2+"
     2944        LogFile "-------------"
     2945    fi
     2946fi
     2947
     2948# Check for McAfee which disturbs the access to some files (tgz in articular)
     2949if [ "x`cat /proc/linuxshield/enabled 2>/dev/null`" = "x1" ]; then
     2950    LogFile "WARNING: McAfee LinuxShield is enabled. McAfee might block access to certain special files."
     2951    LogFile "WARNING: Check in /var/opt/NAI/LinuxShield/etc/nailsd.cfg for 'nailsd.profile.OAS.action.error: Block'"
     2952    LogFile "WARNING: You have two options:"
     2953    LogFile "WARNING:  - Exclude all directories with special files (check McAfee System Events Log)"
     2954    LogFile "WARNING:  - Disable the scanner during the backup"
    27522955fi
    27532956
    27542957# Check for ISO_CMD command
    27552958if [ ! -x $ISO_CMD ]; then
    2756     echo "NOTE: No CD image (ISO file) utility found" >> $LOGFILE
     2959    LogFile "NOTE: No CD image (ISO file) utility found"
    27572960fi
    27582961
     
    27882991            if [ $KERNEL_IS_XEN = "yes" ]; then
    27892992                echo "$xenkernelpath"
    2790                 LogOnly "xenkernelpath = $xenkernelpath"
     2993                LogFile "INFO: xenkernelpath = $xenkernelpath"
    27912994                MindiExit 0
    27922995            else
     
    27952998        else
    27962999            echo "$resk"
    2797             LogOnly "kernelpath = $resk"
     3000            LogFile "INFO: kernelpath = $resk"
    27983001            MindiExit 0
    27993002        fi
     
    28063009    elif [ "$1" = "--readalllink" ] ; then
    28073010        [ ! "$2" ] && Die "Please specify the binary to look at"
    2808         shift
    2809         ReadAllLink $*
    28103011        # Avoids logfile content for mondo
    28113012        export MONDO_SHARE=""
     3013        ReadAllLink $2
    28123014        MindiExit $?
    28133015    elif [ "$1" = "--makemessage" ] ; then
    2814         MakeMessageFile
     3016        MakeMessageFile | cut -c1-80
    28153017        MindiExit 0
    28163018    elif [ "$1" = "--makemountlist" ] ; then
     
    28533055###
    28543056        if [ $KERNEL_IS_XEN = "yes" ]; then
    2855             LogAll "xenkernelpath = $xenkernelpath"
     3057            LogAll "INFO: xenkernelpath = $xenkernelpath"
    28563058        fi
    28573059        kernelname=`echo $kernelpath | cut -d'-' -f2- | sed 's/.[bg]z[2]*$//'`
    28583060        if [ ! -d "/lib/modules/$kernelname" ]
    28593061        then
    2860            LogAll "Module path for ${kernelpath} not found..."
    2861            LogAll "using running kernel\'s modules."
     3062           LogAll "WARNING: Module path for ${kernelpath} not found..."
     3063           LogAll "         using running kernel\'s modules."
    28623064           kernelname=$KERVERRUN
    28633065        else
    28643066           LogAll "Using modules for kernel: ${kernelname}"
    28653067        fi
    2866         LogAll "kernelname = $kernelname"
    2867         LogAll "kernelpath = $kernelpath"
     3068        LogAll "INFO: kernelname = $kernelname"
     3069        LogAll "INFO: kernelpath = $kernelpath"
    28683070###
    28693071### end of Sq-Modification
     
    28813083        if [ "${11}" ] ; then
    28823084            LILO_OPTIONS=""
    2883     #       LogAll "LILO will use conservative settings, to be compatible with older BIOSes."
     3085    #       LogAll "INFO: LILO will use conservative settings, to be compatible with older BIOSes."
    28843086        fi
    28853087        ESTIMATED_TOTAL_NOOF_SLICES=${12}
     
    29183120LogFile "DIFFERENTIAL = $DIFFERENTIAL"
    29193121LogFile "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE"
     3122if [ -f $MINDI_LIB/rootfs/bin/busybox ]; then
     3123    LogIt "Mindi-`$MINDI_LIB/rootfs/bin/busybox 2>&1 | head -1`"
     3124else
     3125    LogIt "ERROR: No mindi-busybox installed"
     3126fi
    29203127
    29213128if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then
    2922     LogAll "Including the generation of a Bootable USB device on $USBDEVICE"
     3129    LogAll "INFO: Including the generation of a Bootable USB device on $USBDEVICE"
    29233130fi
    29243131
     
    29403147    fi
    29413148fi
    2942 LogFile "Mindi's temp dir=$MINDI_TMP"
    2943 LogFile "Mindi's output dir=$MINDI_CACHE"
    2944 [ "$(($RANDOM%64))" -eq "0" ] && LogAll "Dude, I've looked inside your computer and it's really dusty..."
     3149LogFile "INFO: Mindi's temp dir=$MINDI_TMP"
     3150LogFile "MINFO: indi's output dir=$MINDI_CACHE"
     3151[ "$(($RANDOM%64))" -eq "0" ] && LogIt "INFO: Dude, I've looked inside your computer and it's really dusty..."
    29453152
    29463153PrepareDataDiskImages
     
    29483155export ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE))
    29493156
    2950 LogFile "Ramdisk will be $ramdisk_size KB"
     3157LogFile "INFO: Ramdisk will be $ramdisk_size KB"
    29513158PrepareBootDiskImage $kernelpath || Die "Failed to create $ramdisk_size MB disk image."
    29523159
     
    29833190fi
    29843191# cleanup
    2985 LogAll "$FRIENDLY_OUTSTRING"
     3192LogAll "INFO: $FRIENDLY_OUTSTRING"
    29863193for mtpt in $FLOPPY_WAS_MOUNTED ; do
    29873194    mount $mtpt
Note: See TracChangeset for help on using the changeset viewer.