Changeset 2712


Ignore:
Timestamp:
Feb 2, 2011, 2:54:11 AM (8 years ago)
Author:
bruno
Message:
  • Fix issus with mindi when launched from a dir containing spaces
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi/mindi

    r2708 r2712  
    223223
    224224    mkdir -p $bigdir/etc
    225     tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd $bigdir ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
     225    tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log
    226226    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    227227        included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     
    266266            find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir
    267267        elif [ -e "$incoming" ] && [ $found = "false" ]; then
    268             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
     268            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
    269269
    270270            # Only uncompress modules if not using udevd
     
    463463    pwd=`pwd`
    464464    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    465         cd $MINDI_TMP
     465        cd "$MINDI_TMP"
    466466    else
    467467        cd /
     
    474474    modpaths=`find $1 -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2 -type f -o -type l`
    475475    echo "$modpaths"
    476     cd $pwd
     476    cd "$pwd"
    477477}
    478478
     
    612612            LogIt "\nIncorporating post-nuke tarball"
    613613            old_pwd=`pwd`
    614             cd $bigdir
     614            cd "$bigdir"
    615615            tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogIt "Error occurred when untarring post-nuke tarball" $MINDI_TMP/$$.log
    616             cd $old_pwd
     616            cd "$old_pwd"
    617617        fi
    618618        if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin 2>> $LOGFILE ; then
     
    757757    incoming=`ReadLine`
    758758    pwd=`pwd`
    759     cd $MINDI_TMP
     759    cd "$MINDI_TMP"
    760760    while [ "$incoming" != "" ] ; do
    761761        stub=`basename $incoming`
     
    766766        read incoming
    767767    done
    768     cd $pwd
     768    cd "$pwd"
    769769}
    770770
     
    14391439    fi
    14401440    old_pwd=`pwd`
    1441     cd $MINDI_TMP/iso
     1441    cd "$MINDI_TMP/iso"
    14421442    if [ "$ARCH" != "ia64" ] ; then
    14431443        if [ _"$MONDO_SHARE" != _"" ]; then
     
    14621462    fi
    14631463    rm -f $MINDI_TMP/mkisofs.log
    1464     cd $old_pwd
     1464    cd "$old_pwd"
    14651465}
    14661466
     
    17841784        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE
    17851785        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    1786         cd $old_pwd
     1786        cd "$old_pwd"
    17871787        umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    17881788        rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
     
    18861886        echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE
    18871887        [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz
    1888         cd $old_pwd
     1888        cd "$old_pwd"
    18891889        umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)"
    18901890        rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)"
     
    19651965    if [ "$YOUR_KERNEL_SUCKS" ]; then
    19661966        pwd=`pwd`
    1967         cd $MINDI_TMP
     1967        cd "$MINDI_TMP"
    19681968        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    1969             tar cf - ./$i 2>> $MINDI_TMP/$$.log | (cd $bigdir ; tar xf -) || Die "PDDI can't copy $i->$bigdir" $MINDI_TMP/$$.log
     1969            tar cf - ./$i 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || Die "PDDI can't copy $i->$bigdir" $MINDI_TMP/$$.log
    19701970        done
    19711971        for i in $EXTRA_MODS ; do
     
    19731973            [ ! "$j" ] && echo "WARNING - cannot find failsafe module $i.o.gz" >> $LOGFILE
    19741974            for k in $j ; do
    1975                 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd $bigdir ; tar xf -) || LogIt "ERROR on module $k" $MINDI_TMP/$$.log
     1975                tar cf - $k 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "ERROR on module $k" $MINDI_TMP/$$.log
    19761976                echo "Added failsafe module $k to ramdisk" >> $LOGFILE
    19771977            done
    19781978        done
    1979         cd $pwd
     1979        cd "$pwd"
    19801980    else
    19811981        ListKernelModulePaths >> $needlist
     
    20172017
    20182018    old_pwd=`pwd`
    2019     cd $bigdir
     2019    cd "$bigdir"
    20202020
    20212021    # Get terminfo content
     
    20322032        tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "Unable to handle /lib/dev-state" $MINDI_TMP/$$.log
    20332033    fi
    2034     cd $old_pwd
     2034    cd "$old_pwd"
    20352035    echo -e "$DONE"
    20362036    TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1`
     
    20702070    echo -en "Tarring and zipping the data content..."
    20712071    size_of_all_tools=`du -sk $bigdir | cut -f1`
    2072     (cd $bigdir ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogIt "Problem creating all.tar.gz" $MINDI_TMP/$$.log)
     2072    (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogIt "Problem creating all.tar.gz" $MINDI_TMP/$$.log)
    20732073    du -sk $imagesdir/*gz >> $LOGFILE
    20742074    echo -e "$DONE"
     
    23712371    echo -en "..."
    23722372    old_pwd=`pwd`
    2373     cd $mountpoint
     2373    cd "$mountpoint"
    23742374
    23752375    # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs
     
    25002500    tar cf - -C / /dev/fd0*[1,2][4,7,8]* 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "Problem in fd dev analysis" $MINDI_TMP/$$.log
    25012501
    2502     cd $old_pwd
     2502    cd "$old_pwd"
    25032503    echo -en "..."
    25042504    old_pwd=`pwd`
    25052505    if [ "$YOUR_KERNEL_SUCKS" ] ; then
    2506         cd $MINDI_TMP
     2506        cd "$MINDI_TMP"
    25072507        needed_modules_path=lib/modules/$FAILSAFE_KVER
    25082508    else
     
    25402540        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
    25412541        echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    2542         tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log
     2542        tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log
    25432543        # Uncompress modules if not using udev and native modprobe
    25442544        if [ ! -f $mountpoint/tmp/USE-UDEV ]; then
     
    25512551
    25522552    # Also copy modules.dep in case of udev so that normal modprobe works
    2553     tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log
     2553    tar cf - -C / /$needed_modules_path/modules.dep 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint" $MINDI_TMP/$$.log
    25542554
    25552555    # Copy FW in case some drivers needs it
     
    25642564        rm -f $mountpoint/sbin/devfsd
    25652565    fi
    2566     cd $old_pwd
     2566    cd "$old_pwd"
    25672567    [ "$TAPEDEV" ] && echo -en "$TAPEDEV" > $mountpoint/tmp/TAPEDEV-LIVES-HERE
    25682568    dd if=/dev/zero of=$mountpoint/zero &> /dev/null
     
    25852585    echo "Content of initial ramdisk:" >> $LOGFILE
    25862586    echo "---------------------------" >> $LOGFILE
    2587     (cd $mountpoint ; ls -Rla ) >> $LOGFILE
     2587    (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE
    25882588    echo "---------------------------" >> $LOGFILE
    25892589
     
    25962596        echo "Creating an $gvFileSystem initrd image..." >> $LOGFILE
    25972597        # kernel expects linuxrc in ext2 filesystem
    2598         ( cd $mountpoint && ln -sf sbin/init linuxrc )
     2598        ( cd "$mountpoint" && ln -sf sbin/init linuxrc )
    25992599        # unmount loop filesystem and create image file using the standard approach
    26002600        umount $mountpoint || Die "Cannot unmount $tempfile"
     
    26122612        which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again."
    26132613        # go into filesystem
    2614         cd $mountpoint
     2614        cd "$mountpoint"
    26152615        # kernel expects init in cpio filesystem
    26162616        ln -sf sbin/init init
    26172617        # create cpio image file and unmount loop filesystem
    26182618        find . -print | cpio -o -H newc | gzip -9 > $rdz_fname 2> /dev/null
    2619         cd $old_pwd
     2619        cd "$old_pwd"
    26202620        umount $mountpoint || Die "Cannot unmount $tempfile"
    26212621        # log that we are done
     
    30013001    CheckMountlist $MINDI_TMP/mountlist.txt
    30023002    mkdir -p $MINDI_TMP/small-all/tmp
    3003     cd $MINDI_TMP/small-all
     3003    cd "$MINDI_TMP/small-all"
    30043004    cp -f $MINDI_TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp 2>> $LOGFILE || Die "Cannot copy small all.tar.gz"
    30053005    tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz 2>> $MINDI_TMP/$$.log || Die "Cannot make small all.tar.gz" $MINDI_TMP/$$.log
     
    30453045        LogIt "disks then it may still be a result of a problem with your kernel.\n"
    30463046        pwd=`pwd`
    3047         cd $MINDI_TMP
     3047        cd "$MINDI_TMP"
    30483048        mkdir -p lib/modules
    30493049        cp -a "/lib/modules/$FAILSAFE_KVER" "lib/modules/$FAILSAFE_KVER" || Die "Cannot copy kernel modules."
    3050         cd $pwd
     3050        cd "$pwd"
    30513051    else
    30523052        kernelpath=$MINDI_LIB/vmlinuz
     
    30553055        LogIt "disks then it may still be a result of a problem with your kernel."
    30563056        pwd=`pwd`
    3057         cd $MINDI_TMP
     3057        cd "$MINDI_TMP"
    30583058        bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2"
    3059         cd $pwd
     3059        cd "$pwd"
    30603060    fi
    30613061    YOUR_KERNEL_SUCKS="Your kernel sucks"
Note: See TracChangeset for help on using the changeset viewer.