Changeset 3499 in MondoRescue
- Timestamp:
- Feb 9, 2016, 2:41:11 AM (9 years ago)
- Location:
- branches/3.2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi/analyze-my-lvm
r3432 r3499 382 382 # Launched stdalone, so create a temp dir 383 383 STDALONE="true" 384 TMPDIR=${TMPDIR:=/tmp} 385 if [ ! -d $TMPDIR ]; then 386 mkdir -p $TMPDIR 387 fi 384 388 MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX` 385 389 if [ $? -ne 0 ]; then -
branches/3.2/mindi/mindi
r3493 r3499 39 39 40 40 # Temporary directory for mindi 41 TMPDIR=/tmp 41 TMPDIR=${TMPDIR:=/tmp} 42 if [ ! -d $TMPDIR ]; then 43 mkdir -p $TMPDIR 44 fi 42 45 43 46 EXTRA_SPACE=120000 # increase if you run out of ramdisk space … … 1056 1059 1057 1060 if [ $LVM != "false" ]; then 1058 Log All"INFO: Analyzing LVM..."1061 LogFile "INFO: Analyzing LVM..." 1059 1062 $MINDI_LIB/analyze-my-lvm > $MINDI_TMP/lvm.res 1060 1063 if [ $? -ne 0 ]; then … … 1489 1492 done 1490 1493 1491 MakeMessageFile $MINDI_TMP/iso | cut -c1-80 > $MINDI_TMP/iso/message.txt1492 1493 if [ $KERNEL_IS_XEN = "yes" ]; then1494 FindMboot32Binary1495 cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?"1496 cp $MBOOTC32 $MINDI_TMP/iso/mboot.c32 2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MINDI_TMP/iso/mboot.c32). Did you run out of disk space?"1497 fi1498 1499 1494 cp $kernelpath $MINDI_TMP/iso/vmlinuz 2>> $LOGFILE || Die "Cannot copy vmlinuz ($kernelpath) to mindi tmp ($MINDI_TMP/iso/vmlinuz). Did you run out of disk space?" 1500 1495 cp $MINDI_TMP/initrd.img $MINDI_TMP/iso/initrd.img 2>> $LOGFILE || Die "Cannot copy initrd.img ($MINDI_TMP/initrd.img) to $MINDI_TMP/iso/initrd.img. Did you run out of disk space?" … … 1505 1500 tbc="EFI" 1506 1501 else 1507 (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./boot) 1508 tbc="boot" 1509 fi 1502 (cd $MINDI_TMP/iso ; tar xfz $MINDI_CACHE/all.tar.gz ./syslinux) 1503 tbc="syslinux" 1504 fi 1505 1506 MakeMessageFile $MINDI_TMP/iso/$tbc | cut -c1-80 > $MINDI_TMP/iso/$tbc/message.txt 1507 1510 1508 if [ "$ARCH" != "ia64" ] ; then 1509 if [ $KERNEL_IS_XEN = "yes" ]; then 1510 FindMboot32Binary 1511 cp $xenkernelpath $MINDI_TMP/iso/xen.gz 2>> $LOGFILE || Die "Cannot copy xen.gz ($xenkernelpath) to mindi tmp ($MINDI_TMP/iso/xen.gz). Did you run out of disk space?" 1512 cp $MBOOTC32 $MINDI_TMP/iso/$tbc/mboot.c32 2>> $LOGFILE || Die "Cannot copy mboot.c32 ($MBOOTC32) to mindi tmp ($MINDI_TMP/iso/$tbc/mboot.c32). Did you run out of disk space?" 1513 fi 1514 1511 1515 cp $ISOLINUX $MINDI_TMP/iso/$tbc/isolinux.bin 2>> $LOGFILE || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?" 1512 fi 1513 1514 if [ _"$MONDO_SHARE" != _"" ]; then 1515 if [ $KERNEL_IS_XEN = "yes" ]; then 1516 cp $xenkernelpath $MONDO_ROOT/xen.gz 2>> $LOGFILE || Die "Cannot copy $xenkernelpath to mondo tmp ($MONDO_ROOT/xen.gz). Did you run out of disk space?" 1517 cp $MBOOTC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $MBOOTC32 to mondo tmp ($MONDO_ROOT/). Did you run out of disk space?" 1518 fi 1516 1519 1517 if [ -e "$LDLINUXC32" ]; then 1520 cp $LDLINUXC32 $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $MONDO_ROOT/. Did you run out of disk space?" 1521 fi 1522 cp $kernelpath $MONDO_ROOT/vmlinuz 2>> $LOGFILE || Die "Cannot copy $kernelpath to mondo root ($MONDO_ROOT/vmlinuz). Did you run out of disk space?" 1523 cp $MINDI_TMP/initrd.img $MONDO_ROOT/ 2>> $LOGFILE || Die "Cannot copy $MINDI_TMP/initrd.img to $MONDO_ROOT/. Did you run out of disk space?" 1524 fi 1525 1526 1527 old_pwd=`pwd` 1528 cd "$MINDI_TMP/iso" 1529 if [ "$ARCH" != "ia64" ] ; then 1530 cfgf=`find $MINDI_TMP/iso -name 'syslinux.cfg' | head -1` 1531 cfgf2=`echo $cfgf | sed 's/syslinux.cfg/isolinux.cfg/'` 1532 mv $cfgf $cfgf2 1533 # For isolinux boot, name the directory correctly as well as the conf file 1534 if [ -e "$MINDI_TMP/iso/boot" ]; then 1535 mv $MINDI_TMP/iso/boot $MINDI_TMP/iso/isolinux 1536 tbc="isolinux" 1537 fi 1518 cp $LDLINUXC32 $MINDI_TMP/iso/$tbc 2>> $LOGFILE || Die "Cannot copy $LDLINUXC32 to $MINDI_TMP/iso/$tbc. Did you run out of disk space?" 1519 fi 1520 1538 1521 if [ _"$MONDO_SHARE" != _"" ]; then 1539 cp -rf $MINDI_TMP/iso/{initrd.img,vmlinuz, message.txt,boot*.txt,pxe.txt,$tbc} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?"1522 cp -rf $MINDI_TMP/iso/{initrd.img,vmlinuz,$tbc} $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy core files to ramdisk for boot disk (under $MONDO_ROOT). Did you run out of disk space?" 1540 1523 if [ $KERNEL_IS_XEN = "yes" ]; then 1541 1524 cp -f $MINDI_TMP/iso/xen.gz $MONDO_ROOT 2>> $LOGFILE || Die "Cannot copy Xen kernel to $MONDO_ROOT. Did you run out of disk space?" … … 1547 1530 CMD="$ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.img -c images/boot.cat -no-emul-boot" 1548 1531 fi 1532 1533 old_pwd=`pwd` 1534 cd "$MINDI_TMP/iso" 1549 1535 LogFile "Invoking $CMD" 1550 1536 $CMD . > /dev/null 2> $MINDI_TMP/mkisofs.log … … 1880 1866 else 1881 1867 ps="/" 1882 if [ "$type" = "syslinux" ]; then1883 ps=""1884 fi1885 1868 if [ $KERNEL_IS_XEN = "no" ]; then 1886 1869 outstr="label $i\n\tkernel ${ps}vmlinuz\n\tappend initrd=${ps}initrd.img root=/dev/ram0 rw ramdisk_size=$ramdisk_size ${ooo} $MINDI_ADDITIONAL_BOOT_PARAMS\n" … … 1916 1899 old_pwd=`pwd` 1917 1900 [ ! -e "$kernelpath" ] && Die "PBDI - cannot find $kernelpath kernel" 1901 TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?" 1918 1902 echo -en "Making "$BOOT_SIZE"KB boot disk..." 1919 TurnTgzIntoRdz $MINDI_LIB/rootfs $MINDI_TMP/initrd.img `du -sk $kernelpath | cut -f1` || Die "Could not turn rootfs into initrd.img; are you SURE your kernel supports loopfs?"1920 echo -en "..."1921 1903 imagefile=$MINDI_TMP/mindi-bootroot.img 1922 1904 mkdir -p $mountpoint 1923 1905 dd if=/dev/zero of=$imagefile bs=1k count=$BOOT_SIZE &> /dev/null || Die "Cannot dd blank file" 1906 echo -en "..." 1924 1907 #if [ "$BOOT_TYPE" = "UEFI" ]; then 1925 1908 # Should be GPT in that case to allow direct boot … … 1955 1938 retval=$(($retval+1)) 1956 1939 fi 1957 MakeMessageFile $mountpoint | cut -c1-80 > $mountpoint/message.txt1940 #MakeMessageFile $mountpoint | cut -c1-80 > $mountpoint/message.txt 1958 1941 1959 1942 mkdir -p $mountpoint/tmp … … 2000 1983 (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI) 2001 1984 else 2002 (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./ boot)1985 (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./syslinux) 2003 1986 fi 2004 1987 … … 2154 2137 # to get it on the media (in addition to the boot part 2155 2138 # and also to support UEFI boot mechanism 2156 bootdir=$bigdir/ boot2139 bootdir=$bigdir/syslinux 2157 2140 bootconf="$bootdir/syslinux.cfg" 2158 boottype= isolinux2141 boottype=syslinux 2159 2142 mkdir -p $bootdir 2160 2143 if [ "$BOOT_TYPE" != "BIOS" ]; then … … 2211 2194 fi 2212 2195 2213 if [ $boottype = " isolinux" ]; then2196 if [ $boottype = "syslinux" ]; then 2214 2197 FindLdlinuxe64Binary 2215 2198 if [ -e "$LDLINUXE64" ]; then … … 2583 2566 done 2584 2567 LogAll "Processing all dependencies of required files..." 2585 for f in ` cat $MINDI_TMP/minimal.lis` `sort -u$MINDI_TMP/minimal2.lis`; do2568 for f in `sort -u $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis`; do 2586 2569 mr-read-all-link $f >> $MINDI_TMP/minimal.lis 2587 2570 done … … 2601 2584 rm -f $MINDI_TMP/minimal.lis $MINDI_TMP/minimal2.lis 2602 2585 2586 fnllist=`echo $finallist | sort -u` 2603 2587 #tar cf - $finallist 2> $templog | tar xf - || LogIt "WARNING: Problem in minimal analysis" $templog 2604 2588 echo "INFO: Copy the minimal env with cp -a --parents $finallist -t $mountpoint" 2>&1 >> $templog 2605 cp -a --parents $f inallist -t $mountpoint 2> $templog || LogIt "WARNING: Problem in minimal analysis" $templog2589 cp -a --parents $fnllist -t $mountpoint 2> $templog || LogIt "WARNING: Problem in minimal analysis" $templog 2606 2590 2607 2591 # In case target /bin dir still doesn't exist, create it before using it … … 2815 2799 fi 2816 2800 2817 if [ ! -e "/sbin/devfsd" ] || [ "$kernelpath" = "$MINDI_LIB/vmlinuz" ]; then2801 if [ ! -e "/sbin/devfsd" ]; then 2818 2802 LogFile "INFO: Deleting devfsd daemon from ramdisk" 2819 2803 [ ! -e "/sbin/devfsd" ] && LogFile " ...because /sbin/devfsd not found" … … 2840 2824 (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./EFI) 2841 2825 else 2842 (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./ boot)2826 (cd $mountpoint ; tar xfz $MINDI_CACHE/all.tar.gz ./syslinux) 2843 2827 fi 2844 2828 -
branches/3.2/mondo/src/common/libmondo-archive.c
r3494 r3499 1567 1567 char *sz_blank_disk = NULL; 1568 1568 char *fnam = NULL; 1569 char *tmp3 = NULL;1570 1569 char *isofs_cmd = NULL; 1571 1570 char *full_isofs_cmd = NULL; … … 1579 1578 assert_string_is_neither_NULL_nor_zerolength(destfile); 1580 1579 1581 /* Copy the files needed by isolinux in the right dir */1582 mr_asprintf(tmp, "%s/isolinux.bin", bkpinfo->scratchdir);1583 mr_asprintf(tmp2, "%s/isolinux.bin", bkpinfo->tmpdir);1584 if (does_file_exist(tmp)) {1585 mr_asprintf(tmp3, "cp -f %s %s", tmp, tmp2);1586 paranoid_system(tmp3);1587 mr_free(tmp3);1588 }1589 if (!does_file_exist(tmp) && does_file_exist(tmp2)) {1590 mr_asprintf(tmp3, "cp -f %s %s", tmp2, tmp);1591 paranoid_system(tmp3);1592 mr_free(tmp3);1593 }1594 mr_free(tmp);1595 mr_free(tmp2);1596 mr_free(tmp3);1597 1580 if (bkpinfo->backup_media_type == iso && bkpinfo->manual_cd_tray) { 1598 1581 popup_and_OK("Please insert new media and press Enter.");
Note:
See TracChangeset
for help on using the changeset viewer.