Changeset 1939 in MondoRescue for branches/stable/mindi/mindi
- Timestamp:
- May 17, 2008, 1:29:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r1924 r1939 108 108 109 109 BOOT_MEDIA_MESSAGE="$mindi_boot_msg" 110 111 110 FDISK=$MINDI_SBIN/parted2fdisk 112 111 … … 172 171 173 172 mkdir -p $bigdir/etc 174 #cp --parents -pRdf $mappath $bigdir 2>> $LOGFILE || LogIt "AKMF -- Could not copy $mappath to $bigdir"175 173 tar cf - $mappath 2>> /dev/null | (cd $bigdir ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir" 176 174 if [ "`echo $mappath | grep -F ".gz"`" ] ; then … … 282 280 BIGNO=$(($BIGNO+1)) 283 281 else 284 #cp --parents -Rdf $incoming $outdir 2> /dev/null || Die "Cannot copy $incoming to $outdir - did you run out of disk space?"285 282 tar cf - $incoming 2> /dev/null | (cd $outdir ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" 286 283 … … 299 296 incoming=`ReadLine` 300 297 done 301 }302 303 304 CopyImageToDisk() {305 local image dev procno res comment306 image=$1307 dev=$2308 comment=$3309 [ ! -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 ; then313 fdformat -n $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"314 elif which superformat > /dev/null ; then315 superformat $dev > /dev/null 2> /dev/null || Die "Cannot format $dev - is your Linux distro broken?"316 else317 Die "Please install either fdformat or superformat."318 fi319 echo -en "\nWriting $comment"320 if echo $image | grep "mindi-[r|b]oot\.1440" &> /dev/null ; then321 cat $image > $dev &322 else323 dd if=$image of=$dev &> /dev/null &324 fi325 procno=$!326 ps $procno > /dev/null 2> /dev/null327 while [ "$?" -eq "0" ] ; do328 sleep 3329 echo -en "."330 ps $procno > /dev/null 2> /dev/null331 done332 echo -e "$DONE"333 LogIt "$comment has been written."334 298 } 335 299 … … 1439 1403 MakeSyslinuxMessageFile $MINDI_TMP/iso/isolinux/message.txt 1440 1404 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?" 1442 1406 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?" 1446 1409 fi 1447 1410 [ -e "$iso_cfg_file" ] || Die "FIXME - unable to find $iso_cfg_file - this should never occur" … … 1960 1923 cd $MINDI_TMP 1961 1924 for i in `ListKernelModulePaths | HackPathsToFailsafe` ; do 1962 #cp --parents -pRdf ./$i $bigdir 2>> $LOGFILE || Die "PDDI can't cp $i->$bigdir"1963 1925 tar cf - ./$i 2>> $LOGFILE | (cd $bigdir ; tar xf -) || Die "PDDI can't copy $i->$bigdir" 1964 1926 if [ "`du -sk $i | cut -f1`" -lt "$(($CHOPSIZE*2))" ] ; then 1965 #cp --parents -pRdf $i $bigdir 2>> $LOGFILE1966 1927 tar cf - $i 2>> $LOGFILE | (cd $bigdir ; tar xf -) 1967 1928 else … … 1975 1936 for k in $j ; do 1976 1937 if [ "`du -sk $k | cut -f1`" -lt "$CHOPSIZE" ] ; then 1977 #cp --parents -pRdf $k $bigdir 2>> $LOGFILE1978 1938 tar cf - $k 2>> $LOGFILE | (cd $bigdir ; tar xf -) 1979 1939 else … … 2352 2312 s=`which $w 2> /dev/null` 2353 2313 if [ -e "$s" ] ; then 2354 #cp --parents -af $s . 2>> $LOGFILE2355 2314 tar cf - $s 2> /dev/null | tar xf - 2356 2315 fi … … 2362 2321 file $MINDI_LIB/rootfs/bin/busybox 2>&1 | grep -q "dynamically" 2363 2322 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 - 2369 2332 rm -f $MINDI_TMP/busy.lis 2370 2333 fi … … 2376 2339 echo "udev device manager found" > $mountpoint/tmp/USE-UDEV 2377 2340 LogIt "udev device manager found" 2378 #cp --parents -Rdf /etc/udev . 2> /dev/null2379 2341 tar cf - /etc/udev 2> /dev/null | tar xf - 2380 2342 # This avoids NIC remapping if on another machine at restore time on Debian at least 2381 2343 rm -f ./etc/udev/rules.d/z25_persistent-net.rules 2382 #cp --parents -Rdf /lib/udev /lib64/udev . 2> /dev/null2383 2344 tar cf - /lib*/udev 2> /dev/null | tar xf - 2384 2345 if [ -x /sbin/udevd ]; then … … 2407 2368 fi 2408 2369 done 2409 #cp --parents -Rdf $lis `sort -u $MINDI_TMP/udev.lis` .2410 2370 tar cf - $lis `sort -u $MINDI_TMP/udev.lis` 2> /dev/null | tar xf - 2411 2371 rm -f $MINDI_TMP/udev.lis … … 2426 2386 lis=`grep -Ev '^#' $MINDI_CACHE/tools.files` 2427 2387 LocateDeps $lis > $MINDI_TMP/tools.lis 2428 #cp --parents -Rdf $lis `sort -u $MINDI_TMP/tools.lis` .2429 2388 tar cf - $lis `sort -u $MINDI_TMP/tools.lis` 2> /dev/null | tar xf - 2430 2389 fi … … 2446 2405 fi 2447 2406 2448 #cp --parents -Rdf /dev/fd0*[1,2][4,7,8]* . 2> /dev/null2449 2407 tar cf - /dev/fd0*[1,2][4,7,8]* 2> /dev/null | tar xf - 2450 2408 … … 2489 2447 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2490 2448 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"2492 2449 tar cf - $i 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy $i to $mountpoint" 2493 2450 # Uncompress modules if not using udev and native modprobe … … 2501 2458 2502 2459 # 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"2504 2460 tar cf - /$needed_modules_path/modules.dep 2>/dev/null | (cd $mountpoint ; tar xf -) || LogIt "Unable to copy modules.dep to $mountpoint" 2505 2461 … … 2550 2506 ln -sf sbin/init init 2551 2507 # create cpio image file and unmount loop filesystem 2552 find . -print | cpio -o -H newc | gzip -9 > $ old_pwd/$rdz_fname 2> /dev/null2508 find . -print | cpio -o -H newc | gzip -9 > $rdz_fname 2> /dev/null 2553 2509 cd $old_pwd 2554 2510 umount $mountpoint || Die "Cannot unmount $tempfile"
Note:
See TracChangeset
for help on using the changeset viewer.