Changeset 2712 in MondoRescue
- Timestamp:
- Feb 2, 2011, 2:54:11 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi/mindi
r2708 r2712 223 223 224 224 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/$$.log225 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log 226 226 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 227 227 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` … … 266 266 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 267 267 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/$$.log268 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 269 269 270 270 # Only uncompress modules if not using udevd … … 463 463 pwd=`pwd` 464 464 if [ "$YOUR_KERNEL_SUCKS" ] ; then 465 cd $MINDI_TMP465 cd "$MINDI_TMP" 466 466 else 467 467 cd / … … 474 474 modpaths=`find $1 -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2 -type f -o -type l` 475 475 echo "$modpaths" 476 cd $pwd476 cd "$pwd" 477 477 } 478 478 … … 612 612 LogIt "\nIncorporating post-nuke tarball" 613 613 old_pwd=`pwd` 614 cd $bigdir614 cd "$bigdir" 615 615 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_pwd616 cd "$old_pwd" 617 617 fi 618 618 if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin 2>> $LOGFILE ; then … … 757 757 incoming=`ReadLine` 758 758 pwd=`pwd` 759 cd $MINDI_TMP759 cd "$MINDI_TMP" 760 760 while [ "$incoming" != "" ] ; do 761 761 stub=`basename $incoming` … … 766 766 read incoming 767 767 done 768 cd $pwd768 cd "$pwd" 769 769 } 770 770 … … 1439 1439 fi 1440 1440 old_pwd=`pwd` 1441 cd $MINDI_TMP/iso1441 cd "$MINDI_TMP/iso" 1442 1442 if [ "$ARCH" != "ia64" ] ; then 1443 1443 if [ _"$MONDO_SHARE" != _"" ]; then … … 1462 1462 fi 1463 1463 rm -f $MINDI_TMP/mkisofs.log 1464 cd $old_pwd1464 cd "$old_pwd" 1465 1465 } 1466 1466 … … 1784 1784 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE 1785 1785 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1786 cd $old_pwd1786 cd "$old_pwd" 1787 1787 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1788 1788 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" … … 1886 1886 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE 1887 1887 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1888 cd $old_pwd1888 cd "$old_pwd" 1889 1889 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1890 1890 rmdir $mountpoint || LogIt "Cannot rmdir (PBDI)" … … 1965 1965 if [ "$YOUR_KERNEL_SUCKS" ]; then 1966 1966 pwd=`pwd` 1967 cd $MINDI_TMP1967 cd "$MINDI_TMP" 1968 1968 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/$$.log1969 tar cf - ./$i 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || Die "PDDI can't copy $i->$bigdir" $MINDI_TMP/$$.log 1970 1970 done 1971 1971 for i in $EXTRA_MODS ; do … … 1973 1973 [ ! "$j" ] && echo "WARNING - cannot find failsafe module $i.o.gz" >> $LOGFILE 1974 1974 for k in $j ; do 1975 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd $bigdir; tar xf -) || LogIt "ERROR on module $k" $MINDI_TMP/$$.log1975 tar cf - $k 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogIt "ERROR on module $k" $MINDI_TMP/$$.log 1976 1976 echo "Added failsafe module $k to ramdisk" >> $LOGFILE 1977 1977 done 1978 1978 done 1979 cd $pwd1979 cd "$pwd" 1980 1980 else 1981 1981 ListKernelModulePaths >> $needlist … … 2017 2017 2018 2018 old_pwd=`pwd` 2019 cd $bigdir2019 cd "$bigdir" 2020 2020 2021 2021 # Get terminfo content … … 2032 2032 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogIt "Unable to handle /lib/dev-state" $MINDI_TMP/$$.log 2033 2033 fi 2034 cd $old_pwd2034 cd "$old_pwd" 2035 2035 echo -e "$DONE" 2036 2036 TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1` … … 2070 2070 echo -en "Tarring and zipping the data content..." 2071 2071 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) 2073 2073 du -sk $imagesdir/*gz >> $LOGFILE 2074 2074 echo -e "$DONE" … … 2371 2371 echo -en "..." 2372 2372 old_pwd=`pwd` 2373 cd $mountpoint2373 cd "$mountpoint" 2374 2374 2375 2375 # AL04Oct08: Check whether /lib64 is a link and if so explicitly create one in rootfs … … 2500 2500 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 2501 2501 2502 cd $old_pwd2502 cd "$old_pwd" 2503 2503 echo -en "..." 2504 2504 old_pwd=`pwd` 2505 2505 if [ "$YOUR_KERNEL_SUCKS" ] ; then 2506 cd $MINDI_TMP2506 cd "$MINDI_TMP" 2507 2507 needed_modules_path=lib/modules/$FAILSAFE_KVER 2508 2508 else … … 2540 2540 [ "$YOUR_KERNEL_SUCKS" ] && i=$MINDI_TMP/$i 2541 2541 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/$$.log2542 tar cf - -C / $i 2>> $MINDI_TMP/$$.log | (cd "$mountpoint" ; tar xf -) || LogIt "Unable to copy $i to $mountpoint" $MINDI_TMP/$$.log 2543 2543 # Uncompress modules if not using udev and native modprobe 2544 2544 if [ ! -f $mountpoint/tmp/USE-UDEV ]; then … … 2551 2551 2552 2552 # 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/$$.log2553 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 2554 2554 2555 2555 # Copy FW in case some drivers needs it … … 2564 2564 rm -f $mountpoint/sbin/devfsd 2565 2565 fi 2566 cd $old_pwd2566 cd "$old_pwd" 2567 2567 [ "$TAPEDEV" ] && echo -en "$TAPEDEV" > $mountpoint/tmp/TAPEDEV-LIVES-HERE 2568 2568 dd if=/dev/zero of=$mountpoint/zero &> /dev/null … … 2585 2585 echo "Content of initial ramdisk:" >> $LOGFILE 2586 2586 echo "---------------------------" >> $LOGFILE 2587 (cd $mountpoint; ls -Rla ) >> $LOGFILE2587 (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE 2588 2588 echo "---------------------------" >> $LOGFILE 2589 2589 … … 2596 2596 echo "Creating an $gvFileSystem initrd image..." >> $LOGFILE 2597 2597 # kernel expects linuxrc in ext2 filesystem 2598 ( cd $mountpoint&& ln -sf sbin/init linuxrc )2598 ( cd "$mountpoint" && ln -sf sbin/init linuxrc ) 2599 2599 # unmount loop filesystem and create image file using the standard approach 2600 2600 umount $mountpoint || Die "Cannot unmount $tempfile" … … 2612 2612 which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again." 2613 2613 # go into filesystem 2614 cd $mountpoint2614 cd "$mountpoint" 2615 2615 # kernel expects init in cpio filesystem 2616 2616 ln -sf sbin/init init 2617 2617 # create cpio image file and unmount loop filesystem 2618 2618 find . -print | cpio -o -H newc | gzip -9 > $rdz_fname 2> /dev/null 2619 cd $old_pwd2619 cd "$old_pwd" 2620 2620 umount $mountpoint || Die "Cannot unmount $tempfile" 2621 2621 # log that we are done … … 3001 3001 CheckMountlist $MINDI_TMP/mountlist.txt 3002 3002 mkdir -p $MINDI_TMP/small-all/tmp 3003 cd $MINDI_TMP/small-all3003 cd "$MINDI_TMP/small-all" 3004 3004 cp -f $MINDI_TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp 2>> $LOGFILE || Die "Cannot copy small all.tar.gz" 3005 3005 tar -cv ./tmp | gzip -9 > $MINDI_TMP/all.tar.gz 2>> $MINDI_TMP/$$.log || Die "Cannot make small all.tar.gz" $MINDI_TMP/$$.log … … 3045 3045 LogIt "disks then it may still be a result of a problem with your kernel.\n" 3046 3046 pwd=`pwd` 3047 cd $MINDI_TMP3047 cd "$MINDI_TMP" 3048 3048 mkdir -p lib/modules 3049 3049 cp -a "/lib/modules/$FAILSAFE_KVER" "lib/modules/$FAILSAFE_KVER" || Die "Cannot copy kernel modules." 3050 cd $pwd3050 cd "$pwd" 3051 3051 else 3052 3052 kernelpath=$MINDI_LIB/vmlinuz … … 3055 3055 LogIt "disks then it may still be a result of a problem with your kernel." 3056 3056 pwd=`pwd` 3057 cd $MINDI_TMP3057 cd "$MINDI_TMP" 3058 3058 bzip2 -dc $MINDI_LIB/lib.tar.bz2 | tar -x || Die "Cannot unzip lib.tar.bz2" 3059 cd $pwd3059 cd "$pwd" 3060 3060 fi 3061 3061 YOUR_KERNEL_SUCKS="Your kernel sucks"
Note:
See TracChangeset
for help on using the changeset viewer.