Changeset 3887 in MondoRescue for branches/3.3/mindi/mindi
- Timestamp:
- Mar 10, 2024, 7:26:10 PM (8 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi/mindi
r3843 r3887 13 13 #----------------------------------------------------------------------------- 14 14 15 ### Which arch are we on (useful for ia64 port)15 ### Which arch are we on 16 16 ARCH=`/bin/uname -m` 17 17 KERVERRUN=`/bin/uname -r` … … 302 302 local outdir incoming counter d found tdir templog 303 303 outdir=$1 304 noof_lines=$2305 counter=$3306 304 templog=$MINDI_TMP/$$.log 307 305 mkdir -p $outdir 308 306 incoming=`ReadLine` 307 counter=$3 309 308 > $templog 310 309 311 310 while [ "$incoming" != "" ] ; do 312 LogFile "DEBUG: Handling $incoming" 313 if [ "$noof_lines" != "0" ]; then 311 if [ "$3" = "1" ]; then 314 312 counter=$(($counter+1)) 315 LogProgress $counter $ noof_lines313 LogProgress $counter $2 316 314 fi 317 315 # Non absolute file names should not arrive till here => skipped 318 316 if [ `echo "$incoming" | cut -c1` != '/' ]; then 319 Log All "WARNING: Unable to handle $incoming"317 LogFile "WARNING: Unable to handle non-full pathname $incoming" 320 318 incoming=`ReadLine` 321 319 continue 322 320 fi 323 if [ -e "$incoming" ]; then324 LogFile "DEBUG: Adding $incoming"325 listfile="$listfile $incoming"326 fi327 incoming=`ReadLine`328 done329 330 LogAll "Creating mindi tar file"331 tar cf - -C / $listfile 2> $templog | (cd "$outdir" ; tar xf -) # || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $templog332 }333 334 bidon() {335 336 321 # no parent directory of incoming should be a link, copy is not possible in that case 337 322 d=`dirname "$incoming"` 338 323 found="false" 339 324 while [ $d != "/" -a $found = "false" ]; do 340 if [ -h "$d" ]; then 341 found="true" 342 LogFile "WARNING: skipping $d as link" 343 incoming=`ReadLine` 344 continue 345 fi 325 [ -h "$d" ] && found="true" 346 326 d=`dirname "$d"` 347 327 done 348 349 328 if [ -d "$incoming" -a ! -h "$incoming" ]; then 350 LogFile "DEBUG: Finding in $incoming" 351 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 0 329 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 0 352 330 elif [ -e "$incoming" ] && [ $found = "false" ]; then 353 331 if [ ! -h "$incoming" ]; then 354 LogFile "DEBUG: Tarring $incoming"355 332 tar cf - -C / $incoming 2> $templog | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $templog 356 333 else 357 LogFile "DEBUG: Copying $incoming"358 334 tdir=`dirname "$incoming"` 359 335 if [ ! -e "$outdir/$tdir" ]; then … … 364 340 # Only uncompress modules if not using udevd 365 341 if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then 366 342 gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming" 367 343 fi 368 344 [ -x "$outdir" ] && StripExecutable $outdir 369 345 fi 370 346 incoming=`ReadLine` 347 done 371 348 } 372 349 … … 379 356 done 380 357 echo $r 358 } 359 360 361 DropOptimizedLibraries() { 362 local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res 363 filelist=$1 364 outdir=$2 365 366 list_of_optimized_libraries=`grep "lib/i[5-7]86/" $filelist` 367 if [ "$list_of_optimized_libraries" = "" ] ; then 368 return 0 369 fi 370 echo -en "Dropping i686-optimized libraries if appropriate" 371 for optimized_lib_name in $list_of_optimized_libraries ; do 372 echo -en "." 373 reason="" 374 vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 375 echo "$vanilla_lib_name" >> $filelist 376 LogFile "INFO: Adding $vanilla_lib_name to filelist" 377 mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null 378 rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null 379 380 # This may return multiple files 381 for resolved in `mr-read-all-link $vanilla_lib_name`; do 382 LogFile "INFO: Adding as deps $resolved to filelist" 383 vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'` 384 if [ "$vanilla_resolved_name" != "$resolved" ]; then 385 mkdir -p $outdir$resolved> /dev/null 2> /dev/null 386 rmdir $outdir$resolved > /dev/null 2> /dev/null 387 ln -sf $vanilla_resolved_name $outdir$resolved 388 LogFile "INFO: Excluding deps $resolved" 389 grep -Fvx "$resolved" "$filelist" > $filelist.tmp 390 LogFile "INFO: Replacing it with $vanilla_resolved_name" 391 echo "$vanilla_resolved_name" >> $filelist.tmp 392 mv -f $filelist.tmp $filelist 393 fi 394 done 395 done 396 $AWK '{ print $1; }' $filelist | sort -u > $filelist.tmp 397 mv -f $filelist.tmp $filelist 398 echo -e "$DONE" 381 399 } 382 400 … … 1159 1177 [ "`echo $uname | grep "2.6.19"`" != "" ] && skip=1052 1160 1178 [ "`echo $uname | grep "2.6.[2-9]"`" != "" ] && skip=1052 1161 [ "`echo $uname | grep " [3-6].[0-9]*.[0-9]*"`" != "" ] && skip=10521179 [ "`echo $uname | grep "3.[0-9]*.[0-9]*"`" != "" ] && skip=1052 1162 1180 if [ $skip = "" ]; then 1163 1181 Die "Your kernel is too old. I don't know how to support labelled swap spaces with it" … … 1629 1647 fi 1630 1648 1631 if [ "$ARCH" != "ia64" ] ; then 1632 if [ $KERNEL_IS_XEN = "yes" ]; then 1633 FindMboot32Binary 1634 cp $xenkernelpath $MINDI_TMP/target/xen.gz 2>> $LOGFILE 1635 if [ $? -ne 0 ] ; then 1636 LogAll "ERROR: Failed to copy $xenkernelpath to $MINDI_TMP/target/" 1637 retval=$(($retval+1)) 1638 fi 1639 cp $MBOOTC32 $MINDI_TMP/target/$tbc/mboot.c32 2>> $LOGFILE 1640 if [ $? -ne 0 ] ; then 1641 LogAll "ERROR: Failed to copy $MBOOTC32 to $MINDI_TMP/target/$tbc" 1642 retval=$(($retval+1)) 1643 fi 1649 if [ $KERNEL_IS_XEN = "yes" ]; then 1650 FindMboot32Binary 1651 cp $xenkernelpath $MINDI_TMP/target/xen.gz 2>> $LOGFILE 1652 if [ $? -ne 0 ] ; then 1653 LogAll "ERROR: Failed to copy $xenkernelpath to $MINDI_TMP/target/" 1654 retval=$(($retval+1)) 1655 fi 1656 cp $MBOOTC32 $MINDI_TMP/target/$tbc/mboot.c32 2>> $LOGFILE 1657 if [ $? -ne 0 ] ; then 1658 LogAll "ERROR: Failed to copy $MBOOTC32 to $MINDI_TMP/target/$tbc" 1659 retval=$(($retval+1)) 1644 1660 fi 1645 1661 fi … … 1828 1844 1829 1845 if [ "$target" = "ISO" ]; then 1830 if [ "$ARCH" != "ia64" ]; then 1831 ISO_OPT="$ISO_OPT -b $tbc/isolinux.bin -c $tbc/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table" 1832 fi 1833 # ISO 1834 if [ "$ARCH" != "ia64" ] && [ "$BOOT_TYPE" = "BIOS" ]; then 1846 ISO_OPT="$ISO_OPT -b $tbc/isolinux.bin -c $tbc/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table" 1847 if [ "$BOOT_TYPE" = "BIOS" ]; then 1848 # BIOS 1835 1849 CMD="$ISO_CMD $ISO_OPT" 1836 1850 MakeISO 1837 1851 else 1838 if [ "$ARCH" = "ia64" ]; then 1839 CMD="$ISO_CMD $ISO_OPT -b images/mindi-bootroot.img -c images/boot.cat" 1852 # UEFI 1853 echo "$CMD" | grep -q "xorriso" 1854 if [ $? -eq 0 ]; then 1855 XOV=`xorriso --version 2>&1 | head -1 | awk '{print $3}'` 1856 XOVMAJ=`echo $XOV | cut -d. -f1` 1857 XOVMIN=`echo $XOV | cut -d. -f2` 1858 if [ $XOVMAJ -ge 1 && $XOVMIN -ge 3 ]; then 1859 CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -e images/mindi-bootroot.img -no-emul-boot" 1860 else 1861 CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot --efi-boot images/mindi-bootroot.img" 1862 fi 1840 1863 else 1841 # UEFI 1842 echo "$CMD" | grep -q "xorriso" 1843 if [ $? -eq 0 ]; then 1844 XOV=`xorriso --version 2>&1 | head -1 | awk '{print $3}'` 1845 XOVMAJ=`echo $XOV | cut -d. -f1` 1846 XOVMIN=`echo $XOV | cut -d. -f2` 1847 if [ $XOVMAJ -ge 1 && $XOVMIN -ge 3 ]; then 1848 CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -e images/mindi-bootroot.img -no-emul-boot" 1849 else 1850 CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot --efi-boot images/mindi-bootroot.img" 1851 fi 1852 else 1853 CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -efi-boot images/mindi-bootroot.img -no-emul-boot" 1854 fi 1864 CMD="$ISO_CMD $ISO_OPT -eltorito-alt-boot -efi-boot images/mindi-bootroot.img -no-emul-boot" 1855 1865 fi 1856 1866 fi … … 1863 1873 if [ "$target" = "ISO" ]; then 1864 1874 cp $part $MINDI_CACHE 1865 if [ "$ ARCH" = "ia64" ] || [ "$BOOT_TYPE" = "UEFI" ]; then1875 if [ "$BOOT_TYPE" = "UEFI" ]; then 1866 1876 # Mount again ! 1867 1877 LogAll "INFO: Re-Mounting $part on $MINDI_TMP/mpt" … … 1885 1895 else 1886 1896 # USB 1887 if [ "$ARCH" != "ia64" ] ; then 1888 syslinux -v 2>&1 | grep -q 4.02 1889 if [ $? -eq 0 ]; then 1890 # This buggy version of syslinux requires a call to --stupid and not -s 1891 syslinux --stupid $USBPART 2>> $MINDI_TMP/syslinux.log 1892 res=$? 1893 else 1894 syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log 1895 res=$? 1896 fi 1897 if [ $res -ne 0 ] ; then 1898 LogAll "----------- syslinux's errors --------------" 1899 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1900 LogAll "------------------------------------------" 1901 LogAll "ERROR: Failed to create USB image." 1902 else 1903 LogFile "INFO: Created bootable USB image on $USBDEVICE" 1904 fi 1905 rm -f $MINDI_TMP/syslinux.log 1897 syslinux -v 2>&1 | grep -q 4.02 1898 if [ $? -eq 0 ]; then 1899 # This buggy version of syslinux requires a call to --stupid and not -s 1900 syslinux --stupid $USBPART 2>> $MINDI_TMP/syslinux.log 1901 res=$? 1906 1902 else 1907 LogAll "ERROR: No USB boot support for ia64" 1908 MindiExit -1 1909 fi 1903 syslinux -s $USBPART 2>> $MINDI_TMP/syslinux.log 1904 res=$? 1905 fi 1906 if [ $res -ne 0 ] ; then 1907 LogAll "----------- syslinux's errors --------------" 1908 cat $MINDI_TMP/syslinux.log |tee -a $LOGFILE 1909 LogAll "------------------------------------------" 1910 LogAll "ERROR: Failed to create USB image." 1911 else 1912 LogFile "INFO: Created bootable USB image on $USBDEVICE" 1913 fi 1914 rm -f $MINDI_TMP/syslinux.log 1910 1915 fi 1911 1916 } … … 2015 2020 local options i ooo 2016 2021 options="" 2017 # Type of boot file ( eliloor syslinux/isolinux)2022 # Type of boot file (grub2 or syslinux/isolinux) 2018 2023 type=$1 2019 if [ "$type" = " elilo" ] || [ "$type" = "grub2" ]; then2024 if [ "$type" = "grub2" ]; then 2020 2025 sep="=" 2021 2026 sepdef="=" … … 2026 2031 2027 2032 # Generic header for conf file 2028 if [ "$type" = "elilo" ]; then 2029 echo -en "prompt\n" 2030 elif [ "$type" = "grub" ]; then 2033 if [ "$type" = "grub" ]; then 2031 2034 echo -en "pause Press a key when ready to restore\n" 2032 2035 elif [ "$type" = "grub2" ]; then … … 2097 2100 ooo=$i 2098 2101 [ "$ooo" = "RESTORE" ] && ooo="RESTORE nuke" 2099 if [ "$type" = "elilo" ]; then 2100 outstr="image=/vmlinuz\n\tlabel=$i\n\tinitrd=/initrd.img\n\troot=/dev/ram0 append=\" rw ramdisk_size=RAMDISK_SIZE $ooo $MINDI_ADDITIONAL_BOOT_PARAMS \"\n" 2101 elif [ "$type" = "grub" ]; then 2102 if [ "$type" = "grub" ]; then 2102 2103 outstr="title $i\n\tkernel /vmlinuz root=/dev/ram0 rw ramdisk_size=RAMDISK_SIZE ${ooo} $MINDI_ADDITIONAL_BOOT_PARAMS\n\tinitrd=/initrd.img\n" 2103 2104 elif [ "$type" = "grub2" ]; then … … 2121 2122 done 2122 2123 if [ -e "$MINDI_LIB/memtest.img" ] ; then 2123 if [ "$type" = "elilo" ]; then 2124 echo -en "image=/memtest.bin\n\tlabel=memtest\n" 2125 echo -en "image=/memdisk\n\tlabel=memdisk\nappend=\"initrd=memtest.img\"\n" 2126 elif [ "$type" = "grub" ]; then 2124 if [ "$type" = "grub" ]; then 2127 2125 echo -en "title memtest\n\tkernel /memtest.efi\n\tinitrd=/memtest.img\n" 2128 2126 elif [ "$type" = "grub2" ]; then … … 2187 2185 2188 2186 mountefi=0 2189 # EFI orUEFI2187 # UEFI 2190 2188 # TODO: names are hard-coded for now 2191 2189 if [ "$BOOT_TYPE" = "UEFI" ]; then … … 2252 2250 fi 2253 2251 else 2254 # EFI 2255 efidir=$bootdir 2256 bootbin=`find /boot/efi -iname "elilo.efi" | head -1` 2257 tgbin=$bootbin 2258 boottype=elilo 2259 bootconf="$efidir/elilo.conf" 2252 LogAll "ERROR: UNSUPPORTED $BOOT_TYPE BOOT_TYPE. Please report upstream" 2253 MindiExit -1 2260 2254 fi 2261 2255 LogAll "INFO: Found $boottype boot type" … … 2332 2326 2333 2327 PrepareBigDir() { 2334 local needlist diskdir res i j k lines lfiles includefile ti templog2328 local needlist diskdir res i j k lines lfiles includefile ti 2335 2329 2336 2330 rm -f $MINDI_CACHE/mindi.iso 2337 mkdir -p $targetdir 2338 templog=$MINDI_TMP/$$.log 2339 needlist=$MINDI_TMP/kernel-modules.conf 2340 mkdir -p $bigdir/usr/bin $bigdir/usr/sbin $bigdir/tmp 2341 # Generated file 2342 includefile=$MINDI_TMP/include-modules.conf 2343 2344 lfiles=`ls $DEPLIST_DIR/* | grep -Ev '/minimal|/udev|/drbd'` 2331 needlist=$MINDI_TMP/what-we-need.txt 2332 mkdir -p $bigdir/usr/bin 2333 mkdir -p $bigdir/usr/sbin 2334 includefile=$MINDI_TMP/$$.includefile.txt 2335 2336 lfiles=`ls $DEPLIST_DIR/* | grep -v /minimal` 2345 2337 if [ -e "$DEPLIST_FILE" ]; then 2346 2338 lfiles="$DEPLIST_FILE $lfiles" 2347 2339 fi 2340 lines=`grep -vx " *#.*" $lfiles | grep -vx "" | wc -l` 2348 2341 ParseModprobeForIncludes $includefile 2349 ListKernelModulePaths > $needlist 2350 for f in $lfiles $includefile $needlist; do 2351 CopyFromConf $f $targetdir 2352 done 2342 lines=$(($lines+`cat $includefile | wc -l`)) 2343 cat $lfiles $includefile | GenerateGiantDependencyList $needlist $lines 2344 res=$? 2353 2345 rm -f $includefile 2354 2346 ListKernelModulePaths >> $needlist 2347 if [ "$res" -ne "0" ] ; then 2348 Die "You have $res files present in dependency list\nbut absent from filesystem." 2349 fi 2350 mkdir -p $bigdir/tmp 2355 2351 if [ _"$MONDO_SHARE" != _"" ]; then 2356 2352 # TODO: no reason to have the cfg file stored twice … … 2363 2359 2364 2360 [ -d "/mnt/.boot.d" ] && echo "GENTOO" > $bigdir/tmp/DUMBASS-GENTOO 2361 DropOptimizedLibraries $needlist $bigdir 2362 echo -en "INFO: Assembling dependency files" 2363 2364 CopyDependenciesToDirectory < $needlist $bigdir `wc -l $needlist` 1 2365 rm -f $needlist 2366 echo -e "$DONE" 2365 2367 2366 2368 # also copy io.sys and msdos.sys, if we can find them … … 2393 2395 done 2394 2396 if [ -e "$MONDO_SHARE/restore-scripts" ]; then 2395 mkdir -p $bigdir/usr/bin $bigdir/etc2396 2397 cp -Rdf $MONDO_SHARE/restore-scripts/mondo/* $bigdir/usr/bin 2>> $LOGFILE 2397 2398 [ $? -ne 0 ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts" … … 2448 2449 PrepareBootDir 2449 2450 2450 LogFile "---------------------------"2451 LogFile "Content of initial bigdir:"2452 LogFile "---------------------------- "2453 (cd "$bigdir" ; ls -Rla ) >> $LOGFILE2454 LogFile "---------------------------"2455 2451 } 2456 2452 … … 2539 2535 file $fname | grep -q gzip 2540 2536 if [ $? -eq 0 ] ; then 2541 # Used by ia642542 2537 fkern_ver=`gzip -cd $fname | strings 2> /dev/null | grep -E "[2-9]+\.[0-9]+\.[0-9]+[^\@]*@"` 2543 2538 else … … 2548 2543 2549 2544 2550 # WARNING: This function mustjust echo the final result !!!2545 # WARNING: This function should just echo the final result !!! 2551 2546 # 2552 2547 TryToFindKernelPath() { … … 2557 2552 duff_kernels="" 2558 2553 output="" 2559 2560 if [ "$ARCH" = "ia64" ] ; then 2561 root="/boot/efi/efi" 2562 else 2563 root="/" 2564 fi 2554 root="/" 2565 2555 # See if we're booted from a Xen kernel 2566 2556 # From http://wiki.xensource.com/xenwiki/XenCommonProblems#head-26434581604cc8357d9762aaaf040e8d87b37752 … … 2582 2572 file $fname | grep -q gzip 2583 2573 if [ $? -eq 0 ] ; then 2584 # Used by ia642585 2574 if [ "`gzip -cd $fname | strings 2> /dev/null | grep -F "$kdate"`" = "" ] ; then 2586 2575 LogFile "Have you recompiled your kernel \"$fname\" w/o rebooting? Naughty but I'll allow it..." … … 2694 2683 conf=$1 2695 2684 mp=$2 2696 if [ ! -e $conf ]; then 2697 # Invoked with a conf file short name fixing... 2698 conf="$DEPLIST_DIR/$1.conf" 2699 fi 2700 if [ ! -e $conf ]; then 2701 LogAll "Unable to find conf file $conf please report upstream" 2702 return 2703 fi 2704 bconf=`basename $conf .conf` 2705 echo -en "INFO: Gathering dependencies of $bconf..." 2706 LogFile "INFO: Gathering dependencies of $conf..." 2707 lis2=`grep -Ev '^#' $conf | sort -u` 2685 echo -en "INFO: Gathering dependencies of $conf.conf..." 2686 LogFile "INFO: Gathering dependencies of $conf.conf..." 2687 lis2=`grep -Ev '^#' $DEPLIST_DIR/$conf.conf | sort -u` 2708 2688 noof_lines=`echo $lis2 | wc -w` 2709 2689 progress=0 2710 LogFile "DEBUG: targetdir: `ls -l $mp/`"2711 LogFile "DEBUG: lis2=$lis2"2712 2690 # Get only the files which exist in that list 2713 2691 # and potentially their symlink structure 2714 2692 # put apart directories for later handling 2715 touch $MINDI_TMP/$bconf.lis $MINDI_TMP/$bconf.lis22716 2693 for f in $lis2; do 2717 2694 if [ -d $f ]; then 2718 2695 for g in `find $f`; do 2719 echo $g >> $MINDI_TMP/$ bconf.lis2720 LocateDeps $g >> $MINDI_TMP/$ bconf.lis22696 echo $g >> $MINDI_TMP/$conf.lis 2697 LocateDeps $g >> $MINDI_TMP/$conf.lis2 2721 2698 done 2722 2699 lis3="$lis3 $f" 2723 2700 else 2724 2701 if [ -r $f ]; then 2725 echo $f >> $MINDI_TMP/$ bconf.lis2726 LocateDeps $f >> $MINDI_TMP/$ bconf.lis22702 echo $f >> $MINDI_TMP/$conf.lis 2703 LocateDeps $f >> $MINDI_TMP/$conf.lis2 2727 2704 fi 2728 2705 fi … … 2730 2707 LogProgress $progress $noof_lines 2731 2708 done 2732 LogFile "DEBUG: lis3=$lis3"2733 #LogAll "INFO: Processing all dependencies links for $conf..."2709 echo -e "$DONE" 2710 LogAll "INFO: Processing all dependencies links for $conf.conf..." 2734 2711 # And their deps except dirs 2735 lines=`sort -u $MINDI_TMP/$ bconf.lis $MINDI_TMP/$bconf.lis2`2736 rm -f $MINDI_TMP/$ bconf.lis22712 lines=`sort -u $MINDI_TMP/$conf.lis $MINDI_TMP/$conf.lis2` 2713 rm -f $MINDI_TMP/$conf.lis2 2737 2714 finallist="" 2738 2715 # Remove directories from the list, as cp will create them anyway … … 2740 2717 # recent bash says that -d is true for a link to a dir ! 2741 2718 for f in $lines; do 2742 LogFile "DEBUG: f=$f"2743 2719 if [ -e "$f" -a ! -d "$f" ] || [ -h "$f" ]; then 2744 LogFile "DEBUG: Test OK"2745 2720 # Do not overwrite files already in destination (avoid using option -n of cp not portable) 2746 2721 if [ ! -e "$mp/$f" ]; then 2747 2722 finallist="$finallist $f" 2748 LogFile "DEBUG: Creating $mp/$f"2749 else2750 LogFile "DEBUG: Target exist `ls -al $mp/$f`"2751 2723 fi 2752 2724 fi 2753 2725 done 2754 LogFile "DEBUG: finallist=$finallist"2755 2726 # But adds the directory useful in $lis3 2756 2727 fnllist=`echo $finallist $lis3 | tr ' ' '\n' | sort -u | tr '\n' ' '` 2757 echo -e "$DONE" 2758 if [ _"$fnllist" != _"" ] && [ _"$fnllist" != _" " ]; then 2759 LogFile "INFO: Copying $conf related files with cp -a --parents $fnllist -t $mp/" 2760 cp -a --parents $fnllist -t $mp/ 2>$templog || LogAll "WARNING: Problem in $conf analysis" $templog 2761 fi 2762 rm -f $MINDI_TMP/$bconf.lis 2728 LogFile "INFO: Copying $conf related files with cp -a --parents $fnllist -t $mp/" 2729 cp -a --parents $fnllist -t $mp/ 2> $templog || LogAll "WARNING: Problem in $conf analysis" $templog 2730 rm -f $MINDI_TMP/$conf.lis 2763 2731 } 2764 2732 … … 2773 2741 > $templog 2774 2742 2743 mkdir -p $targetdir 2775 2744 # Check whether /lib64 or /lib or /sbin or /bin is a link and if so explicitly create one in rootfs (Fedora 17 crazyness) 2776 2745 for d in bin sbin lib lib64; do … … 2778 2747 thelink=`readlink /$d` 2779 2748 mkdir -p $targetdir/$thelink || LogAll "ERROR: Unable to create $thelink in $targetdir" 2780 mv $targetdir/$d/* $targetdir/$d/.??* $targetdir/$thelink 2749 mv $targetdir/$d/* $targetdir/$d/.??* $targetdir/$thelink 2> /dev/null 2781 2750 if [ -d "$targetdir/$d" -a ! -h "$targetdir/$d" ]; then 2782 2751 rmdir $targetdir/$d … … 3030 2999 3031 3000 mkdir -p $targetdir/proc 3032 cp -a $MY_FSTAB $targetdir/tmp3033 3001 LogFile "---------------------------" 3034 3002 LogFile "Content of initial targetdir:" … … 3222 3190 fi 3223 3191 3224 ### TODO 3225 ### Fix as it's not mandatory on ia64 3226 if [ "$ARCH" = "ia64" ] ; then 3227 if which elilo &> /dev/null ; then 3228 LILO_EXE=elilo 3229 else 3230 LILO_EXE=`which false 2> /dev/null` 3231 fi 3232 else 3233 FindIsolinuxBinary 3234 fi 3192 FindIsolinuxBinary 3235 3193 trap "Aborted" SIGTERM 3236 3194 DONE="\r\t\t\t\t\t\t\t\tDone. " … … 3715 3673 LogAll "INFO: Mindi Finished" 3716 3674 elif [ "$TAPEDEV" ] ; then 3717 if [ "$ARCH" != "ia64" ] ; then 3718 # We need to keep the img file as boot file for ia64 platform 3719 rm -f $MINDI_CACHE/{*img,*iso} 3720 else 3721 rm -f $MINDI_CACHE/*iso 3722 fi 3675 rm -f $MINDI_CACHE/*iso 3723 3676 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ "$USBDEVICE" != "" ]; then 3724 3677 OfferToMakeBootableUSB
Note:
See TracChangeset
for help on using the changeset viewer.