Changeset 1939 in MondoRescue for branches/stable/mindi/mindi


Ignore:
Timestamp:
May 17, 2008, 1:29:54 AM (16 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 1923:1938 $SVN_M/branches/2.2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r1924 r1939  
    108108
    109109BOOT_MEDIA_MESSAGE="$mindi_boot_msg"
    110 
    111110FDISK=$MINDI_SBIN/parted2fdisk
    112111
     
    172171
    173172    mkdir -p $bigdir/etc
    174     #cp --parents -pRdf $mappath $bigdir 2>> $LOGFILE || LogIt "AKMF -- Could not copy $mappath to $bigdir"
    175173    tar cf - $mappath 2>> /dev/null | (cd $bigdir ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir"
    176174    if [ "`echo $mappath | grep -F ".gz"`" ] ; then
     
    282280                BIGNO=$(($BIGNO+1))
    283281            else
    284                 #cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
    285282                tar cf - $incoming 2> /dev/null | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"
    286283   
     
    299296        incoming=`ReadLine`
    300297    done
    301 }
    302 
    303 
    304 CopyImageToDisk() {
    305     local image dev procno res comment
    306     image=$1
    307     dev=$2
    308     comment=$3
    309     [ ! -f "$image" ] && [ ! -b "$image" ] && Die "Image $image does not exist. Did you run out of disk space?"
    310     Prompt "About to write $comment. Please press ENTER."
    311     echo -en "Formatting disk..."
    312     if which fdformat > /dev/null ; then
    313         fdformat -n $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"
    314     elif which superformat > /dev/null ; then
    315         superformat $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"
    316     else
    317         Die "Please install either fdformat or superformat."
    318     fi
    319     echo -en "\nWriting $comment"
    320     if echo $image | grep "mindi-[r|b]oot\.1440" &> /dev/null ; then
    321         cat $image > $dev &
    322     else
    323         dd if=$image of=$dev &> /dev/null &
    324     fi
    325     procno=$!
    326     ps $procno > /dev/null 2> /dev/null
    327     while [ "$?" -eq "0" ] ; do
    328         sleep 3
    329         echo -en "."
    330         ps $procno > /dev/null 2> /dev/null
    331     done
    332     echo -e "$DONE"
    333     LogIt "$comment has been written."
    334298}
    335299
     
    14391403    MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt
    14401404    cp $kernelpath $MINDI_TMP/iso/isolinux/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/isolinux/vmlinuz). Did you run out of disk space?"
    1441     cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE
     1405    cp $MINDI_TMP/mindi.rdz $MINDI_TMP/iso/isolinux/initrd.img 2>> $LOGFILE || Die "Cannot copy mindi.rdz ($MINDI_TMP/mindi.rdz) to $MINDI_TMP/iso/isolinux/initrd.img. Did you run out of disk space?"
    14421406    if [ _"$MONDO_SHARE" != _"" ]; then
    1443         cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"/dev/null
    1444         cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE || Die "Cannot copy mindi.rdz ($MINDI_TMP/mindi.rdz) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
    1445 
     1407        cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?"
     1408        cp $MINDI_TMP/mindi.rdz $MONDO_ROOT/initrd.img 2>> $LOGFILE || Die "Cannot copy mindi.rdz ($MINDI_TMP/mindi.rdz) to $MONDO_ROOT/initrd.img. Did you run out of disk space?"
    14461409    fi
    14471410    [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur"
     
    19601923        cd $MINDI_TMP
    19611924        for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do
    1962             #cp --parents -pRdf ./$i $bigdir 2>> $LOGFILE || Die "PDDI can't cp $i->$bigdir"
    19631925            tar cf - ./$i 2>> $LOGFILE | (cd $bigdir ; tar xf -) || Die "PDDI can't copy $i->$bigdir"
    19641926            if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then
    1965                 #cp --parents -pRdf $i $bigdir 2>> $LOGFILE
    19661927                tar cf - $i 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    19671928            else
     
    19751936            for k in $j ; do
    19761937                if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then
    1977                     #cp --parents -pRdf $k $bigdir 2>> $LOGFILE
    19781938                    tar cf - $k 2>> $LOGFILE | (cd $bigdir ; tar xf -)
    19791939                else
     
    23522312        s=`which $w 2> /dev/null`
    23532313        if [ -e "$s" ] ; then
    2354             #cp --parents -af $s . 2>> $LOGFILE
    23552314            tar cf - $s 2> /dev/null | tar xf -
    23562315        fi
     
    23622321    file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically"
    23632322    if [ $? -eq 0 ]; then
    2364         # We want to use the real mount
    2365         rm -f bin/mount
    2366         LocateDeps $MINDI_LIB/rootfs/bin/busybox /bin/mount > $MINDI_TMP/busy.lis
    2367         #cp --parents -Rdf `sort -u $MINDI_TMP/busy.lis` .
    2368         tar cf - /bin/mount `sort -u $MINDI_TMP/busy.lis` 2> /dev/null | tar xf -
     2323        # We want to use the real mount and all the supported variants (nfs, cifs, ...)
     2324        rm -f bin/mount $MINDI_TMP/busy.lis
     2325        mountlis=`grep mount $DEPLIST_FILE`
     2326        for f in $MINDI_LIB/rootfs/bin/busybox $mountlis ; do
     2327            if [ -f $f ]; then
     2328                LocateDeps $f >> $MINDI_TMP/busy.lis
     2329            fi
     2330        done
     2331        tar cf - $mountlis `sort -u $MINDI_TMP/busy.lis` 2> /dev/null | tar xf -
    23692332        rm -f $MINDI_TMP/busy.lis
    23702333    fi
     
    23762339        echo "udev device manager found" > $mountpoint/tmp/USE-UDEV
    23772340        LogIt "udev device manager found"
    2378         #cp --parents -Rdf /etc/udev . 2> /dev/null
    23792341        tar cf - /etc/udev 2> /dev/null | tar xf -
    23802342        # This avoids NIC remapping if on another machine at restore time on Debian at least
    23812343        rm -f ./etc/udev/rules.d/z25_persistent-net.rules
    2382         #cp --parents -Rdf /lib/udev /lib64/udev . 2> /dev/null
    23832344        tar cf - /lib*/udev 2> /dev/null | tar xf -
    23842345        if [ -x /sbin/udevd ]; then
     
    24072368                fi
    24082369            done
    2409             #cp --parents -Rdf $lis `sort -u $MINDI_TMP/udev.lis` .
    24102370            tar cf - $lis `sort -u $MINDI_TMP/udev.lis` 2> /dev/null | tar xf -
    24112371            rm -f $MINDI_TMP/udev.lis
     
    24262386            lis=`grep -Ev '^#' $MINDI_CACHE/tools.files`
    24272387            LocateDeps $lis > $MINDI_TMP/tools.lis
    2428             #cp --parents -Rdf $lis `sort -u $MINDI_TMP/tools.lis` .
    24292388            tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2> /dev/null | tar xf -
    24302389        fi
     
    24462405    fi
    24472406
    2448     #cp --parents -Rdf /dev/fd0*[1,2][4,7,8]* . 2> /dev/null
    24492407    tar cf - /dev/fd0*[1,2][4,7,8]* 2> /dev/null | tar xf -
    24502408
     
    24892447        [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i
    24902448        echo "Adding $i ($s KB) to the rootfs" >> $LOGFILE
    2491         #cp --parents -Rpdf $i $mountpoint 2>/dev/null || LogIt "Unable to copy $i to $mountpoint"
    24922449        tar cf - $i 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy $i to $mountpoint"
    24932450        # Uncompress modules if not using udev and native modprobe
     
    25012458
    25022459    # Also copy modules.dep in case of udev so that normal modprobe works
    2503     #cp --parents -Rpdf /$needed_modules_path/modules.dep $mountpoint 2>/dev/null || LogIt "Unable to copy modules.dep to $mountpoint"
    25042460    tar cf - /$needed_modules_path/modules.dep 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint"
    25052461
     
    25502506        ln -sf sbin/init init
    25512507        # create cpio image file and unmount loop filesystem
    2552         find . -print | cpio -o -H newc | gzip -9 > $old_pwd/$rdz_fname 2> /dev/null
     2508        find . -print | cpio -o -H newc | gzip -9 > $rdz_fname 2> /dev/null
    25532509        cd $old_pwd
    25542510        umount $mountpoint || Die "Cannot unmount $tempfile"
Note: See TracChangeset for help on using the changeset viewer.