Changeset 2092


Ignore:
Timestamp:
Dec 17, 2008, 12:19:16 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • More improvement on logging issues rather than throwing error messages away
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.8/mindi/mindi

    r2089 r2092  
    141141
    142142    mkdir -p $bigdir/etc
    143     tar cf - $mappath 2>> /dev/null | (cd $bigdir ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir"
     143    tar cf - $mappath 2>> $LOGFILE | (cd $bigdir ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir"
    144144    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
    145145        included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2`
     
    184184            find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir
    185185        elif [ -e "$incoming" ] && [ $found = "false" ]; then
    186             tar cf - $incoming 2> /dev/null | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
     186            tar cf - $incoming 2>> $LOGFILE | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
    187187
    188188            # Only uncompress modules if not using udevd
     
    568568            Die "Odd."
    569569        fi
    570         cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW."
     570        cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW."
    571571        if [ -e "$MINDI_TMP/NFS-DEV" ] ; then
    572572            LogIt "\nIncorporating NFS-related settings"
     
    12971297        if [ -e "$j" ] ; then
    12981298            LogIt "Copying $j to $k"
    1299             cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k"
    1300             cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP"
     1299            cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k"
     1300            cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP"
    13011301            if [ _"$MONDO_SHARE" != _"" ]; then
    13021302                cp -f $j $MONDO_ROOT 2>> $LOGFILE || Die "Failed to copy $j to $MONDO_ROOT"
     
    13131313    MakeBootConfFile isolinux > $MINDI_TMP/iso/isolinux.cfg
    13141314    if [ "$ARCH" != "ia64" ] ; then
    1315         cp $ISOLINUX $MINDI_TMP/iso/isolinux.bin 2> /dev/null || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?"
     1315        cp $ISOLINUX $MINDI_TMP/iso/isolinux.bin 2>> $LOGFILE || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?"
    13161316    fi
    13171317    old_pwd=`pwd`
     
    13191319    if [ "$ARCH" != "ia64" ] ; then
    13201320        if [ _"$MONDO_SHARE" != _"" ]; then
    1321             cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2> /dev/null || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
     1321            cp -f $MINDI_TMP/iso/{isolinux.cfg,initrd.img,vmlinuz,isolinux.bin,message.txt} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"
    13221322            cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE
    13231323        fi
     
    14301430        if [ -e "$j" ] ; then
    14311431            LogIt "Copying $j to $k"
    1432             cp -f $j $k 2> /dev/null || Die "Failed to copy $j to $k"
    1433             cp -f $j $MINDI_TMP 2> /dev/null || Die "Failed to copy $j to $MINDI_TMP"
     1432            cp -f $j $k 2>> $LOGFILE || Die "Failed to copy $j to $k"
     1433            cp -f $j $MINDI_TMP 2>> $LOGFILE || Die "Failed to copy $j to $MINDI_TMP"
    14341434        fi
    14351435    done
     
    14371437    MakeMessageFile > $MINDI_TMP/usb/message.txt
    14381438    echo -en "."
    1439     cp $kernelpath $MINDI_TMP/usb/vmlinuz 2> /dev/null || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/usb/vmlinuz). Did you run out of disk space?"
     1439    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?"
    14401440    echo -en "."
    14411441    cp $MINDI_TMP/initrd.img $MINDI_TMP/usb/initrd.img 2>> $LOGFILE
     
    16411641    dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null
    16421642    free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4`
    1643     cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2> /dev/null
     1643    cp -f $kernelpath $mountpoint/vmlinuz > /dev/null 2>> $LOGFILE
    16441644    if [ "$?" -ne "0" ] ; then
    16451645        echo "Files at mountpoint ($mountpoint) :-" >> $LOGFILE
     
    18901890    MakeMountlist $MINDI_TMP/mountlist.txt
    18911891    mkdir -p $bigdir/tmp
    1892     cp -f $MINDI_TMP/mountlist.txt $bigdir/tmp/mountlist.txt 2> /dev/null || Die "Cannot copy mountlist.txt from $MINDI_TMP to data disk"
     1892    cp -f $MINDI_TMP/mountlist.txt $bigdir/tmp/mountlist.txt 2>> $LOGFILE || Die "Cannot copy mountlist.txt from $MINDI_TMP to data disk"
    18931893    if [ _"$MONDO_SHARE" != _"" ]; then
    18941894        cp -f $bigdir/tmp/mountlist.txt $MINDI_TMP/. 2>> $LOGFILE
     
    19021902    fi
    19031903    cat $bigdir/tmp/mountlist.txt >> $LOGFILE
    1904     echo -en "$FILES_IN_FILELIST" > $bigdir/FILES-IN-FILELIST 2> /dev/null
    1905     echo -en "$LAST_FILELIST_NUMBER" > $bigdir/LAST-FILELIST-NUMBER 2> /dev/null
     1904    echo -en "$FILES_IN_FILELIST" > $bigdir/FILES-IN-FILELIST 2>> $LOGFILE
     1905    echo -en "$LAST_FILELIST_NUMBER" > $bigdir/LAST-FILELIST-NUMBER 2>> $LOGFILE
    19061906    if [ _"$MONDO_SHARE" != _"" ]; then
    19071907        for q in filelist.full.gz biggielist.txt ; do
     
    19131913    echo -en "Tarring and zipping the data content..."
    19141914    size_of_all_tools=`du -sk $bigdir | cut -f1`
    1915     (cd $bigdir ; tar -b 4096 -cf - . 2> /dev/null | gzip -9 > $imagesdir/all.tar.gz)
     1915    (cd $bigdir ; tar -b 4096 -cf - . 2>> $LOGFILE | gzip -9 > $imagesdir/all.tar.gz)
    19161916    du -sk $imagesdir/*gz >> $LOGFILE
    19171917    echo -e "$DONE"
     
    21942194            fi
    21952195        done
    2196         tar cf - $mountlis `sort -u $MINDI_TMP/busy.lis` 2> /dev/null | tar xf -
     2196        tar cf - $mountlis `sort -u $MINDI_TMP/busy.lis` 2>> $LOGFILE | tar xf -
    21972197        rm -f $MINDI_TMP/busy.lis
    21982198    fi
     
    22072207        echo "udev device manager found" > $mountpoint/tmp/USE-UDEV
    22082208        LogIt "udev device manager found"
    2209         tar cf - /etc/udev 2> /dev/null | tar xf -
     2209        tar cf - /etc/udev 2>> $LOGFILE | tar xf -
    22102210        # This avoids NIC remapping if on another machine at restore time on Debian at least
    22112211        rm -f ./etc/udev/rules.d/z??_persistent-net.rules
    2212         tar cf - /lib*/udev 2> /dev/null | tar xf -
     2212        tar cf - /lib*/udev 2>> $LOGFILE | tar xf -
    22132213        if [ -x /sbin/udevd ]; then
    22142214            lis2=`grep -Ev '^#' $MINDI_CONF/udev.files`
     
    22362236                fi
    22372237            done
    2238             tar cf - $lis `sort -u $MINDI_TMP/udev.lis` 2> /dev/null | tar xf -
     2238            tar cf - $lis `sort -u $MINDI_TMP/udev.lis` 2>> $LOGFILE | tar xf -
    22392239            rm -f $MINDI_TMP/udev.lis
    22402240        else
     
    22542254            lis=`grep -Ev '^#' $MINDI_CACHE/tools.files`
    22552255            LocateDeps $lis > $MINDI_TMP/tools.lis
    2256             tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2> /dev/null | tar xf -
     2256            tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2>> $LOGFILE | tar xf -
    22572257        fi
    22582258        if [ -f $MINDI_CACHE/mindi-rsthw ]; then
     
    22672267    done
    22682268
    2269     tar cf - /dev/fd0*[1,2][4,7,8]* 2> /dev/null | tar xf -
     2269    tar cf - /dev/fd0*[1,2][4,7,8]* 2>> $LOGFILE | tar xf -
    22702270
    22712271    cd $old_pwd
     
    23092309        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
    23102310        echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    2311         tar cf - $i 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy $i to $mountpoint"
     2311        tar cf - $i 2>> $LOGFILE | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy $i to $mountpoint"
    23122312        # Uncompress modules if not using udev and native modprobe
    23132313        if [ ! -f $mountpoint/tmp/USE-UDEV ]; then
     
    23202320
    23212321    # Also copy modules.dep in case of udev so that normal modprobe works
    2322     tar cf - /$needed_modules_path/modules.dep 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint"
     2322    tar cf - /$needed_modules_path/modules.dep 2>> $LOGFILE | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint"
    23232323
    23242324    if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ] ; then
     
    23342334    if [ _"$MONDO_SHARE" != _"" ]; then
    23352335        MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg
    2336         cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null
    2337         cp -f $MINDI_TMP/mountlist.txt $mountpoint/tmp/ 2>/dev/null || Die "Cannot copy mountlist to ramdisk"
     2336        cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP 2>> $LOGFILE || Die "Cannot copy mondo-restore.cfg to ramdisk"
     2337        cp -f $MINDI_TMP/mountlist.txt $mountpoint/tmp/ 2>> $LOGFILE || Die "Cannot copy mountlist to ramdisk"
    23382338        echo -en "$FILES_IN_FILELIST" > $mountpoint/tmp/FILES-IN-FILELIST
    23392339        echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER
     
    26392639        # Change MINDI_TMP for the one provided by mondo
    26402640        # So that it can get back the built files
    2641         mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2> /dev/null
     2641        mv $MINDI_TMP/* $MINDI_TMP/.??* $MONDO_TMP 2>> $LOGFILE
    26422642        rmdir $MINDI_TMP
    26432643        export MINDI_TMP=$MONDO_TMP
     
    27532753    mkdir -p $MINDI_TMP/small-all/tmp
    27542754    cd $MINDI_TMP/small-all
    2755     cp -f $MINDI_TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp 2>/dev/null || Die "Cannot copy small all.tar.gz"
     2755    cp -f $MINDI_TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp 2>> $LOGFILE || Die "Cannot copy small all.tar.gz"
    27562756    tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz || Die "Cannot make small all.tar.gz"
    27572757    sleep 2
Note: See TracChangeset for help on using the changeset viewer.