Changeset 1087 in MondoRescue
- Timestamp:
- Feb 2, 2007, 11:31:00 PM (18 years ago)
- Location:
- branches/stable
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/distributions/conf/mindi.conf.dist
r1071 r1087 48 48 49 49 # 50 # Write mindi Tape (yes|no) ? 51 # 52 mindi_write_tape="no" 53 54 # 50 55 # If set to "no", you will be prompted for whether or not 51 56 # you want to use your own kernel, or the supplied default. … … 57 62 # Images creation dir 58 63 # WARNING: This directory is erased before usage 64 # This is also the directory mondoarchive will use to find 65 # what it needs to create it rescue media 59 66 # 60 mindi_ images_dir="/var/cache/mindi"67 mindi_cache_dir="/var/cache/mindi" 61 68 62 69 # 63 70 # Temporary directory 71 # Under it a temporary directory will be created to host all 72 # temporary files for mindi. That subdirectory is erased at the end of mindi 64 73 # 65 74 mindi_tmp_dir="/tmp" … … 69 78 # 70 79 mindi_fd_device="/dev/fd0" 80 81 # 82 # USB Disk Device 83 # 84 mindi_usb_device="/dev/sda1" 85 86 # 87 # Tape Device 88 # 89 mindi_tape_device="/dev/st0" 71 90 72 91 # -
branches/stable/mindi/mindi
r1082 r1087 48 48 49 49 MINDI_CONFIG="$MINDI_CONF/mindi.conf" 50 if [ ! -f $MINDI_CONFIG ] ; then50 if [ ! -f $MINDI_CONFIG ] && [ "$1" != "--printvar" ]; then 51 51 echo "No $MINDI_CONFIG file found using sensible values from $MINDI_CONFIG_DIST" 52 52 else 53 echo "Using $MINDI_CONFIG as additional config file to $MINDI_CONFIG_DIST" 53 if [ "$1" != "--printvar" ]; then 54 echo "Using $MINDI_CONFIG as additional config file to $MINDI_CONFIG_DIST" 55 fi 54 56 . $MINDI_CONFIG 55 57 fi … … 87 89 PROMPT_MAKE_CD_IMAGE="$mindi_write_cd" 88 90 PROMPT_MAKE_USB_IMAGE="$mindi_write_usb" 91 PROMPT_MAKE_TAPE_IMAGE="$mindi_write_tape" 89 92 USE_OWN_KERNEL="$mindi_use_own_kernel" 90 CACHE_LOC="$mindi_images_dir"93 MINDI_CACHE="$mindi_cache_dir" 91 94 FORCE_DUAL_FLOPPIES="$mindi_dual_floppies" 92 95 TMPDIR="$mindi_tmp_dir" 93 96 FDDEVICE="$mindi_fd_device" 97 USBDEVICE="$mindi_usb_device" 98 TAPEDEV="$mindi_tape_device" 94 99 ADDITIONAL_BOOT_PARAMS="$mindi_boot_params" 95 100 MY_FSTAB="$mindi_etc_fstab" … … 107 112 BOOT_MEDIA_MESSAGE="$mindi_boot_msg" 108 113 FDISK=$MINDI_SBIN/parted2fdisk 109 110 # Now we can create what we nedd111 114 MINDI_TMP=`mktemp -d $TMPDIR/mindi.XXXXXXXXXX` 112 mkdir -p $MINDI_TMP 113 114 # Purge from potential old run 115 rm -rf $CACHE_LOC/* 2> /dev/null 116 mkdir -p $CACHE_LOC 115 117 116 # ---------------------------------------------------------------------------- 118 117 … … 143 142 Aborted() { 144 143 trap SIGHUP SIGTERM SIGTRAP SIGINT 145 [ "$ CACHE_LOC" != "" ] && rm -f $CACHE_LOC/mindi*img $CACHE_LOC/*gz $CACHE_LOC/mindi.iso144 [ "$MINDI_CACHE" != "" ] && rm -f $MINDI_CACHE/mindi*img $MINDI_CACHE/*gz $MINDI_CACHE/mindi.iso 146 145 [ "$minidir_root" != "" ] && rm -Rf $minidir_root/* 147 146 Die "User abort." 148 }149 150 151 AddFileToCfgIfExists() {152 [ -e "$1" ] && echo -en "$2 `cat $1`\n" >> $3153 147 } 154 148 … … 415 409 if [ "$?" -ne "0" ] ; then 416 410 umount $mountpoint 411 rmdir $mountpoint 417 412 Die "Tarball $tarball is too big for disk! (CODI)\nAdjust mindi_max_compressed_size in your $MINDI_CONFIG" 418 413 fi … … 522 517 echo -en "Adding the following keyboard mapping tables: " 523 518 mkdir -p $bigdir/tmp 524 echo " /etc/console/boottime.kmap.gz" > $bigdir/tmp/KEYMAP-LIVES-HERE519 echo "keymap-lives-here /etc/console/boottime.kmap.gz" > $MINDI_TMP/mondo-restore.cfg 525 520 KBDEPTH=0 526 521 mkdir -p $bigdir/etc/console … … 573 568 echo -en "Adding the following keyboard mapping tables: " 574 569 mkdir -p $bigdir/tmp 575 echo " $mappath" > $bigdir/tmp/KEYMAP-LIVES-HERE570 echo "keymap-lives-here $mappath" > $MINDI_TMP/mondo-restore.cfg 576 571 KBDEPTH=0 577 572 AddKeyboardMappingFile $mappath … … 787 782 Die "Odd." 788 783 fi 789 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2> /dev/null || LogIt "\nMondo v1.2x defaults to LILO as the bootloader, BTW."790 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then791 LogIt "Incorporating NFS-related settings"792 for r in NFS-* ISO-PREFIX ; do793 cp -f $MINDI_TMP/$r $bigdir/tmp 2>> $LOGFILE || Die "Cannot copy $r - did you run out of disk space?"794 echo "Copying $r to ramdisk" >> $LOGFILE795 done796 fi797 784 fi 798 785 tr ' ' '\n' < $outfile.pre | tr -s '/' '/' | grep -Fvx "" | sort -u | grep -Ev "/libX11|/libXext|/libXi|/libgtk|/libgdk" > $outfile … … 1005 992 1006 993 1007 # Called by TurnTgzIntoRdz, to make /tmp/mondo-restore.cfg1008 MakeMondoConfigFile() {1009 local outfile use_lzo use_comp use_star1010 outfile=$11011 > $outfile1012 [ "$TAPESIZE" ] && echo "media-size $TAPESIZE" >> $outfile1013 [ "$TAPEDEV" ] && echo "media-dev $TAPEDEV" >> $outfile1014 [ "$FILES_IN_FILELIST" ] && echo "files-in-filelist $FILES_IN_FILELIST" >> $outfile1015 [ "$LAST_FILELIST_NUMBER" ] && echo "last-filelist-number $LAST_FILELIST_NUMBER" >> $outfile1016 [ "$INTERNAL_TAPE_BLOCK_SIZE" ] && echo "internal-tape-block-size $INTERNAL_TAPE_BLOCK_SIZE" >> $outfile1017 use_lzo=$USE_LZO; [ "$use_lzo" = "" ] && use_lzo="no"1018 use_gzip=$USE_GZIP; [ "$use_gzip" = "" ] && use_gzip="no"1019 use_comp=$USE_COMP; [ "$use_comp" = "" ] && use_comp="yes"1020 use_star=$USE_STAR; [ "$use_star" = "" ] && use_star="no"1021 echo "use-lzo $use_lzo" >> $outfile1022 echo "use-gzip $use_gzip" >> $outfile1023 echo "use-star $use_star" >> $outfile1024 echo "use-comp $use_comp" >> $outfile1025 echo "datestamp `date`" >> $outfile1026 [ "$ESTIMATED_TOTAL_NOOF_SLICES" ] && echo "total-slices $ESTIMATED_TOTAL_NOOF_SLICES" >> $outfile1027 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile1028 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile1029 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile1030 AddFileToCfgIfExists $MINDI_TMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile1031 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-MOUNT nfs-server-mount $outfile1032 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-PATH nfs-server-path $outfile1033 AddFileToCfgIfExists $MINDI_TMP/NFS-DEV nfs-dev $outfile1034 AddFileToCfgIfExists $MINDI_TMP/NFS-SERVER-IPADDR nfs-server-ipaddr $outfile1035 AddFileToCfgIfExists $MINDI_TMP/ISO-DEV iso-dev $outfile1036 AddFileToCfgIfExists $MINDI_TMP/ISO-MNT iso-mnt $outfile1037 AddFileToCfgIfExists $MINDI_TMP/ISO-PREFIX iso-prefix $outfile1038 AddFileToCfgIfExists $MINDI_TMP/ISODIR isodir $outfile1039 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.DEVICE bootloader.device $outfile1040 AddFileToCfgIfExists $MINDI_TMP/BOOTLOADER.NAME bootloader.name $outfile1041 AddFileToCfgIfExists $MINDI_TMP/KEYMAP-LIVES-HERE keymap-lives-here $outfile1042 AddFileToCfgIfExists $MINDI_TMP/TAPEDEV-HAS-DATA-DISKS tapedev-has-data-disks $outfile1043 AddFileToCfgIfExists $MINDI_TMP/BACKUP-MEDIA-TYPE backup-media-type $outfile1044 AddFileToCfgIfExists $MINDI_TMP/DIFFERENTIAL differential $outfile1045 AddFileToCfgIfExists $MINDI_TMP/ACL acl $outfile1046 AddFileToCfgIfExists $MINDI_TMP/XATTR xattr $outfile1047 }1048 1049 1050 994 MakeModuleLoadingScript() { 1051 995 local module fname params modpath kver outerloop i modpaths kver searchpath list_to_echo j … … 1132 1076 [ -e "$MY_FSTAB" ] || Die "Cannot find your fstab file ($MY_FSTAB)" 1133 1077 1134 rm -f $mountlist 1135 mkdir -p $mountlist 1136 rm -Rf $mountlist 1078 [ "$mountlist" != "" ] && rm -Rf $mountlist 1137 1079 > $mountlist 1138 1080 echo -en "\rHang on...\r" … … 1446 1388 rm -f $1.tmp 1447 1389 if [ "$CDRECOVERY" != "yes" ] ; then 1448 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then1390 if [ "$NFS_DEV" != "" ] ; then 1449 1391 echo -en "Press <enter> to continue.\n" >> $1 1450 1392 elif [ ! "$MINDI_TMP" ] ; then … … 1530 1472 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0 1531 1473 fi 1532 if [ ! "$MINDI_TMP" ] ; then 1533 LogIt "NB: Mindi's bootable CD always uses isolinux or elilo." 1534 LogIt "For a bootable CD w/LILO, please use Mondo." 1474 if [ _"$MINDI_TMP" = _"" ]; then 1475 Die "MINDI_TMP undefined" 1535 1476 fi 1536 1477 rm -Rf $MINDI_TMP/iso … … 1563 1504 cd $MINDI_TMP/iso/isolinux 1564 1505 cat $iso_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/iso > isolinux.cfg || Die "Cannot copy isolinux.cfg to $MINDI_TMP/iso/isolinux - did you run out of disk space?" 1565 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then1506 if [ "$NFS_DEV" != "" ] ; then 1566 1507 perl -pi -e 's/interactive/iso/' isolinux.cfg 1567 1508 fi … … 1576 1517 cp -f $MONDO_SHARE/autorun . 2>> $LOGFILE 1577 1518 fi 1578 mkisofs -U -J -r -o $ CACHE_LOC/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log1579 else 1580 mkisofs -J -r -o $ CACHE_LOC/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log1519 mkisofs -U -J -r -o $MINDI_CACHE/mindi.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log 1520 else 1521 mkisofs -J -r -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$IA64_BOOT_SIZE.img -c isolinux/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log 1581 1522 fi 1582 1523 if [ "$?" -ne "0" ] ; then … … 1587 1528 LogIt "Failed to create ISO image." 1588 1529 else 1589 echo "Created bootable ISO image at $ CACHE_LOC/mindi.iso" >> $LOGFILE1530 echo "Created bootable ISO image at $MINDI_CACHE/mindi.iso" >> $LOGFILE 1590 1531 fi 1591 1532 rm -f $MINDI_TMP/mkisofs.log … … 1598 1539 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ] && [ _"$MONDO_SHARE" = _"" ]; then 1599 1540 echo "Shall I make a bootable USB image ?" 1600 echo -en "WARNING: This will erase all content on $USBDEV (y/[n]) "1541 echo -en "WARNING: This will erase all content on $USBDEVICE (y/[n]) " 1601 1542 read i 1602 1543 [ "$i" != "y" ] && [ "$i" != "Y" ] && return 0 1603 1544 fi 1545 if [ _"$MINDI_TMP" = _"" ]; then 1546 Die "MINDI_TMP undefined" 1547 fi 1604 1548 rm -Rf $MINDI_TMP/usb 1605 1549 mkdir -p $MINDI_TMP/usb 1606 USBPART="${USBDEV }1"1607 1608 echo -en "Transforming $USBDEV in a Bootable device "1550 USBPART="${USBDEVICE}1" 1551 1552 echo -en "Transforming $USBDEVICE in a Bootable device " 1609 1553 echo -en "." 1610 echo "Transforming $USBDEV in a Bootable device" >> $LOGFILE1611 echo "Checking $USBDEV " >> $LOGFILE1612 $FDISK -l $USBDEV 2>&1 >> $LOGFILE1554 echo "Transforming $USBDEVICE in a Bootable device" >> $LOGFILE 1555 echo "Checking $USBDEVICE" >> $LOGFILE 1556 $FDISK -l $USBDEVICE 2>&1 >> $LOGFILE 1613 1557 if [ $? -ne 0 ]; then 1614 echo "Unable to access $USBDEV " | tee -a $LOGFILE1558 echo "Unable to access $USBDEVICE" | tee -a $LOGFILE 1615 1559 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE 1616 1560 MindiExit -1 1617 1561 fi 1618 1562 echo -en "." 1619 echo "Erasing $USBDEV " >> $LOGFILE1620 $FDISK $USBDEV 2>&1 >> $LOGFILE << EOF1563 echo "Erasing $USBDEVICE" >> $LOGFILE 1564 $FDISK $USBDEVICE 2>&1 >> $LOGFILE << EOF 1621 1565 d 1622 1566 d … … 1635 1579 EOF 1636 1580 if [ $? -ne 0 ]; then 1637 echo "Unable to create a vfat Filesystem on $USBDEV " | tee -a $LOGFILE1581 echo "Unable to create a vfat Filesystem on $USBDEVICE" | tee -a $LOGFILE 1638 1582 echo "Make sure your USB device is pluged in" | tee -a $LOGFILE 1639 $FDISK -l $USBDEV 2>&1 | tee -a $LOGFILE1583 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1640 1584 MindiExit -1 1641 1585 fi … … 1646 1590 echo "Unable to create a vfat filesystem on $USBPART" | tee -a $LOGFILE 1647 1591 echo "Make sure your USB device is pluged in and partitioned ($USBPART must exist on it)" | tee -a $LOGFILE 1648 $FDISK -l $USBDEV 2>&1 | tee -a $LOGFILE1592 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1649 1593 MindiExit -1 1650 1594 fi … … 1655 1599 echo "Unable to mount $USBPART on $MINDI_TMP/usb" | tee -a $LOGFILE 1656 1600 echo "Make sure your USB device is pluged in, partitioned and formated ($USBPART must exist on it)" | tee -a $LOGFILE 1657 $FDISK -l $USBDEV 2>&1 | tee -a $LOGFILE1601 $FDISK -l $USBDEVICE 2>&1 | tee -a $LOGFILE 1658 1602 MindiExit -1 1659 1603 fi … … 1693 1637 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $MINDI_TMP/usb > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to $MINDI_TMP/usb - did you run out of disk space?" 1694 1638 echo -en "." 1695 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then1639 if [ "$NFS_DEV" != "" ] ; then 1696 1640 perl -pi -e 's/interactive/iso/' syslinux.cfg 1697 1641 fi … … 1717 1661 else 1718 1662 echo -e "$DONE" 1719 echo "Created bootable USB image on $USBDEV " >> $LOGFILE1663 echo "Created bootable USB image on $USBDEVICE" >> $LOGFILE 1720 1664 fi 1721 1665 rm -f $MINDI_TMP/syslinux.log 1666 # 1667 # If mondoarchive, then tranfer $MINDI_CACHE content to the USB device 1668 # and mount that device under that mountpoint instead 1669 # Has to be done at the end here. 1670 # 1671 if [ _"$MONDO_SHARE" != _"" ]; then 1672 mount $USBPART $MINDI_TMP/usb 2>> $LOGFILE 1673 mv $MINDI_CACHE/* $MINDI_TMP/usb 1674 umount $MINDI_TMP/usb 1675 mount $USBPART $MINDI_CACHE 1676 fi 1722 1677 } 1723 1678 … … 1739 1694 if [ _"$MONDO_SHARE" != _"" ]; then 1740 1695 if [ "$CDRECOVERY" != "yes" ] ; then 1741 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then1696 if [ "$NFS_DEV" != "" ] ; then 1742 1697 echo -en "Press <enter> to continue.\n" 1743 1698 elif [ ! "$MINDI_TMP" ] ; then … … 1834 1789 echo -en "default=RESTORE\n" 1835 1790 elif [ "$disksize" -gt "2880" ] && [ _"$MONDO_SHARE" != _"" ]; then 1836 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then1791 if [ "$NFS_DEV" != "" ] ; then 1837 1792 echo -en "default=iso\n" 1838 1793 else … … 1855 1810 elif [ "$disksize" -gt "2880" ] ; then 1856 1811 if [ _"$MONDO_SHARE" != _"" ]; then 1857 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then1812 if [ "$NFS_DEV" != "" ] ; then 1858 1813 options="iso" 1859 1814 else … … 1975 1930 1976 1931 # copy the kernel across 1977 rm -Rf $mountpoint/lost+found1932 [ "$mountpoint" != "" ] && rm -Rf $mountpoint/lost+found 1978 1933 dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null 1979 1934 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` … … 2011 1966 if [ "$disksize" -gt "2880" ] && [ ! "$KERN_DISK_MADE" ] ; then 2012 1967 if [ "$ARCH" != "ia64" ] ; then 2013 $LILO_EXE $LILO_OPTIONS-r $mountpoint >> $LOGFILE 2>> $LOGFILE1968 $LILO_EXE -r $mountpoint >> $LOGFILE 2>> $LOGFILE 2014 1969 else 2015 1970 /bin/true … … 2096 2051 [ -e "$sys_cfg_file" ] || Die "Obi Wan, word up?" 2097 2052 cat $sys_cfg_file | HackSyslinuxFile $ramdisk_size $mountpoint > syslinux.cfg || Die "Cannot copy syslinux.cfg from mindi_home to tmp_root" 2098 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then2053 if [ "$NFS_DEV" != "" ] ; then 2099 2054 perl -pi -e 's/interactive/iso/' syslinux.cfg 2100 2055 fi … … 2115 2070 2116 2071 # copy the kernel across 2117 rm -Rf $mountpoint/lost+found2072 [ "$mountpoint" != "" ] && rm -Rf $mountpoint/lost+found 2118 2073 dd if=/dev/zero of=$mountpoint/zero bs=1k count=16 &> /dev/null 2119 2074 free_space=`df -k -P $mountpoint | tail -n1 | tr -s ' ' '\t' | cut -f4` … … 2226 2181 mkdir -p $bigdir/tmp 2227 2182 if [ _"$MONDO_SHARE" != _"" ]; then 2228 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 2229 cp -f $MINDI_TMP/mondo-restore.cfg $bigdir/tmp &> /dev/null 2183 cp -f $MONDO_CACHE/mondo-restore.cfg $bigdir/tmp &> /dev/null 2230 2184 fi 2231 2185 [ -d "/mnt/.boot.d" ] && echo "Oh Jebus" > $bigdir/tmp/DUMBASS-GENTOO … … 2242 2196 2243 2197 # master boot record, too 2244 i=` cat $MINDI_TMP/BOOTLOADER.DEVICE2> /dev/null`2198 i=`grep bootloader.device $MONDORESTORECFG | cut -d' ' -f2 2> /dev/null` 2245 2199 if [ "$i" ] ; then 2246 2200 LogIt "Backing up $i's MBR" … … 2437 2391 bigdir=$1 2438 2392 minidir_root=$2 2439 rm -Rf $minidir_root/*2393 [ "$minidir_root" != "" ] && rm -Rf $minidir_root/* 2440 2394 2441 2395 TryToFitDataIntoSeveralDirs $bigdir $minidir_root … … 2446 2400 fi 2447 2401 RejigHyperlinks $minidir_root $noof_disks 2448 rm -Rf $bigdir/*2402 [ "$bigdir" != "" ] && rm -Rf $bigdir/* 2449 2403 return $noof_disks 2450 2404 } … … 2624 2578 cd $old_pwd 2625 2579 echo -en "\rThe files have been subdivided into $noof_disks directories. \r" 2626 rm -Rf $minidir_root/compressed2580 [ "$minidir_root" != "" ] && rm -Rf $minidir_root/compressed 2627 2581 if [ "$retval" -gt "0" ] ; then 2628 2582 return 0 … … 2716 2670 list_of_groovy_mods="$CDROM_MODS `WhichOfTheseModulesAreLoaded "$SCSI_MODS"`" 2717 2671 fi 2718 if [ -e "$MINDI_TMP/NFS-DEV" ] ; then2672 if [ "$NFS_DEV" != "" ] ; then 2719 2673 # For PXE boot 2720 2674 list_of_groovy_mods="$list_of_groovy_mods $NET_MODS" … … 2739 2693 fi 2740 2694 cd $old_pwd 2741 [ "$ TAPEDEV" ] && echo -en "$TAPEDEV" > $mountpoint/tmp/TAPEDEV-LIVES-HERE2695 [ "$PROMPT_MAKE_TAPE_IMAGE" = "yes" ] && echo -en "$TAPEDEV" > $mountpoint/tmp/TAPEDEV-LIVES-HERE 2742 2696 dd if=/dev/zero of=$mountpoint/zero &> /dev/null 2743 2697 rm -f $mountpoint/zero 2698 mkdir -p $mountpoint/tmp 2744 2699 if [ _"$MONDO_SHARE" != _"" ]; then 2745 MakeMondoConfigFile $mountpoint/tmp/mondo-restore.cfg 2746 cp -f $mountpoint/tmp/mondo-restore.cfg $MINDI_TMP &> /dev/null 2700 cp -f $MONDO_CACHE/mondo-restore.cfg $mountpoint/tmp &> /dev/null || Die "Cannot copy mondo-restore.cfg to ramdisk" 2747 2701 cp -f $MINDI_TMP/mountlist.txt $mountpoint/tmp/ 2>/dev/null || Die "Cannot copy mountlist to ramdisk" 2748 echo -en "$FILES_IN_FILELIST" > $mountpoint/tmp/FILES-IN-FILELIST 2749 echo -en "$LAST_FILELIST_NUMBER" > $mountpoint/tmp/LAST-FILELIST-NUMBER 2750 [ "$USE_LZO" = "yes" ] && echo -en "Pras 4 Pres 2004" >> $mountpoint/tmp/USING-LZO 2751 [ "$USE_GZIP" = "yes" ] && echo -en "YES" >> $mountpoint/tmp/USING-GZIP 2752 [ "$USE_COMP" = "yes" ] && echo -en "Compression, yep" >> $mountpoint/tmp/USING-COMP 2753 [ "$USE_STAR" = "yes" ] && echo -en "Using star. Hooray." >> $mountpoint/tmp/USING-STAR 2754 fi 2755 mkdir -p $mountpoint/tmp 2702 fi 2756 2703 mkdir -p $mountpoint/proc 2757 2704 echo "$disksize" > $mountpoint/tmp/$disksize.siz … … 2759 2706 umount $mountpoint || Die "Cannot unmount $tempfile" 2760 2707 dd if=$tempfile bs=1k 2> /dev/null | gzip -v9 > $rdz_fname 2> /dev/null 2761 # gzip -9 $tempfile2762 # mv $tempfile.gz $rdz_fname2763 2708 if [ "$res" -eq "0" ] ; then 2764 2709 echo -en "..." … … 2806 2751 done 2807 2752 mkdir -p $minidir_root/all/tmp 2808 echo -en "$FILES_IN_FILELIST" > $minidir_root/all/tmp/FILES-IN-FILELIST 2> /dev/null2809 echo -en "$LAST_FILELIST_NUMBER" > $minidir_root/all/tmp/LAST-FILELIST-NUMBER 2> /dev/null2810 2753 fi 2811 2754 tar -b 4096 -cf - * 2> /dev/null | gzip -9 > $tardir/all.tar.gz … … 2813 2756 [ "`du -sm $imagesdir/all.tar.gz | cut -f1`" -ge "30" ] && Die "You have too many tools in your shed" 2814 2757 cd $old_pwd 2815 rm -Rf $minidir_root2758 [ "$minidir_root" != "" ] && rm -Rf $minidir_root 2816 2759 echo -e "$DONE" 2817 2760 } … … 2821 2764 #----------------------------------- Main -----------------------------------# 2822 2765 ############################################################################## 2766 2767 # Now we can create what we nedd 2768 mkdir -p $MINDI_TMP 2769 2770 # Purge from potential old run 2771 if [ _"$MINDI_CACHE" = _"" ]; then 2772 Die "MINDI_CACHE undefined" 2773 fi 2774 rm -rf $MINDI_CACHE 2> /dev/null 2775 mkdir -p $MINDI_CACHE 2823 2776 2824 2777 … … 2837 2790 echo "$@" >> $LOGFILE 2838 2791 echo "Start date : `date`" >> $LOGFILE 2792 echo "-----------------------------" >> $LOGFILE 2839 2793 2840 2794 if [ -e "/etc/conf.modules" ] && [ ! -e "/etc/modules.conf" ] ; then … … 2846 2800 # Log some capital variables 2847 2801 [ "$MINDI_PREFIX" = "XXX" ] && Die "Mindi has not been installed correctly." 2802 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 2848 2803 echo "MINDI_LIB = $MINDI_LIB" >> $LOGFILE 2849 2804 echo "MINDI_SBIN = $MINDI_SBIN" >> $LOGFILE 2850 2805 [ "$MINDI_CONF" = "YYY" ] && Die "Mindi has not been installed correctly." 2851 2806 echo "MINDI_CONF = $MINDI_CONF" >> $LOGFILE 2852 echo "MONDO_SHARE = $MONDO_SHARE" >> $LOGFILE 2807 if [ -f $MINDI_CONF ]; then 2808 echo "-----------------------------" >> $LOGFILE 2809 echo " Mindi configuration file " >> $LOGFILE 2810 echo "-----------------------------" >> $LOGFILE 2811 cat $MINDI_CONF >> $LOGFILE 2812 echo "-----------------------------" >> $LOGFILE 2813 fi 2814 2853 2815 2854 2816 trap AbortHere SIGTERM SIGHUP SIGQUIT SIGKILL SIGABRT SIGINT … … 2922 2884 BIGNO=0 2923 2885 MAX_COMPRESSED_SIZE="$mindi_max_compressed_size" 2886 2887 # 2888 # Kernel management: Attempt to locate kernel specific module path 2889 # if module path is found then use it other wise use uname -r to set it... 2890 # 2891 # 2924 2892 kernelpath="$mindi_kernel" 2925 2893 if [ "$kernelpath" = "NATIVE" ]; then 2926 2894 kernelpath="" 2927 2895 fi 2928 if [ "$ARCH" = "ia64" ] ; then 2929 USE_LILO=yes 2896 if [ "$kernelpath" = "" ]; then 2897 kernelpath=`TryToFindKernelPath` 2898 fi 2899 kernelname=`echo $kernelpath | cut -d'-' -f2-` 2900 LogIt "kernelname = $kernelname" 2901 LogIt "kernelpath = $kernelpath" 2902 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 2903 then 2904 LogIt "Module path for ${kernelpath} not found..." 2905 LogIt "using running kernel\'s modules." 2906 kernelname=`uname -r` 2930 2907 else 2931 USE_LILO=no 2908 LogIt "Using modules for kernel: ${kernelname}" 2932 2909 fi 2933 2910 … … 2973 2950 if [ "$1" = "--usb" ] ; then 2974 2951 shift 2975 USBDEV =$12976 if [ _"$USBDEV " = _"" ]; then2952 USBDEVICE=$1 2953 if [ _"$USBDEVICE" = _"" ]; then 2977 2954 Die "No USB device specified" 2978 2955 fi 2979 2956 shift 2980 2957 fi 2958 fi 2959 2960 # 2961 # Default value for parameters coming from mondo potentially 2962 # 2963 if [ "$ARCH" = "ia64" ] ; then 2964 USE_LILO=yes 2965 else 2966 USE_LILO=no 2967 fi 2968 2969 # 2970 # These variables are normaly only significant in a mondo environment 2971 # Not enforced yet 2972 # 2973 CDRECOVERY="no" 2974 NOT_BOOT="no" 2975 EXCLUDE_DEVS="" 2976 IMAGE_DEVS="" 2977 NFS_DEV="" 2978 if [ _"$MONDO_SHARE" != _"" ]; then 2981 2979 fi 2982 2980 … … 3000 2998 echo "Mindi v$MINDI_VERSION" 3001 2999 MindiExit 0 3002 elif [ "$ #" -ge "9" ] && [ "$1" = "--custom" ] ; then3000 elif [ "$1" = "--custom" ] ; then 3003 3001 if [ _"$MONDO_SHARE" = _"" ]; then 3004 3002 Die "--custom is reserved for mondoarchive calls" … … 3012 3010 mkdir -p $MINDI_TMP 3013 3011 # This is the scratch dir in mondo 3014 CACHE_LOC=$3 3015 if [ _"$CACHE_LOC" != _"" ]; then 3016 mkdir -p $CACHE_LOC 3017 fi 3018 kernelpath=$4; [ "$kernelpath" = "(null)" ] && kernelpath="" 3019 ### 3020 ### Attempt to locate kernel specific module path 3021 ### if module path is found then use it other wise use uname -r to set it... 3022 ### 3023 if [ "$kernelpath" = "" ]; then 3024 kernelpath=`TryToFindKernelPath` 3025 fi 3026 kernelname=`echo $kernelpath | cut -d'-' -f2-` 3027 LogIt "kernelname = $kernelname" 3028 LogIt "kernelpath = $kernelpath" 3029 if [ ! -d "/lib/modules/$kernelname" ] && [ "$kernelpath" != "FAILSAFE" ] 3030 then 3031 LogIt "Module path for ${kernelpath} not found..." 3032 LogIt "using running kernel\'s modules." 3033 kernelname=`uname -r` 3012 MINDI_CACHE=$3 3013 if [ _"$MINDI_CACHE" != _"" ]; then 3014 mkdir -p $MINDI_CACHE 3015 fi 3016 3017 if [ ! -e "$MONDORESTORECFG" ]; then 3018 Die "MONDORESTORECFG undefined. Use an uptodate mondoarchive version" 3019 fi 3020 3021 if [ ! -e "$MONDO_CACHE" ]; then 3022 Die "MONDO_CACHE undefined. Use an uptodate mondoarchive version" 3034 3023 else 3035 LogIt "Using modules for kernel: ${kernelname}" 3036 fi 3037 TAPEDEV=$5 3038 TAPESIZE=$6 3039 FILES_IN_FILELIST=$7 3040 USE_LZO=$8 3041 CDRECOVERY=$9 3042 if [ "${10}" = "(null)" ] || [ "${10}" = "" ] ; then 3024 # 3025 # Get from mondo our additional configuration 3026 # 3027 echo "Using $MONDO_CACHE/mindi.conf as additional config file" 3028 if [ -f $MONDO_CACHE/mindi.conf ]; then 3029 . $MONDO_CACHE/mindi.conf 3030 echo "-----------------------------" >> $LOGFILE 3031 echo " Mondo configuration file " >> $LOGFILE 3032 echo "-----------------------------" >> $LOGFILE 3033 cat $MONDO_CACHE/mindi.conf >> $LOGFILE 3034 echo "-----------------------------" >> $LOGFILE 3035 else 3036 Die "No mindi.conf file created by mondo. Aborting" 3037 fi 3038 fi 3039 3040 echo "Here is your mondoresctore.cfg file:" >> $LOGFILE 3041 echo "------------------------------------" >> $LOGFILE 3042 cat $MONDORESTORECFG >> $LOGFILE 3043 echo "-----------------------------------" >> $LOGFILE 3044 3045 CDRECOVERY=`grep use-cdrecovery $MONDORESTORECFG | cut -d' ' -f2` 3046 NOT_BOOT=`grep non-bootable $MONDORESTORECFG | cut -d' ' -f2` 3047 USE_LILO=`grep use-lilo $MONDORESTORECFG | cut -d' ' -f2` 3048 EXCLUDE_DEVS=`grep excluded-devs $MONDORESTORECFG | cut -d' ' -f2` 3049 NFS_DEV=`grep nfs-dev $MONDORESTORECFG | cut -d' ' -f2` 3050 VALUE=`grep image-devs $MONDORESTORECFG | cut -d' ' -f2` 3051 if [ "$VALUE" = "(null)" ] || [ "$VALUE" = "" ] ; then 3043 3052 IMAGE_DEVS="" 3044 3053 else 3045 IMAGE_DEVS="`echo "${10}" | tr '|' ' '`" 3046 fi 3047 if [ "${11}" ] ; then 3048 LILO_OPTIONS="" 3049 # LogIt "LILO will use conservative settings, to be compatible with older BIOSes." 3050 fi 3051 LAST_FILELIST_NUMBER=${12} 3052 ESTIMATED_TOTAL_NOOF_SLICES=${13} 3053 EXCLUDE_DEVS="${14}" 3054 USE_COMP="${15}" 3055 USE_LILO="${16}" 3056 USE_STAR="${17}" 3057 INTERNAL_TAPE_BLOCK_SIZE="${18}" 3058 DIFFERENTIAL="${19}" 3059 USE_GZIP="${20}" 3060 NOT_BOOT="${21}" 3061 [ "$USE_COMP" = "" ] && USE_COMP=yes 3062 [ "$USE_GZIP" = "" ] && USE_GZIP=no 3063 [ "$NOT_BOOT" = "" ] && NOT_BOOT=no 3064 [ "$TAPEDEV" ] && LogIt "This is a tape-based backup. Fine." 3065 [ "$CDRECOVERY" = "yes" ] && [ "$TAPEDEV" != "" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time" 3066 MONDO_ROOT=`echo $CACHE_LOC | sed 's/\(.*\)\/.*/\1/'` 3054 IMAGE_DEVS="`echo "$VALUE" | tr '|' ' '`" 3055 fi 3056 [ "$CDRECOVERY" = "yes" ] && [ "$PROMPT_MAKE_TAPE_IMAGE" = "yes" ] && Die "Sorry, you can't use --cd-recovery and --write-tapes at the same time" 3057 MONDO_ROOT=`echo $MINDI_CACHE | sed 's/\(.*\)\/.*/\1/'` 3067 3058 if [ _"$MONDO_ROOT" != _"" ]; then 3068 3059 mkdir -p $MONDO_ROOT … … 3108 3099 KERN_DISK_MADE="" 3109 3100 3110 echo "DIFFERENTIAL = $DIFFERENTIAL" >> $LOGFILE 3111 echo "INTERNAL TAPE BLOCK SIZE = $INTERNAL_TAPE_BLOCK_SIZE" >> $LOGFILE 3112 echo "NOT_BOOT = '$NOT_BOOT'" >> $LOGFILE 3113 if [ "$NOT_BOOT" != "" ] && [ "$NOT_BOOT" != "0" ] && [ "$NOT_BOOT" != "no" ] ; then 3114 LogIt "Just creating mondo-restore.cfg and a small all.tar.gz for Mondo. Nothing else." 3115 MakeMondoConfigFile $MINDI_TMP/mondo-restore.cfg 3116 MakeMountlist $MINDI_TMP/mountlist.txt 3101 if [ "$NOT_BOOT" = "yes" ]; then 3102 LogIt "Just creating a small all.tar.gz for Mondo. Nothing else." 3117 3103 mkdir -p $MINDI_TMP/small-all/tmp 3104 MakeMountlist $MINDI_TMP/small-all/tmp/mountlist.txt 3105 cp -f $MINDI_TMP/{filelist.full.gz,biggielist.txt} $MONDO_CACHE/mondo-restore.cfg $MINDI_CACHE/small-all/tmp 2>/dev/null || Die "Cannot copy small all.tar.gz" 3118 3106 cd $MINDI_TMP/small-all 3119 cp -f $MINDI_TMP/{mountlist.txt,mondo-restore.cfg,filelist.full.gz,biggielist.txt} tmp 2>/dev/null || Die "Cannot copy small all.tar.gz" 3120 tar -cv tmp | gzip -9 > $MINDI_TMP/all.tar.gz || Die "Cannot make small all.tar.gz" 3121 sleep 2 3107 tar -cv tmp | gzip -9 > $MINDI_CACHE/all.tar.gz || Die "Cannot make small all.tar.gz" 3108 sync 3122 3109 LogIt "Done. Exiting." 3123 3110 MindiExit 0 3124 3111 fi 3125 3112 3126 if [ _"$USBDEV" != _"" ]; then3127 LogIt "Including the generation of a Bootable USB device on $USBDEV "3113 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ]; then 3114 LogIt "Including the generation of a Bootable USB device on $USBDEVICE" 3128 3115 fi 3129 3116 if [ "$kernelpath" = "" ] ; then … … 3184 3171 YOUR_KERNEL_SUCKS="Your kernel sucks" 3185 3172 fi 3186 echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$ CACHE_LOC" >> $LOGFILE3173 echo -e "Mindi's temp dir = $MINDI_TMP \nMindi's output dir=$MINDI_CACHE" >> $LOGFILE 3187 3174 [ "$(($RANDOM%64))" -eq "0" ] && LogIt "Dude, I've looked inside your computer and it's really dusty..." 3188 3175 3189 3176 [ "$YOUR_KERNEL_SUCKS" ] && [ ! "$FAILSAFE_KVER" ] && Die "Please install mindi-kernel package. You need it.\nGo to http://www.mondorescue.org and download it, then install it." 3190 3177 3191 rm -f $ CACHE_LOC/{*img,*gz,*iso}3192 3193 PrepareDataDiskImages $ CACHE_LOC3178 rm -f $MINDI_CACHE/{*img,*gz,*iso} 3179 3180 PrepareDataDiskImages $MINDI_CACHE 3194 3181 noof_disks=$? 3195 3182 ramdisk_size=$(($size_of_all_tools+$EXTRA_SPACE)) … … 3200 3187 if [ "$USE_LILO" = "yes" ] ; then 3201 3188 if [ "$ARCH" = "ia64" ] ; then 3202 PrepareBootDiskImage_LILO $ CACHE_LOC$IA64_BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppy disk image."3203 else 3204 if ! PrepareBootDiskImage_LILO $ CACHE_LOC1722 $kernelpath $ramdisk_size ; then3189 PrepareBootDiskImage_LILO $MINDI_CACHE $IA64_BOOT_SIZE $kernelpath $ramdisk_size || Die "Failed to create ia64 floppy disk image." 3190 else 3191 if ! PrepareBootDiskImage_LILO $MINDI_CACHE 1722 $kernelpath $ramdisk_size ; then 3205 3192 LogIt "WARNING - failed to create 1.72MB boot image." 3206 3193 LogIt "Please reduce your kernel's size if you want to make a 1.72MB floppy disk." 3207 3194 fi 3208 if ! PrepareBootDiskImage_LILO $ CACHE_LOC2880 $kernelpath $ramdisk_size ; then3195 if ! PrepareBootDiskImage_LILO $MINDI_CACHE 2880 $kernelpath $ramdisk_size ; then 3209 3196 LogIt "WARNING - failed to create 2.88MB floppy disk image." 3210 3197 LogIt "Please reduce your kernel's size if you want to make a 2.88MB floppy disk." 3211 PrepareBootDiskImage_LILO $ CACHE_LOC5760 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image."3198 PrepareBootDiskImage_LILO $MINDI_CACHE 5760 $kernelpath $ramdisk_size || Die "Failed to create 2.88MB floppy disk image." 3212 3199 fi 3213 3200 fi 3214 3201 else 3215 if ! PrepareBootDiskImage_SYSLINUX $ CACHE_LOC1722 $kernelpath $ramdisk_size ; then3202 if ! PrepareBootDiskImage_SYSLINUX $MINDI_CACHE 1722 $kernelpath $ramdisk_size ; then 3216 3203 LogIt "WARNING - failed to create 1.72MB boot image." 3217 3204 LogIt "Please reduce your kernel's size if you want to make a 1.72MB floppy disk." 3218 if ! PrepareBootDiskImage_SYSLINUX $ CACHE_LOC2880 $kernelpath $ramdisk_size ; then3205 if ! PrepareBootDiskImage_SYSLINUX $MINDI_CACHE 2880 $kernelpath $ramdisk_size ; then 3219 3206 LogIt "WARNING - failed to create 2.88MB floppy disk image." 3220 3207 LogIt "Please reduce your kernel's size if you want to make a 2.88MB floppy disk." 3221 PrepareBootDiskImage_SYSLINUX $ CACHE_LOC5760 $kernelpath $ramdisk_size || Die "Failed to create 5.76MB floppy disk image."3208 PrepareBootDiskImage_SYSLINUX $MINDI_CACHE 5760 $kernelpath $ramdisk_size || Die "Failed to create 5.76MB floppy disk image." 3222 3209 fi 3223 3210 fi … … 3228 3215 3229 3216 if [ _"$MONDO_SHARE" = _"" ]; then 3230 ListImagesForUser $ CACHE_LOC3217 ListImagesForUser $MINDI_CACHE 3231 3218 boot_dev=/dev/fd0u1722 3232 3219 [ ! -e "$boot_dev" ] && mknod $boot_dev b 2 60 … … 3234 3221 [ ! -e "$boot_dev" ] && Die "Will you PLEASE tell your distribution maker to create the 1.72MB devices in /dev?" 3235 3222 if [ "$PROMPT_WRITE_BOOT_FLOPPIES" = "yes" ]; then 3236 OfferToCopyImagesToDisks $ CACHE_LOC$boot_dev $FDDEVICE3237 fi 3238 OfferToMakeBootableISO $ CACHE_LOC3239 if [ _"$USBDEV" != _"" ]; then3240 OfferToMakeBootableUSB $ CACHE_LOC3223 OfferToCopyImagesToDisks $MINDI_CACHE $boot_dev $FDDEVICE 3224 fi 3225 OfferToMakeBootableISO $MINDI_CACHE 3226 if [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ]; then 3227 OfferToMakeBootableUSB $MINDI_CACHE 3241 3228 fi 3242 3229 LogIt "Finished." 3243 elif [ "$ TAPEDEV" ] ; then3244 rm -f $ CACHE_LOC/{*img,*gz,*iso}3245 OfferToMakeBootableISO $ CACHE_LOC3246 if [ -e "$ CACHE_LOC/all.tar.gz" ] ; then3247 cp -f $ CACHE_LOC/all.tar.gz $MINDI_TMP/ 2>> $LOGFILE3230 elif [ "$PROMPT_MAKE_TAPE_IMAGE" = "yes" ] ; then 3231 rm -f $MINDI_CACHE/{*img,*gz,*iso} 3232 OfferToMakeBootableISO $MINDI_CACHE 3233 if [ -e "$MINDI_CACHE/all.tar.gz" ] ; then 3234 cp -f $MINDI_CACHE/all.tar.gz $MINDI_TMP/ 2>> $LOGFILE 3248 3235 else 3249 3236 Die "Cannot find all.tar.gz, to be written to tape" 3250 3237 fi 3251 elif [ _"$USBDEV" != _"" ]; then3252 OfferToMakeBootableUSB $ CACHE_LOC3238 elif [ "$PROMPT_MAKE_USB_IMAGE" = "yes" ]; then 3239 OfferToMakeBootableUSB $MINDI_CACHE 3253 3240 else 3254 OfferToMakeBootableISO $ CACHE_LOC3241 OfferToMakeBootableISO $MINDI_CACHE 3255 3242 fi 3256 3243 # cleanup -
branches/stable/mindi/rootfs/sbin/find-and-mount-cdrom
r273 r1087 8 8 [ ! "$SECOND_TRY" ] && LogIt "Trying $device" 9 9 if [ "`grep "using-cdstream yes" /tmp/mondo-restore.cfg`" ]; then 10 pwd=`pwd`11 cd $GROOVY10 pwd=`pwd` 11 cd $GROOVY 12 12 tar -zxf $device 2> /tmp/mount.log 13 13 res=$? 14 cd $pwd14 cd $pwd 15 15 if [ "$res" -eq "0" ] ; then 16 clear17 18 echo "Using cdstreaas extd dsk." > /tmp/TAPEDEV-HAS-DATA-DISKS19 20 21 fi16 clear 17 LogIt "Using cdstream as extended datadisk ($device). Good." 3 18 echo "Using cdstream as extd dsk." > /tmp/TAPEDEV-HAS-DATA-DISKS 19 ln -sf $device /dev/cdrom 20 exit 0 21 fi 22 22 else 23 23 mount $device -t iso9660 -o ro /mnt/cdrom 2> /tmp/mount.log 24 res=$?24 res=$? 25 25 fi 26 if [ "$res" -ne "0" ] ; then27 res=`cat /tmp/mount.log`28 if [ "$res" = "mount: No medium found" ] ; then26 if [ "$res" -ne "0" ] ; then 27 res=`cat /tmp/mount.log` 28 if [ "$res" = "mount: No medium found" ] ; then 29 29 [ ! "$SECOND_TRY" ] && LogIt "There is a CD-ROM drive at $device but no CD in it." 30 else30 else 31 31 [ ! "$SECOND_TRY" ] && LogIt "It's not in $device; I'll keep looking" 32 fi33 continue32 fi 33 continue 34 34 fi 35 35 LogIt "$device has a CD-ROM in it" -
branches/stable/mindi/rootfs/sbin/init
r1061 r1087 83 83 LoadKeymap() { 84 84 local fname 85 fname=` cat /tmp/KEYMAP-LIVES-HERE2> /dev/null`85 fname=`grep keymap-lives-here /tmp/mondo-restore.cfg | cut -d' ' -f2 2> /dev/null` 86 86 [ "$fname" = "" ] && return 87 87 if which loadkeys > /dev/null 2> /dev/null ; then -
branches/stable/mondo/src/common/libmondo-archive.c
r1080 r1087 27 27 28 28 #include "mr_mem.h" 29 #include "mr_str.h" 30 #include "mr_file.h" 31 29 32 #include <sys/sem.h> 30 33 #include <sys/types.h> … … 534 537 char *tmp; 535 538 char *tmp1 = NULL; 536 char *tmp2 = NULL;537 539 char *scratchdir; 538 540 char *command; 539 char *use_lzo_sz;540 char *use_gzip_sz;541 char *use_comp_sz;542 char *use_star_sz;543 541 char *bootldr_str; 544 542 char *tape_device; 545 543 char *last_filelist_number; 546 char *broken_bios_sz;547 char *cd_recovery_sz;548 544 char *tape_size_sz; 549 545 char *devs_to_exclude; 550 char *use_lilo_sz;551 546 char *value; 552 547 char *bootdev; 553 554 555 548 556 549 /*@ char ************************************************************** */ … … 563 556 int res = 0; 564 557 long estimated_total_noof_slices = 0; 558 559 FILE *fd = NULL; 565 560 566 561 assert(bkpinfo != NULL); … … 568 563 malloc_string(tmp); 569 564 malloc_string(scratchdir); 570 malloc_string(use_lzo_sz);571 malloc_string(use_gzip_sz);572 malloc_string(use_star_sz);573 malloc_string(use_comp_sz);574 565 malloc_string(bootldr_str); 575 malloc_string(tape_device);576 566 malloc_string(last_filelist_number); 577 malloc_string(broken_bios_sz);578 malloc_string(cd_recovery_sz);579 567 malloc_string(tape_size_sz); 580 568 malloc_string(devs_to_exclude); 581 malloc_string(use_lilo_sz); /* BCO: shared between LILO/ELILO */582 569 malloc_string(value); 583 570 malloc_string(bootdev); … … 588 575 bkpinfo->exclude_paths); 589 576 strcpy(devs_to_exclude, call_program_and_get_last_line_of_output(tmp)); 590 sprintf(tmp, "devs_to_exclude = '%s'", devs_to_exclude);591 577 log_msg(2, tmp); 592 578 mvaddstr_and_log_it(g_currentY, 0, … … 601 587 } 602 588 lines_in_filelist = count_lines_in_file(tmp); 603 sprintf(tmp, "%s/LAST-FILELIST-NUMBER", bkpinfo->tmpdir);604 589 strcpy(last_filelist_number, last_line_of_file(tmp)); 605 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {606 sprintf(tape_size_sz, "%ld", bkpinfo->media_size[1]);607 strcpy(tape_device, bkpinfo->media_device);608 } else {609 tape_size_sz[0] = '\0';610 tape_device[0] = '\0';611 }612 if (bkpinfo->use_lzo) {613 strcpy(use_lzo_sz, "yes");614 } else {615 strcpy(use_lzo_sz, "no");616 }617 if (bkpinfo->use_gzip) {618 strcpy(use_gzip_sz, "yes");619 } else {620 strcpy(use_gzip_sz, "no");621 }622 if (bkpinfo->use_star) {623 strcpy(use_star_sz, "yes");624 } else {625 strcpy(use_star_sz, "no");626 }627 628 if (bkpinfo->compression_level > 0) {629 strcpy(use_comp_sz, "yes");630 } else {631 strcpy(use_comp_sz, "no");632 }633 634 strcpy(broken_bios_sz, "yes"); /* assume so */635 if (g_cd_recovery) {636 strcpy(cd_recovery_sz, "yes");637 } else {638 strcpy(cd_recovery_sz, "no");639 }640 if (bkpinfo->make_cd_use_lilo) {641 strcpy(use_lilo_sz, "yes");642 } else {643 strcpy(use_lilo_sz, "no");644 }645 590 646 591 if (!bkpinfo->nonbootable_backup … … 758 703 bootldr_str, bkpinfo->boot_device); 759 704 log_to_screen(tmp); 760 sprintf(tmp, "%s/BOOTLOADER.DEVICE", bkpinfo->tmpdir);761 if (write_one_liner_data_file(tmp, bkpinfo->boot_device)) {762 log_msg(1, "%ld: Unable to write one-liner boot device", __LINE__);763 }764 switch (bkpinfo->backup_media_type) {765 case cdr:766 strcpy(value, "cdr");767 break;768 case cdrw:769 strcpy(value, "cdrw");770 break;771 case cdstream:772 strcpy(value, "cdstream");773 break;774 case tape:775 strcpy(value, "tape");776 break;777 case udev:778 strcpy(value, "udev");779 break;780 case iso:781 strcpy(value, "iso");782 break;783 case nfs:784 strcpy(value, "nfs");785 break;786 case dvd:787 strcpy(value, "dvd");788 break;789 case usb:790 strcpy(value, "usb");791 break;792 default:793 fatal_error("Unknown backup_media_type");794 }795 sprintf(tmp, "%s/BACKUP-MEDIA-TYPE", bkpinfo->tmpdir);796 if (write_one_liner_data_file(tmp, value)) {797 res++;798 log_msg(1, "%ld: Unable to write one-liner backup-media-type",799 __LINE__);800 }801 log_to_screen(bkpinfo->tmpdir);802 sprintf(tmp, "%s/BOOTLOADER.NAME", bkpinfo->tmpdir);803 if (write_one_liner_data_file(tmp, bootldr_str)) {804 res++;805 log_msg(1, "%ld: Unable to write one-liner bootloader.name",806 __LINE__);807 }808 sprintf(tmp, "%s/DIFFERENTIAL", bkpinfo->tmpdir);809 if (bkpinfo->differential) {810 res += write_one_liner_data_file(tmp, "1");811 } else {812 res += write_one_liner_data_file(tmp, "0");813 }814 815 if (g_getfattr) {816 mr_asprintf(&tmp1, "%s/XATTR", bkpinfo->tmpdir);817 if (write_one_liner_data_file(tmp1, "TRUE")) {818 log_msg(1, "%ld: Unable to write one-liner XATTR",819 __LINE__);820 }821 mr_free(tmp1);822 }823 if (g_getfacl) {824 mr_asprintf(&tmp1, "%s/ACL", bkpinfo->tmpdir);825 if (write_one_liner_data_file(tmp1, "TRUE")) {826 log_msg(1, "%ld: Unable to write one-liner ACL",827 __LINE__);828 }829 mr_free(tmp1);830 }831 705 832 706 estimated_total_noof_slices = … … 843 717 log_OS_error("Unable to make mnt floppy directory"); 844 718 } 845 sprintf(tmp, "BTW, I'm telling Mindi your kernel is '%s'", 846 bkpinfo->kernel_path); 847 848 log_msg(1, "lines_in_filelist = %ld", lines_in_filelist); 719 720 /* Prepare interface with mindi through a configuration file 721 * under /var/cache/mondo by default 722 * and the mondorestore configuration file at the same time that 723 * will be included by mindi on the initrd */ 724 725 fd = mr_fopen(MONDO_CACHE"/mindi.conf", "w"); 726 fd1 = mr_fopen(MONDORESTORECFG, "a"); 727 728 mr_fprintf(fd, "mindi_kernel=%s\n", bkpinfo->kernel_path); 729 mr_fprintf(fd, "mindi_use_own_kernel=yes\n"); 730 731 mr_fprintf(fd1, "files-in-filelist %ld\n", lines_in_filelist); 732 mr_fprintf(fd1, "internal-tape-block-size %ld\n", bkpinfo->internal_tape_block_size); 733 mr_fprintf(fd1, "total-slices %ld\n", estimated_total_noof_slices); 734 mr_fprintf(fd1, "excluded-devs %s\n", devs_to_exclude); 735 mr_fprintf(fd1, "image-devs %s\n", bkpinfo->image_devs); 736 mr_fprintf(fd1, "last-filelist-number %s\n", last_filelist_number); 737 mr_fprintf(fd1, "bootloader.name %s\n", bootldr_str); 738 mr_fprintf(fd1, "bootloader.device %s\n", bkpinfo->boot_device); 739 740 switch (bkpinfo->backup_media_type) { 741 case cdr: 742 mr_fprintf(fd1, "backup-media-type cdr\n"); 743 break; 744 case cdrw: 745 mr_fprintf(fd1, "backup-media-type cdrw\n"); 746 break; 747 case cdstream: 748 mr_fprintf(fd1, "backup-media-type cdstream\n"); 749 break; 750 case tape: 751 mr_fprintf(fd1, "backup-media-type tape\n"); 752 break; 753 case udev: 754 mr_fprintf(fd1, "backup-media-type udev\n"); 755 break; 756 case iso: 757 mr_fprintf(fd1, "backup-media-type iso\n"); 758 break; 759 case nfs: 760 mr_fprintf(fd1, "backup-media-type nfs\n"); 761 break; 762 case dvd: 763 mr_fprintf(fd1, "backup-media-type dvd\n"); 764 break; 765 case usb: 766 mr_fprintf(fd1, "backup-media-type usb\n"); 767 break; 768 default: 769 fatal_error("Unknown backup_media_type"); 770 } 849 771 850 772 if (bkpinfo->backup_media_type == usb) { 851 mr_asprintf(&tmp2, "--usb %s", bkpinfo->media_device); 773 mr_fprintf(fd, "mindi_write_usb=yes\n"); 774 mr_fprintf(fd, "mindi_usb_device=%s\n", bkpinfo->media_device); 775 } 776 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 777 mr_fprintf(fd, "mindi_write_tape=yes\n"); 778 mr_fprintf(fd, "mindi_tape_device=%s\n", bkpinfo->media_device); 779 mr_fprintf(fd1, "media-dev %s\n", bkpinfo->media_device); 780 mr_fprintf(fd1, "media-size %ld\n", bkpinfo->media_size[1]); 781 } 782 if (bkpinfo->compression_level > 0) { 783 mr_fprintf(fd1, "use-comp yes\n"); 852 784 } else { 853 mr_asprintf(&tmp2,""); 854 } 785 mr_fprintf(fd1, "use-comp no\n"); 786 } 787 if (bkpinfo->use_gzip) { 788 mr_fprintf(fd1, "use-gzip yes\n"); 789 } else { 790 mr_fprintf(fd1, "use-gzip no\n"); 791 } 792 if (bkpinfo->use_lzo) { 793 mr_fprintf(fd1, "use-lzo yes\n"); 794 } else { 795 mr_fprintf(fd1, "use-lzo no\n"); 796 } 797 if (bkpinfo->use_star) { 798 mr_fprintf(fd1, "use-star yes\n"); 799 } else { 800 mr_fprintf(fd1, "use-star no\n"); 801 } 802 if (g_getfattr) { 803 mr_fprintf(fd1, "xattr yes\n"); 804 } else { 805 mr_fprintf(fd1, "xattr no\n"); 806 } 807 if (g_getfacl) { 808 mr_fprintf(fd1, "acl yes\n"); 809 } else { 810 mr_fprintf(fd1, "acl no\n"); 811 } 812 813 if (g_cd_recovery) { 814 mr_fprintf(fd1, "use-cdrecovery yes\n"); 815 } else { 816 mr_fprintf(fd1, "use-cdrecovery no\n"); 817 } 818 if (bkpinfo->make_cd_use_lilo) { 819 mr_fprintf(fd1, "use-lilo yes\n"); 820 } else { 821 mr_fprintf(fd1, "use-lilo no\n"); 822 } 823 if (bkpinfo->nonbootable_backup) { 824 mr_fprintf(fd1, "non-bootable yes\n"); 825 } else { 826 mr_fprintf(fd1, "non-bootable no\n"); 827 } 828 if (bkpinfo->differential) { 829 mr_fprintf(fd1, "differential 1\n"); 830 } else { 831 mr_fprintf(fd1, "differential 0\n"); 832 } 833 834 mr_fclose(fd); 835 mr_fprintf(fd1, "datestamp %s\n", mr_date()); 836 mr_fclose(fd1); 855 837 856 838 sprintf(command, 857 /* "mindi --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \ 858 6=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \ 859 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/ 860 "mindi %s --custom '%s' '%s/images' '%s' '%s' \ 861 '%s' %ld '%s' '%s' '%s' \ 862 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", 863 tmp2, 839 "mindi --custom '%s' '%s/images'", 864 840 bkpinfo->tmpdir, // parameter #2 865 841 bkpinfo->scratchdir, // parameter #3 866 bkpinfo->kernel_path, // parameter #4 867 tape_device, // parameter #5 868 tape_size_sz, // parameter #6 869 lines_in_filelist, // parameter #7 (INT) 870 use_lzo_sz, // parameter #8 871 cd_recovery_sz, // parameter #9 872 bkpinfo->image_devs, // parameter #10 873 broken_bios_sz, // parameter #11 874 last_filelist_number, // parameter #12 (STRING) 875 estimated_total_noof_slices, // parameter #13 (INT) 876 devs_to_exclude, // parameter #14 877 use_comp_sz, // parameter #15 878 use_lilo_sz, // parameter #16 879 use_star_sz, // parameter #17 880 bkpinfo->internal_tape_block_size, // parameter #18 (LONG) 881 bkpinfo->differential, // parameter #19 (INT) 882 use_gzip_sz); // parameter #20 (STRING) 883 884 mr_free(tmp2); 885 886 // Watch it! This next line adds a parameter... 887 if (bkpinfo->nonbootable_backup) { 888 strcat(command, " NONBOOTABLE"); // parameter #21 (STRING) 889 } 842 //bkpinfo->kernel_path, // parameter #4 843 //tape_device, // parameter #5 844 //tape_size_sz, // parameter #6 845 //lines_in_filelist, // parameter #7 (INT) 846 //use_lzo_sz, // parameter #8 847 //cd_recovery_sz, // parameter #9 848 //bkpinfo->image_devs, // parameter #10 849 //broken_bios_sz, // parameter #11 always yes 850 //last_filelist_number, // parameter #12 (STRING) 851 //estimated_total_noof_slices, // parameter #13 (INT) 852 //devs_to_exclude, // parameter #14 853 //use_comp_sz, // parameter #15 854 //use_lilo_sz, // parameter #16 855 //use_star_sz, // parameter #17 856 //bkpinfo->internal_tape_block_size, // parameter #18 (LONG) 857 //bkpinfo->differential, // parameter #19 (INT) 858 //use_gzip_sz); // parameter #20 (STRING) 859 ); 860 890 861 log_msg(2, command); 891 862 892 // popup_and_OK("Pausing"); 893 894 res = 895 run_program_and_log_to_screen(command, 896 "Generating boot+data disks"); 863 res = run_program_and_log_to_screen(command, "Generating boot+data disks"); 897 864 if (bkpinfo->nonbootable_backup) { 898 865 res = 0; … … 936 903 } 937 904 mr_free(tmp); 938 mr_free(use_lzo_sz);939 mr_free(use_gzip_sz);940 905 mr_free(scratchdir); 941 mr_free(use_comp_sz);942 906 mr_free(bootldr_str); 943 mr_free(tape_device);944 907 mr_free(last_filelist_number); 945 mr_free(broken_bios_sz);946 908 mr_free(cd_recovery_sz); 947 909 mr_free(tape_size_sz); 948 910 mr_free(devs_to_exclude); 949 mr_free(use_lilo_sz);950 911 mr_free(value); 951 912 mr_free(bootdev); 952 913 mr_free(command); 953 mr_free(use_star_sz);954 914 return (res); 955 915 } … … 1162 1122 closeout_tape(bkpinfo); 1163 1123 } else 1164 /* write final ISO */1124 /* write final ISO/USB */ 1165 1125 { 1166 1126 res = write_final_iso_if_necessary(bkpinfo); … … 1892 1852 if (bkpinfo->nonbootable_backup) { 1893 1853 log_msg(1, "Making nonbootable backup"); 1894 // FIXME --- change mkisofs string to MONDO_MKISOFS_NONBOOTABLE and add ' .' at end1895 1854 res = 1896 1855 eval_call_to_make_ISO(bkpinfo, … … 3658 3617 bkpinfo->media_size[g_current_media_number]) { 3659 3618 sprintf(tmp, 3660 "Warning! CD is too big. It occupies %ld KB, which is more than the %ld KB allowed.", 3619 "Warning! %s is too big. It occupies %ld KB, which is more than the %ld KB allowed.", 3620 media_descriptor_string(bkpinfo->backup_media_type), 3661 3621 (long) space_occupied_by_cd(bkpinfo->scratchdir), 3662 3622 (long) bkpinfo->media_size[g_current_media_number]); 3663 3623 log_to_screen(tmp); 3664 3624 } 3665 sprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, 3625 if (bkpinfo->backup_media_type != usb) { 3626 sprintf(isofile, "%s/%s/%s-%d.iso", bkpinfo->isodir, 3666 3627 bkpinfo->nfs_remote_dir, bkpinfo->prefix, 3667 3628 g_current_media_number); 3629 } else { 3630 } 3668 3631 for (that_one_was_ok = FALSE; !that_one_was_ok;) { 3669 res = make_iso_fs(bkpinfo, isofile); 3632 if (bkpinfo->backup_media_type != usb) { 3633 res = make_iso_fs(bkpinfo, isofile); 3634 } else { 3635 } 3670 3636 if (g_current_media_number == 1 && !res 3671 3637 && (bkpinfo->backup_media_type == cdr … … 3968 3934 3969 3935 setenv("MONDO_SHARE", MONDO_SHARE, 1); 3936 setenv("MONDORESTORECFG", MONDORESTORECFG, 1); 3937 setenv("MONDO_CACHE", MONDO_CACHE, 1); 3970 3938 } -
branches/stable/mondo/src/common/libmondo-files.c
r1080 r1087 20 20 #include "libmondo-fork-EXT.h" 21 21 #include "libmondo-string-EXT.h" 22 23 #include "mr_file.h" 22 24 23 25 /*@unused@*/ … … 1157 1159 char command[MAX_STR_LEN * 2]; 1158 1160 1161 FILE *fd1 = NULL; 1162 1159 1163 /*@ pointers ***** */ 1160 1164 char *p; … … 1218 1222 } 1219 1223 1220 sprintf(tmp, "%s/NFS-DEV", bkpinfo->tmpdir); 1221 write_one_liner_data_file(tmp, nfs_dev); 1222 1223 sprintf(tmp, "%s/NFS-CLIENT-IPADDR", bkpinfo->tmpdir); 1224 write_one_liner_data_file(tmp, nfs_client_ipaddr); 1225 sprintf(tmp, "%s/NFS-CLIENT-NETMASK", bkpinfo->tmpdir); 1226 write_one_liner_data_file(tmp, nfs_client_netmask); 1227 sprintf(tmp, "%s/NFS-CLIENT-BROADCAST", bkpinfo->tmpdir); 1228 write_one_liner_data_file(tmp, nfs_client_broadcast); 1229 sprintf(tmp, "%s/NFS-CLIENT-DEFGW", bkpinfo->tmpdir); 1230 write_one_liner_data_file(tmp, nfs_client_defgw); 1231 sprintf(tmp, "%s/NFS-SERVER-IPADDR", bkpinfo->tmpdir); 1232 write_one_liner_data_file(tmp, nfs_server_ipaddr); 1233 sprintf(tmp, "%s/NFS-SERVER-MOUNT", bkpinfo->tmpdir); 1234 write_one_liner_data_file(tmp, bkpinfo->nfs_mount); 1235 sprintf(tmp, "%s/NFS-SERVER-PATH", bkpinfo->tmpdir); 1236 write_one_liner_data_file(tmp, bkpinfo->nfs_remote_dir); 1237 sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir); 1238 write_one_liner_data_file(tmp, bkpinfo->prefix); 1224 fd1 = mr_fopen(MONDORESTORECFG, "a"); 1225 1226 mr_fprintf(fd1, "nfs-dev %s\n", nfs_dev); 1227 mr_fprintf(fd1, "nfs-client-ipaddr %s\n", nfs_client_ipaddr); 1228 mr_fprintf(fd1, "nfs-client-netmask %s\n", nfs_client_netmask); 1229 mr_fprintf(fd1, "nfs-client-broadcast %s\n", nfs_client_broadcast); 1230 mr_fprintf(fd1, "nfs-client-defgw %s\n", nfs_client_defgw); 1231 mr_fprintf(fd1, "nfs-server-ipaddr %s\n", nfs_server_ipaddr); 1232 mr_fprintf(fd1, "nfs-server-mount %s\n", bkpinfo->nfs_mount); 1233 mr_fprintf(fd1, "nfs-server-path %s\n", bkpinfo->nfs_remote_dir); 1234 mr_fprintf(fd1, "iso-prefix %s\n", bkpinfo->prefix); 1235 mr_flcose(fd1); 1236 1239 1237 log_it("Finished storing NFS configuration"); 1240 1238 } -
branches/stable/mondo/src/common/libmondo-tools.c
r1080 r1087 11 11 #include "my-stuff.h" 12 12 #include "mr_mem.h" 13 #include "mr_file.h" 13 14 #include "mondostructures.h" 14 15 #include "lib-common-externs.h" … … 409 410 char *iso_tmp; 410 411 char *iso_path; 412 FILE *fd1 = NULL; 411 413 412 414 assert(bkpinfo != NULL); … … 643 645 bkpinfo->isodir); 644 646 log_it("command = %s", command); 645 log_it("res of it = %s",646 call_program_and_get_last_line_of_output(command));647 647 sprintf(iso_dev, "%s", 648 648 call_program_and_get_last_line_of_output(command)); 649 sprintf(tmp, "%s/ISO-DEV", bkpinfo->tmpdir);650 write_one_liner_data_file(tmp, 651 call_program_and_get_last_line_of_output652 (command));649 log_it("res of it = %s", iso_dev); 650 651 fd1 = mr_fopen(MONDORESTORECFG, "a"); 652 mr_fprintf(fd1, "iso-dev %s\n", iso_dev); 653 653 654 654 sprintf(command, "mount | grep -w %s | tail -n1 | cut -d' ' -f3", 655 655 iso_dev); 656 656 log_it("command = %s", command); 657 log_it("res of it = %s",658 call_program_and_get_last_line_of_output(command));659 657 sprintf(iso_mnt, "%s", 660 658 call_program_and_get_last_line_of_output(command)); 661 sprintf(tmp, "%s/ISO-MNT", bkpinfo->tmpdir); 662 write_one_liner_data_file(tmp, 663 call_program_and_get_last_line_of_output 664 (command)); 659 660 log_it("res of it = %s", iso_mnt); 661 mr_fprintf(fd1, "iso-mnt %s\n", iso_mnt); 665 662 log_it("isomnt: %s, %d", iso_mnt, strlen(iso_mnt)); 663 666 664 sprintf(iso_tmp, "%s", bkpinfo->isodir); 667 665 if (strlen(iso_tmp) < strlen(iso_mnt)) { … … 670 668 sprintf(iso_path, "%s", iso_tmp + strlen(iso_mnt)); 671 669 } 672 sprintf(tmp, "%s/ISODIR", bkpinfo->tmpdir);673 write_one_liner_data_file(tmp, iso_path);674 670 log_it("isodir: %s", iso_path); 675 sprintf(tmp, "%s/ISO-PREFIX", bkpinfo->tmpdir);676 write_one_liner_data_file(tmp, bkpinfo->prefix); 671 mr_fprintf(fd1, "isodir %s\n", iso_path); 672 677 673 log_it("iso-prefix: %s", bkpinfo->prefix); 678 679 /* End patch */ 674 mr_fprintf(fd1, "iso-prefix %s\n", bkpinfo->prefix); 675 676 mr_flcose(fd1); 680 677 } // end of iso code 681 678 -
branches/stable/mondo/src/include/mr_str.h
r1064 r1087 13 13 extern inline char *mr_strtok(char *instr, const char *delims, int *lastpos); 14 14 extern inline char *mr_stresc(char *instr, char *toesc, const char escchr); 15 extern inline char *mr_date(void); 15 16 16 17 #endif /* MR_STR_H */ -
branches/stable/mondo/src/include/my-stuff.h
r1080 r1087 13 13 /*The number of lines of log output to keep at the bottom of the screen.*/ 14 14 #define NOOF_ERR_LINES 6 15 16 /* Hardcoded: Bad for the moment */ 17 #define MONDO_CACHE "/var/cache/mondo" 18 #define MONDORESTORECFG MONDO_CACHE"/mondo-restore.cfg" 19 15 20 16 21 /** -
branches/stable/mondo/src/lib/Makefile.am
r1054 r1087 7 7 noinst_LIBRARIES = libmr.a 8 8 9 libmr_a_SOURCES = mr_conf.c mr_str.c mr_mem.c mr_err.c mr_msg.c 9 libmr_a_SOURCES = mr_conf.c mr_str.c mr_mem.c mr_err.c mr_msg.c mr_file.c -
branches/stable/mondo/src/lib/mr_str.c
r1054 r1087 8 8 #include <stdio.h> 9 9 #include <string.h> 10 #include <time.h> 10 11 11 12 #include "mr_mem.h" … … 105 106 return retstr; 106 107 } 108 109 /* Return a string containing the date */ 110 char *mr_date(void) { 111 112 time_t tcurr; 113 114 tcurr = time(NULL); 115 return(ctime(&tcurr)); 116 } 117 -
branches/stable/mondo/src/mondoarchive/main.c
r1080 r1087 19 19 #include "../common/libmondo.h" 20 20 #include "mondo-cli-EXT.h" 21 22 #include "mr_str.h" 21 23 22 24 // for CVS … … 139 141 } 140 142 141 /* Return a string containing the date */142 char *mr_date(void) {143 144 time_t tcurr;145 146 tcurr = time(NULL);147 return(ctime(&tcurr));148 }149 150 143 /*-----------------------------------------------------------*/ 151 144 -
branches/stable/mondo/src/mondorestore/mondo-rstr-newt.c
r1080 r1087 5 5 #include "mr_mem.h" 6 6 7 extern char *g_mondo_cfg_file; // where m*ndo-restore.cfg (the config file) is stored 7 8 8 9 /** … … 2265 2266 char *isodir_path, bool nuke_me_please) 2266 2267 { 2268 char *value = NULL; 2267 2269 2268 2270 /** initialize ********************************************************/ 2271 malloc_string(value); 2269 2272 2270 2273 assert(isodir_device != NULL); … … 2272 2275 assert(isodir_path != NULL); 2273 2276 2274 log_it("%d - AAA - isodir_path = %s", isodir_path);2277 log_it("%d - AAA - isodir_path = %s", __LINE__, isodir_path); 2275 2278 isodir_format[0] = '\0'; 2276 2279 if (isodir_device[0] == '\0') { … … 2280 2283 strcpy(isodir_path, "/"); 2281 2284 } 2282 if ( does_file_exist("/tmp/NFS-SERVER-PATH")) {2283 strcpy(isodir_device, last_line_of_file("/tmp/NFS-SERVER-MOUNT"));2285 if (read_cfg_var(g_mondo_cfg_file, "nfs-server-path", value) == 0) { 2286 read_cfg_var(g_mondo_cfg_file, "nfs-server-mount", isodir_device); 2284 2287 strcpy(isodir_format, "nfs"); 2285 strcpy(isodir_path, last_line_of_file("/tmp/NFS-SERVER-PATH")); 2286 } 2288 strcpy(isodir_path, value); 2289 } 2290 mr_free(value); 2291 2287 2292 if (nuke_me_please) { 2288 2293 return (TRUE); -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1080 r1087 978 978 979 979 read_cfg_var(cfg_file, "acl", value); 980 if (strstr(value, " TRUE")) {980 if (strstr(value, "yes")) { 981 981 mr_asprintf(&g_getfacl,"setfacl"); 982 982 log_msg(1, "We will restore ACLs"); … … 986 986 } 987 987 read_cfg_var(cfg_file, "xattr", value); 988 if (strstr(value, " TRUE")) {988 if (strstr(value, "yes")) { 989 989 mr_asprintf(&g_getfattr,"setfattr"); 990 990 log_msg(1, "We will restore XATTRs");
Note:
See TracChangeset
for help on using the changeset viewer.