Changeset 3887 in MondoRescue for branches/3.3/mindi/mindi


Ignore:
Timestamp:
Mar 10, 2024, 7:26:10 PM (8 weeks ago)
Author:
Bruno Cornec
Message:

Multple modifications not all tested !!!

  • Removal of elilo/ia64 support
  • Dependency management, Big dir preparation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi/mindi

    r3843 r3887  
    1313#-----------------------------------------------------------------------------
    1414
    15 ### Which arch are we on (useful for ia64 port)
     15### Which arch are we on
    1616ARCH=`/bin/uname -m`
    1717KERVERRUN=`/bin/uname -r`
     
    302302    local outdir incoming counter d found tdir templog
    303303    outdir=$1
    304     noof_lines=$2
    305     counter=$3
    306304    templog=$MINDI_TMP/$$.log
    307305    mkdir -p $outdir
    308306    incoming=`ReadLine`
     307    counter=$3
    309308    > $templog
    310309
    311310    while [ "$incoming" != "" ] ; do
    312         LogFile "DEBUG: Handling $incoming"
    313         if [ "$noof_lines" != "0" ]; then
     311        if [ "$3" = "1" ]; then
    314312            counter=$(($counter+1))
    315             LogProgress $counter $noof_lines
     313            LogProgress $counter $2
    316314        fi
    317315        # Non absolute file names should not arrive till here => skipped
    318316        if [ `echo "$incoming" | cut -c1` != '/' ]; then
    319             LogAll "WARNING: Unable to handle $incoming"
     317            LogFile "WARNING: Unable to handle non-full pathname $incoming"
    320318            incoming=`ReadLine`
    321319            continue
    322320        fi
    323         if [ -e "$incoming" ]; then
    324             LogFile "DEBUG: Adding $incoming"
    325             listfile="$listfile $incoming"
    326         fi
    327         incoming=`ReadLine`
    328     done
    329 
    330     LogAll "Creating mindi tar file"
    331     tar cf - -C / $listfile 2> $templog | (cd "$outdir" ; tar xf -) # || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $templog
    332 }
    333 
    334 bidon() {
    335 
    336321        # no parent directory of incoming should be a link, copy is not possible in that case
    337322        d=`dirname "$incoming"`
    338323        found="false"
    339324        while [ $d != "/" -a $found = "false" ]; do
    340             if [ -h "$d" ]; then
    341                 found="true"
    342                 LogFile "WARNING: skipping $d as link"
    343                 incoming=`ReadLine`
    344                 continue
    345             fi
     325            [ -h "$d" ] && found="true"
    346326            d=`dirname "$d"`
    347327        done
    348 
    349328        if [ -d "$incoming" -a ! -h "$incoming" ]; then
    350             LogFile "DEBUG: Finding in $incoming"
    351             find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 0
     329            find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 0
    352330        elif [ -e "$incoming" ] && [ $found = "false" ]; then
    353331            if [ ! -h "$incoming" ]; then
    354                 LogFile "DEBUG: Tarring $incoming"
    355332                tar cf - -C / $incoming 2> $templog | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $templog
    356333            else
    357                 LogFile "DEBUG: Copying $incoming"
    358334                tdir=`dirname "$incoming"`
    359335                if [ ! -e "$outdir/$tdir" ]; then
     
    364340            # Only uncompress modules if not using udevd
    365341            if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    366                     gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming"
     342                gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming"
    367343            fi
    368344            [ -x "$outdir" ] && StripExecutable $outdir
    369345        fi
    370346        incoming=`ReadLine`
     347    done
    371348}
    372349
     
    379356    done
    380357    echo $r
     358}
     359
     360
     361DropOptimizedLibraries() {
     362    local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res
     363    filelist=$1
     364    outdir=$2
     365
     366    list_of_optimized_libraries=`grep "lib/i[5-7]86/" $filelist`
     367    if [ "$list_of_optimized_libraries" = "" ] ; then
     368        return 0
     369    fi
     370    echo -en "Dropping i686-optimized libraries if appropriate"
     371    for optimized_lib_name in $list_of_optimized_libraries ; do
     372        echo -en "."
     373        reason=""
     374        vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
     375        echo "$vanilla_lib_name" >> $filelist
     376        LogFile "INFO: Adding $vanilla_lib_name to filelist"
     377        mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null
     378        rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null
     379
     380        # This may return multiple files
     381        for resolved in `mr-read-all-link $vanilla_lib_name`; do
     382            LogFile "INFO: Adding as deps $resolved to filelist"
     383            vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
     384            if [ "$vanilla_resolved_name" != "$resolved" ]; then
     385                mkdir -p $outdir$resolved> /dev/null 2> /dev/null
     386                rmdir $outdir$resolved > /dev/null 2> /dev/null
     387                ln -sf $vanilla_resolved_name $outdir$resolved
     388                LogFile "INFO: Excluding deps $resolved"
     389                grep -Fvx "$resolved" "$filelist" > $filelist.tmp
     390                LogFile "INFO: Replacing it with $vanilla_resolved_name"
     391                echo "$vanilla_resolved_name" >> $filelist.tmp
     392                mv -f $filelist.tmp $filelist
     393            fi
     394        done
     395    done
     396    $AWK '{ print $1; }' $filelist | sort -u > $filelist.tmp
     397    mv -f $filelist.tmp $filelist
     398    echo -e "$DONE"
    381399}
    382400
     
    11591177                    [ "`echo $uname | grep "2.6.19"`" != "" ] && skip=1052
    11601178                    [ "`echo $uname | grep "2.6.[2-9]"`" != "" ] && skip=1052
    1161                     [ "`echo $uname | grep "[3-6].[0-9]*.[0-9]*"`" != "" ] && skip=1052
     1179                    [ "`echo $uname | grep "3.[0-9]*.[0-9]*"`" != "" ] && skip=1052
    11621180                    if [ $skip = "" ]; then
    11631181                        Die "Your kernel is too old. I don't know how to support labelled swap spaces with it"
     
    16291647fi
    16301648
    1631 if [ "$ARCH" != "ia64" ] ; then
    1632     if [ $KERNEL_IS_XEN = "yes" ]; then
    1633         FindMboot32Binary
    1634         cp $xenkernelpath $MINDI_TMP/target/xen.gz 2>> $LOGFILE
    1635         if [ $? -ne 0 ] ; then
    1636             LogAll "ERROR: Failed to copy $xenkernelpath to $MINDI_TMP/target/"
    1637             retval=$(($retval+1))
    1638         fi
    1639         cp $MBOOTC32 $MINDI_TMP/target/$tbc/mboot.c32  2>> $LOGFILE
    1640         if [ $? -ne 0 ] ; then
    1641             LogAll "ERROR: Failed to copy $MBOOTC32 to $MINDI_TMP/target/$tbc"
    1642             retval=$(($retval+1))
    1643         fi
     1649if [ $KERNEL_IS_XEN = "yes" ]; then
     1650    FindMboot32Binary
     1651    cp $xenkernelpath $MINDI_TMP/target/xen.gz 2>> $LOGFILE
     1652    if [ $? -ne 0 ] ; then
     1653        LogAll "ERROR: Failed to copy $xenkernelpath to $MINDI_TMP/target/"
     1654        retval=$(($retval+1))
     1655    fi
     1656    cp $MBOOTC32 $MINDI_TMP/target/$tbc/mboot.c32  2>> $LOGFILE
     1657    if [ $? -ne 0 ] ; then
     1658        LogAll "ERROR: Failed to copy $MBOOTC32 to $MINDI_TMP/target/$tbc"
     1659        retval=$(($retval+1))
    16441660    fi
    16451661fi
     
    18281844
    18291845if  [ "$target" = "ISO" ]; then
    1830     if [ "$ARCH" != "ia64" ]; then
    1831         ISO_OPT="$ISO_OPT -b $tbc/isolinux.bin -c $tbc/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
    1832     fi
    1833     # ISO
    1834     if [ "$ARCH" != "ia64" ] && [ "$BOOT_TYPE" = "BIOS" ]; then
     1846    ISO_OPT="$ISO_OPT -b $tbc/isolinux.bin -c $tbc/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
     1847    if [ "$BOOT_TYPE" = "BIOS" ]; then
     1848        # BIOS
    18351849        CMD="$ISO_CMD $ISO_OPT"
    18361850        MakeISO
    18371851    else
    1838         if [ "$ARCH" = "ia64" ]; then
    1839             CMD="$ISO_CMD $ISO_OPT -b images/mindi-bootroot.img -c images/boot.cat"
     1852        # UEFI
     1853        echo "$CMD" | grep -q "xorriso"
     1854        if [ $? -eq 0 ]; then
     1855            XOV=`xorriso --version 2>&1 | head -1 | awk '{print $3}'`
     1856            XOVMAJ=`echo $XOV | cut -d. -f1`
     1857            XOVMIN=`echo $XOV | cut -d. -f2`
     1858            if [ $XOVMAJ -ge 1 && $XOVMIN -ge 3 ]; then
     1859                CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -e images/mindi-bootroot.img -no-emul-boot"
     1860            else
     1861                CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot --efi-boot images/mindi-bootroot.img"
     1862            fi
    18401863        else
    1841             # UEFI
    1842             echo "$CMD" | grep -q "xorriso"
    1843             if [ $? -eq 0 ]; then
    1844                 XOV=`xorriso --version 2>&1 | head -1 | awk '{print $3}'`
    1845                 XOVMAJ=`echo $XOV | cut -d. -f1`
    1846                 XOVMIN=`echo $XOV | cut -d. -f2`
    1847                 if [ $XOVMAJ -ge 1 && $XOVMIN -ge 3 ]; then
    1848                     CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -e images/mindi-bootroot.img -no-emul-boot"
    1849                 else
    1850                     CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot --efi-boot images/mindi-bootroot.img"
    1851                 fi
    1852             else
    1853                 CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -efi-boot images/mindi-bootroot.img -no-emul-boot"
    1854             fi
     1864            CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -efi-boot images/mindi-bootroot.img -no-emul-boot"
    18551865        fi
    18561866    fi
     
    18631873if  [ "$target" = "ISO" ]; then
    18641874    cp $part $MINDI_CACHE
    1865     if [ "$ARCH" = "ia64" ] || [ "$BOOT_TYPE" = "UEFI" ]; then
     1875    if [ "$BOOT_TYPE" = "UEFI" ]; then
    18661876        # Mount again !
    18671877        LogAll "INFO: Re-Mounting $part on $MINDI_TMP/mpt"
     
    18851895else
    18861896    # USB
    1887     if [ "$ARCH" != "ia64" ] ; then
    1888         syslinux -v 2>&1 | grep -q 4.02
    1889         if [ $? -eq 0 ]; then
    1890             # This buggy version of syslinux requires a call to --stupid and not -s
    1891             syslinux --stupid $USBPART 2>> $MINDI_TMP/syslinux.log
    1892             res=$?
    1893         else
    1894             syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log
    1895             res=$?
    1896         fi
    1897         if [ $res -ne 0 ] ; then
    1898             LogAll "----------- syslinux's errors --------------"
    1899             cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE
    1900             LogAll "------------------------------------------"
    1901             LogAll "ERROR: Failed to create USB image."
    1902         else
    1903             LogFile "INFO: Created bootable USB image on $USBDEVICE"
    1904         fi
    1905         rm -f $MINDI_TMP/syslinux.log
     1897    syslinux -v 2>&1 | grep -q 4.02
     1898    if [ $? -eq 0 ]; then
     1899        # This buggy version of syslinux requires a call to --stupid and not -s
     1900        syslinux --stupid $USBPART 2>> $MINDI_TMP/syslinux.log
     1901        res=$?
    19061902    else
    1907         LogAll "ERROR: No USB boot support for ia64"
    1908         MindiExit -1
    1909     fi
     1903        syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log
     1904        res=$?
     1905    fi
     1906    if [ $res -ne 0 ] ; then
     1907        LogAll "----------- syslinux's errors --------------"
     1908        cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE
     1909        LogAll "------------------------------------------"
     1910        LogAll "ERROR: Failed to create USB image."
     1911    else
     1912        LogFile "INFO: Created bootable USB image on $USBDEVICE"
     1913    fi
     1914    rm -f $MINDI_TMP/syslinux.log
    19101915fi
    19111916}
     
    20152020    local options i ooo
    20162021    options=""
    2017     # Type of boot file (elilo or syslinux/isolinux)
     2022    # Type of boot file (grub2 or syslinux/isolinux)
    20182023    type=$1
    2019     if [ "$type" = "elilo" ] || [ "$type" = "grub2" ]; then
     2024    if [ "$type" = "grub2" ]; then
    20202025        sep="="
    20212026        sepdef="="
     
    20262031
    20272032    # Generic header for conf file
    2028     if [ "$type" = "elilo" ]; then
    2029         echo -en "prompt\n"
    2030     elif [ "$type" = "grub" ]; then
     2033    if [ "$type" = "grub" ]; then
    20312034        echo -en "pause Press a key when ready to restore\n"
    20322035    elif [ "$type" = "grub2" ]; then
     
    20972100        ooo=$i
    20982101        [ "$ooo" = "RESTORE" ] && ooo="RESTORE nuke"
    2099         if [ "$type" = "elilo" ]; then
    2100             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"
    2101         elif [ "$type" = "grub" ]; then
     2102        if [ "$type" = "grub" ]; then
    21022103            outstr="title $i\n\tkernel /vmlinuz root=/dev/ram0 rw ramdisk_size=RAMDISK_SIZE ${ooo} $MINDI_ADDITIONAL_BOOT_PARAMS\n\tinitrd=/initrd.img\n"
    21032104        elif [ "$type" = "grub2" ]; then
     
    21212122    done
    21222123    if [ -e "$MINDI_LIB/memtest.img" ] ; then
    2123         if [ "$type" = "elilo" ]; then
    2124             echo -en "image=/memtest.bin\n\tlabel=memtest\n"
    2125             echo -en "image=/memdisk\n\tlabel=memdisk\nappend=\"initrd=memtest.img\"\n"
    2126         elif [ "$type" = "grub" ]; then
     2124        if [ "$type" = "grub" ]; then
    21272125            echo -en "title memtest\n\tkernel /memtest.efi\n\tinitrd=/memtest.img\n"
    21282126        elif [ "$type" = "grub2" ]; then
     
    21872185
    21882186        mountefi=0
    2189         # EFI or UEFI
     2187        # UEFI
    21902188        # TODO: names are hard-coded for now
    21912189        if [ "$BOOT_TYPE" = "UEFI" ]; then
     
    22522250            fi
    22532251        else
    2254             # EFI
    2255             efidir=$bootdir
    2256             bootbin=`find /boot/efi -iname "elilo.efi" | head -1`
    2257             tgbin=$bootbin
    2258             boottype=elilo
    2259             bootconf="$efidir/elilo.conf"
     2252            LogAll "ERROR: UNSUPPORTED $BOOT_TYPE BOOT_TYPE. Please report upstream"
     2253            MindiExit -1
    22602254        fi
    22612255        LogAll "INFO: Found $boottype boot type"
     
    23322326
    23332327PrepareBigDir() {
    2334     local needlist diskdir res i j k lines lfiles includefile ti templog
     2328    local needlist diskdir res i j k lines lfiles includefile ti
    23352329
    23362330    rm -f $MINDI_CACHE/mindi.iso
    2337     mkdir -p $targetdir
    2338     templog=$MINDI_TMP/$$.log
    2339     needlist=$MINDI_TMP/kernel-modules.conf
    2340     mkdir -p $bigdir/usr/bin $bigdir/usr/sbin $bigdir/tmp
    2341     # Generated file
    2342     includefile=$MINDI_TMP/include-modules.conf
    2343 
    2344     lfiles=`ls $DEPLIST_DIR/* | grep -Ev '/minimal|/udev|/drbd'`
     2331    needlist=$MINDI_TMP/what-we-need.txt
     2332    mkdir -p $bigdir/usr/bin
     2333    mkdir -p $bigdir/usr/sbin
     2334    includefile=$MINDI_TMP/$$.includefile.txt
     2335
     2336    lfiles=`ls $DEPLIST_DIR/* | grep -v /minimal`
    23452337    if [ -e "$DEPLIST_FILE" ]; then
    23462338        lfiles="$DEPLIST_FILE $lfiles"
    23472339    fi
     2340    lines=`grep -vx " *#.*" $lfiles | grep -vx "" | wc -l`
    23482341    ParseModprobeForIncludes $includefile
    2349     ListKernelModulePaths > $needlist
    2350     for f in $lfiles $includefile $needlist; do
    2351         CopyFromConf $f $targetdir
    2352     done
     2342    lines=$(($lines+`cat $includefile | wc -l`))
     2343    cat $lfiles $includefile | GenerateGiantDependencyList $needlist $lines
     2344    res=$?
    23532345    rm -f $includefile
    2354 
     2346    ListKernelModulePaths >> $needlist
     2347    if [ "$res" -ne "0" ] ; then
     2348        Die "You have $res files present in dependency list\nbut absent from filesystem."
     2349    fi
     2350    mkdir -p $bigdir/tmp
    23552351    if [ _"$MONDO_SHARE" != _"" ]; then
    23562352        # TODO: no reason to have the cfg file stored twice
     
    23632359
    23642360    [ -d "/mnt/.boot.d" ] && echo "GENTOO" > $bigdir/tmp/DUMBASS-GENTOO
     2361    DropOptimizedLibraries $needlist $bigdir
     2362    echo -en "INFO: Assembling dependency files"
     2363
     2364    CopyDependenciesToDirectory < $needlist $bigdir `wc -l $needlist` 1
     2365    rm -f $needlist
     2366    echo -e "$DONE"
    23652367
    23662368    # also copy io.sys and msdos.sys, if we can find them
     
    23932395    done
    23942396    if [ -e "$MONDO_SHARE/restore-scripts" ]; then
    2395         mkdir -p $bigdir/usr/bin $bigdir/etc
    23962397        cp -Rdf $MONDO_SHARE/restore-scripts/mondo/* $bigdir/usr/bin 2>> $LOGFILE
    23972398        [ $? -ne 0 ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     
    24482449    PrepareBootDir
    24492450
    2450     LogFile "---------------------------"
    2451     LogFile "Content of initial bigdir:"
    2452     LogFile "---------------------------- "
    2453     (cd "$bigdir" ; ls -Rla ) >> $LOGFILE
    2454     LogFile "---------------------------"
    24552451}
    24562452
     
    25392535        file $fname | grep -q gzip
    25402536        if [ $? -eq 0 ] ; then
    2541             # Used by ia64
    25422537            fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"`
    25432538        else
     
    25482543
    25492544
    2550 # WARNING: This function must just echo the final result !!!
     2545# WARNING: This function should just echo the final result !!!
    25512546#
    25522547TryToFindKernelPath() {
     
    25572552    duff_kernels=""
    25582553    output=""
    2559 
    2560     if [ "$ARCH" = "ia64" ] ; then
    2561        root="/boot/efi/efi"
    2562     else
    2563        root="/"
    2564     fi
     2554    root="/"
    25652555    # See if we're booted from a Xen kernel
    25662556    # From http://wiki.xensource.com/xenwiki/XenCommonProblems#head-26434581604cc8357d9762aaaf040e8d87b37752
     
    25822572        file $fname | grep -q gzip
    25832573        if [ $? -eq 0 ] ; then
    2584             # Used by ia64
    25852574            if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then
    25862575                LogFile "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it..."
     
    26942683    conf=$1
    26952684    mp=$2
    2696     if [ ! -e $conf ]; then
    2697         # Invoked with a conf file short name fixing...
    2698         conf="$DEPLIST_DIR/$1.conf"
    2699     fi
    2700     if [ ! -e $conf ]; then
    2701         LogAll "Unable to find conf file $conf please report upstream"
    2702         return
    2703     fi
    2704     bconf=`basename $conf .conf`
    2705     echo -en "INFO: Gathering dependencies of $bconf..."
    2706     LogFile "INFO: Gathering dependencies of $conf..."
    2707     lis2=`grep -Ev '^#' $conf | sort -u`
     2685    echo -en "INFO: Gathering dependencies of $conf.conf..."
     2686    LogFile "INFO: Gathering dependencies of $conf.conf..."
     2687    lis2=`grep -Ev '^#' $DEPLIST_DIR/$conf.conf | sort -u`
    27082688    noof_lines=`echo $lis2 | wc -w`
    27092689    progress=0
    2710     LogFile "DEBUG: targetdir: `ls -l $mp/`"
    2711     LogFile "DEBUG: lis2=$lis2"
    27122690    # Get only the files which exist in that list
    27132691    # and potentially their symlink structure
    27142692    # put apart directories for later handling
    2715     touch $MINDI_TMP/$bconf.lis $MINDI_TMP/$bconf.lis2
    27162693    for f in $lis2; do
    27172694        if [ -d $f ]; then
    27182695            for g in `find $f`; do
    2719                 echo $g >> $MINDI_TMP/$bconf.lis
    2720                 LocateDeps $g  >> $MINDI_TMP/$bconf.lis2
     2696                echo $g >> $MINDI_TMP/$conf.lis
     2697                LocateDeps $g  >> $MINDI_TMP/$conf.lis2
    27212698            done
    27222699            lis3="$lis3 $f"
    27232700        else
    27242701            if [ -r $f ]; then
    2725                 echo $f >> $MINDI_TMP/$bconf.lis
    2726                 LocateDeps $f >> $MINDI_TMP/$bconf.lis2
     2702                echo $f >> $MINDI_TMP/$conf.lis
     2703                LocateDeps $f >> $MINDI_TMP/$conf.lis2
    27272704            fi
    27282705        fi
     
    27302707        LogProgress $progress $noof_lines
    27312708    done
    2732     LogFile "DEBUG: lis3=$lis3"
    2733     #LogAll "INFO: Processing all dependencies links for $conf..."
     2709    echo -e "$DONE"
     2710    LogAll "INFO: Processing all dependencies links for $conf.conf..."
    27342711    # And their deps except dirs
    2735     lines=`sort -u $MINDI_TMP/$bconf.lis $MINDI_TMP/$bconf.lis2`
    2736     rm -f $MINDI_TMP/$bconf.lis2
     2712    lines=`sort -u $MINDI_TMP/$conf.lis $MINDI_TMP/$conf.lis2`
     2713    rm -f $MINDI_TMP/$conf.lis2
    27372714    finallist=""
    27382715    # Remove directories from the list, as cp will create them anyway
     
    27402717    # recent bash says that -d is true for a link to a dir !
    27412718    for f in $lines; do
    2742         LogFile "DEBUG: f=$f"
    27432719        if [ -e "$f" -a ! -d "$f" ] || [ -h "$f" ]; then
    2744             LogFile "DEBUG: Test OK"
    27452720            # Do not overwrite files already in destination (avoid using option -n of cp not portable)
    27462721            if [ ! -e "$mp/$f" ]; then
    27472722                finallist="$finallist $f"
    2748                 LogFile "DEBUG: Creating $mp/$f"
    2749             else
    2750                 LogFile "DEBUG: Target exist `ls -al $mp/$f`"
    27512723            fi
    27522724        fi
    27532725    done
    2754     LogFile "DEBUG: finallist=$finallist"
    27552726    # But adds the directory useful in $lis3
    27562727    fnllist=`echo $finallist $lis3 | tr ' ' '\n' | sort -u | tr '\n' ' '`
    2757     echo -e "$DONE"
    2758     if [ _"$fnllist" != _"" ] && [ _"$fnllist" != _" " ]; then
    2759         LogFile "INFO: Copying $conf related files with cp -a --parents $fnllist -t $mp/"
    2760         cp -a --parents $fnllist -t $mp/ 2>$templog  || LogAll "WARNING: Problem in $conf analysis" $templog
    2761     fi
    2762     rm -f $MINDI_TMP/$bconf.lis
     2728    LogFile "INFO: Copying $conf related files with cp -a --parents $fnllist -t $mp/"
     2729    cp -a --parents $fnllist -t $mp/ 2> $templog  || LogAll "WARNING: Problem in $conf analysis" $templog
     2730    rm -f $MINDI_TMP/$conf.lis
    27632731}
    27642732
     
    27732741    > $templog
    27742742
     2743    mkdir -p $targetdir
    27752744    # Check whether /lib64 or /lib or /sbin or /bin is a link and if so explicitly create one in rootfs (Fedora 17 crazyness)
    27762745    for d in bin sbin lib lib64; do
     
    27782747            thelink=`readlink /$d`
    27792748            mkdir -p $targetdir/$thelink || LogAll "ERROR: Unable to create $thelink in $targetdir"
    2780             mv $targetdir/$d/* $targetdir/$d/.??* $targetdir/$thelink
     2749            mv $targetdir/$d/* $targetdir/$d/.??* $targetdir/$thelink 2> /dev/null
    27812750            if [ -d "$targetdir/$d" -a ! -h "$targetdir/$d" ]; then
    27822751                rmdir $targetdir/$d
     
    30302999
    30313000    mkdir -p $targetdir/proc
    3032     cp -a $MY_FSTAB $targetdir/tmp
    30333001    LogFile "---------------------------"
    30343002    LogFile "Content of initial targetdir:"
     
    32223190fi
    32233191
    3224 ### TODO
    3225 ### Fix as it's not mandatory on ia64
    3226 if [ "$ARCH" = "ia64" ] ; then
    3227     if which elilo &> /dev/null ; then
    3228         LILO_EXE=elilo
    3229     else
    3230         LILO_EXE=`which false 2> /dev/null`
    3231     fi
    3232 else
    3233     FindIsolinuxBinary
    3234 fi
     3192FindIsolinuxBinary
    32353193trap "Aborted" SIGTERM
    32363194DONE="\r\t\t\t\t\t\t\t\tDone.         "
     
    37153673    LogAll "INFO: Mindi Finished"
    37163674elif [ "$TAPEDEV" ] ; then
    3717     if [ "$ARCH" != "ia64" ] ; then
    3718         # We need to keep the img file as boot file for ia64 platform
    3719         rm -f $MINDI_CACHE/{*img,*iso}
    3720     else
    3721         rm -f $MINDI_CACHE/*iso
    3722     fi
     3675    rm -f $MINDI_CACHE/*iso
    37233676    if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then
    37243677        OfferToMakeBootableUSB
Note: See TracChangeset for help on using the changeset viewer.