Changeset 2635 in MondoRescue for branches/2.2.10/mondo
- Timestamp:
- May 17, 2010, 5:57:40 AM (14 years ago)
- Location:
- branches/2.2.10/mondo
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/README
r2087 r2635 55 55 https://lists.sourceforge.net/lists/listinfo/mondo-devel for further 56 56 information and the opportunity to subscribe to or unsubscribe from the list. 57 58 License 59 ======= 60 61 This program is free software; you can redistribute it and/or modify 62 it under the terms of the GNU General Public License as published by 63 the Free Software Foundation; either version 2 of the License, or 64 (at your option) any later version. 65 66 This license was given to MondoRescue by the original author Hugo Rabson, and is 67 continue its current maintainer Bruno Cornec. 68 -
branches/2.2.10/mondo/src/common/libmondo-archive.c
r2623 r2635 1711 1711 if (bkpinfo->nonbootable_backup) { 1712 1712 log_msg(1, "Making nonbootable backup"); 1713 // FIXME --- change mkisofs string to MONDO_MKISOFS_NONBOOTABLE and add ' .' at end 1714 res = eval_call_to_make_ISO("mkisofs -o '_ISO_' -r -p MondoRescue -publisher www.mondorescue.org -A MondoRescue_GPL -V _CD#_ .", destfile, g_current_media_number, message_to_screen); 1713 res = eval_call_to_make_ISO(MONDO_MKISOFS"-o '_ISO_' -V _CD#_ .", destfile, g_current_media_number, MONDO_LOGFILE, message_to_screen); 1715 1714 } else { 1716 1715 log_msg(1, "Making bootable backup"); … … 1725 1724 if (bkpinfo->make_cd_use_lilo) { 1726 1725 log_msg(1, "make_cd_use_lilo = TRUE"); 1727 // FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo1728 // and add ' .' at end1729 1726 #ifdef __IA64__ 1730 1727 log_msg(1, "IA64 --> elilo"); 1731 res = eval_call_to_make_ISO( "mkisofs -no-emul-boot -b images/mindi-bootroot." IA64_BOOT_SIZE ".img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", destfile, g_current_media_number, message_to_screen);1728 res = eval_call_to_make_ISO(MONDO_MKISOFS_REGULAR_ELILO"-o '_ISO_' -V _CD#_ .", destfile, g_current_media_number, MONDO_LOGFILE, message_to_screen); 1732 1729 #else 1733 // FIXME --- change mkisofs string to MONDO_MKISOFS_REGULAR_SYSLINUX/LILO depending on bkpinfo->make_cd_usE_lilo1734 // and add ' .' at end1735 1730 log_msg(1, "Non-ia64 --> lilo"); 1736 res =1737 eval_call_to_make_ISO("mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", destfile, g_current_media_number, message_to_screen);1731 // FIXME: fixed boot size probably wrong. lilo to be removed 1732 res = eval_call_to_make_ISO(MONDO_MKISOFS"-b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -V _CD#_ .", destfile, g_current_media_number, MONDO_LOGFILE, message_to_screen); 1738 1733 #endif 1739 1734 } else { 1740 1735 log_msg(1, "make_cd_use_lilo = FALSE"); 1741 1736 log_msg(1, "Isolinux"); 1742 res = eval_call_to_make_ISO( "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", destfile, g_current_media_number, message_to_screen);1737 res = eval_call_to_make_ISO(MONDO_MKISOFS_REGULAR_SYSLINUX"-o '_ISO_' -V _CD#_ .", destfile, g_current_media_number, MONDO_LOGFILE, message_to_screen); 1743 1738 } 1744 1739 } -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2623 r2635 120 120 121 121 tmp = where_is_root_mounted(); 122 log_msg(0, "root is currently mounted at %s \n", tmp);122 log_msg(0, "root is currently mounted at %s", tmp); 123 123 124 124 #ifdef __FreeBSD__ … … 1877 1877 while (DSFptr != NULL) { 1878 1878 if (DSFptr->check) { 1879 log_msg (4, "%s is mounted on %s and is on disk %s \n", DSFptr->device, DSFptr->mount_point, ndsf);1879 log_msg (4, "%s is mounted on %s and is on disk %s", DSFptr->device, DSFptr->mount_point, ndsf); 1880 1880 strcat(*included_dsf_list, DSFptr->mount_point); 1881 1881 strcat(*included_dsf_list, " "); 1882 1882 } else { 1883 log_msg (4, "%s is mounted on %s and is NOT on disk %s \n", DSFptr->device, DSFptr->mount_point, ndsf);1883 log_msg (4, "%s is mounted on %s and is NOT on disk %s", DSFptr->device, DSFptr->mount_point, ndsf); 1884 1884 strcat(*excluded_dsf_list, DSFptr->mount_point); 1885 1885 strcat(*excluded_dsf_list, " "); … … 1921 1921 if (mode == 'E') { 1922 1922 if (strlen(mounted_on_dsf)) { 1923 log_to_screen("Excluding the following file systems on %s: \n", token);1924 log_to_screen(" %s\n", mounted_on_dsf);1923 log_to_screen("Excluding the following file systems on %s:", token); 1924 log_to_screen("==> %s", mounted_on_dsf); 1925 1925 log_msg (5, "Adding to bkpinfo->exclude_paths due to -E option: %s", mounted_on_dsf); 1926 1926 mr_strcat(bkpinfo->exclude_paths, " %s ", mounted_on_dsf); … … 1928 1928 } 1929 1929 } else { 1930 log_to_screen("Archiving only the following file systems on %s:\n", token); 1931 log_to_screen(" %s\n", mounted_on_dsf); 1932 strcpy(bkpinfo->include_paths, "/"); 1930 log_to_screen("Archiving only the following file systems on %s:", token); 1931 log_to_screen("==> %s", mounted_on_dsf); 1932 mr_free(bkpinfo->include_paths); 1933 mr_asprintf(bkpinfo->include_paths, "%s", "/"); 1933 1934 if (strlen(not_mounted_on_dsf)) { 1934 1935 log_msg (5, "Adding to bkpinfo->exclude_paths due to -I option: %s", not_mounted_on_dsf); 1935 log_to_screen("Not archiving the following file systems: \n");1936 log_to_screen(" %s\n", not_mounted_on_dsf);1937 mr_strcat(bkpinfo->exclude_paths, " %s ", mounted_on_dsf);1936 log_to_screen("Not archiving the following file systems:"); 1937 log_to_screen("==> %s", not_mounted_on_dsf); 1938 mr_strcat(bkpinfo->exclude_paths, " %s ", not_mounted_on_dsf); 1938 1939 } 1939 1940 } … … 2789 2790 /* Never try to eject a NETFS device */ 2790 2791 bkpinfo->please_dont_eject = TRUE; 2792 /* Force NFS to be the protocol by default */ 2793 if (bkpinfo->netfs_proto == NULL) { 2794 mr_asprintf(bkpinfo->netfs_proto, "nfs"); 2795 } 2791 2796 2792 2797 /* Initiate bkpinfo netfs_mount path from running environment if not already done */ … … 2851 2856 mr_free(command); 2852 2857 2853 p = popup_and_get_string("Network protocol", "Which Network protocol should I use?", bkpinfo->netfs_proto); 2854 if (p == NULL) { 2855 log_to_screen("User has chosen not to backup the PC"); 2856 finish(1); 2857 } 2858 mr_free(bkpinfo->netfs_proto); 2859 bkpinfo->netfs_proto = p; 2860 2861 p = popup_and_get_string("Network share", "Which remote Network share should I mount?", bkpinfo->netfs_mount); 2862 if (p == NULL) { 2863 log_to_screen("User has chosen not to backup the PC"); 2864 finish(1); 2865 } 2866 mr_free(bkpinfo->netfs_mount); 2867 bkpinfo->netfs_mount = p; 2868 } 2858 } 2859 p = popup_and_get_string("Network protocol", "Which Network protocol should I use?", bkpinfo->netfs_proto); 2860 if (p == NULL) { 2861 log_to_screen("User has chosen not to backup the PC"); 2862 finish(1); 2863 } 2864 mr_free(bkpinfo->netfs_proto); 2865 bkpinfo->netfs_proto = p; 2866 2867 p = popup_and_get_string("Network share", "Which remote Network share should I mount?", bkpinfo->netfs_mount); 2868 if (p == NULL) { 2869 log_to_screen("User has chosen not to backup the PC"); 2870 finish(1); 2871 } 2872 mr_free(bkpinfo->netfs_mount); 2873 bkpinfo->netfs_mount = p; 2874 2869 2875 /* Initiate bkpinfo isodir path from running environment if mount already done */ 2870 2876 mr_free(bkpinfo->isodir); -
branches/2.2.10/mondo/src/common/libmondo-filelist.c
r2623 r2635 1358 1358 #if linux 1359 1359 // 2.6 has /sys as a proc-type thing -- must be excluded 1360 mr_asprintf(strtmp, "find '%s' -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o -fstype proc -prune -o -fstype sysfs -prune -o -fstype rpc_pipefs -prune -o %s -type d -print > %s 2> /dev/null", dir, find_excludes, g_skeleton_filelist);1360 mr_asprintf(strtmp, "find '%s' -fstype mvfs -prune -o -fstype devpts -prune -o -fstype tmpfs -prune -o -fstype proc -prune -o -fstype sysfs -prune -o -fstype rpc_pipefs -prune -o -fstype none -prune -o %s -type d -print > %s 2> /dev/null", dir, find_excludes, g_skeleton_filelist); 1361 1361 #else 1362 1362 // On BSD, for example, /sys is the kernel sources -- don't exclude -
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2607 r2635 514 514 515 515 if (bkpinfo->nonbootable_backup) { 516 mr_asprintf(mondo_mkisofs_sz, MONDO_MKISOFS _NONBOOT);516 mr_asprintf(mondo_mkisofs_sz, MONDO_MKISOFS); 517 517 } else if 518 518 #ifdef __FreeBSD__ … … 523 523 #ifdef __IA64__ 524 524 { 525 mr_asprintf(mondo_mkisofs_sz, MONDO_MKISOFS_REGULAR_ELILO);525 mr_asprintf(mondo_mkisofs_sz, "%s -V _CD#_", MONDO_MKISOFS_REGULAR_ELILO); 526 526 } 527 527 #else 528 528 { 529 mr_asprintf(mondo_mkisofs_sz, MONDO_MKISOFS_REGULAR_LILO);529 mr_asprintf(mondo_mkisofs_sz, "%s -V _CD#_", MONDO_MKISOFS_REGULAR_LILO); 530 530 } 531 531 #endif 532 else { 533 mr_asprintf(mondo_mkisofs_sz, MONDO_MKISOFS_REGULAR_SYSLINUX); 532 else 533 { 534 mr_asprintf(mondo_mkisofs_sz, "%s -V _CD#_", MONDO_MKISOFS_REGULAR_SYSLINUX); 534 535 } 535 536 … … 950 951 } 951 952 952 tmp = find_home_of_exe("cmp"); 953 if (!tmp) { 954 mr_free(tmp); 955 tmp = find_home_of_exe("true"); 956 if (!tmp) { 957 retval += whine_if_not_found("cmp"); 958 } else { 959 log_to_screen("Your system lacks the 'cmp' binary. I'll create a dummy cmp for you."); 960 if (run_program_and_log_output("cp -f `which true` /usr/bin/cmp", 0)) { 961 mr_free(tmp); 962 fatal_error("Failed to create dummy 'cmp' file."); 963 } 964 } 965 } 966 mr_free(tmp); 953 if (!find_home_of_exe("cmp")) { 954 whine_if_not_found("cmp"); 955 } 967 956 968 957 run_program_and_log_output("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5); -
branches/2.2.10/mondo/src/include/my-stuff.h
r2508 r2635 174 174 175 175 176 /** 177 * @c mkisofs command to generate a nonbootable CD, except for -o option and the directory to image. 178 */ 179 #define MONDO_MKISOFS_NONBOOT "mkisofs -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_" 176 #define MONDO_MKISOFS "mkisofs -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version " 180 177 181 178 /** 182 179 * @c mkisofs command to generate a bootable CD using isolinux, except for -o option and the directory to image. 183 180 */ 184 #define MONDO_MKISOFS_REGULAR_SYSLINUX "mkisofs -J -boot-info-table -no-emul-boot -b isolinux.bin -c boot.cat -boot-load-size 4 -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_"181 #define MONDO_MKISOFS_REGULAR_SYSLINUX MONDO_MKISOFS"-J -boot-info-table -no-emul-boot -b isolinux.bin -c boot.cat -boot-load-size 4 " 185 182 186 183 /** 187 184 * @c mkisofs command to generate a bootable CD using LILO, except for -o option and the directory to image. 188 185 */ 189 #define MONDO_MKISOFS_REGULAR_LILO "mkisofs -boot-info-table -no-emul-boot -b isolinux.bin -c boot.cat -boot-load-size 4 -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_"186 #define MONDO_MKISOFS_REGULAR_LILO MONDO_MKISOFS_REGULAR_SYSLINUX 190 187 191 188 /** 192 189 * @c mkisofs command to generate a bootable CD using ELILO, except for -o option and the directory to image. 193 190 */ 194 // Should replace 8192 by IA64_BOOT_SIZE 195 #define MONDO_MKISOFS_REGULAR_ELILO "mkisofs -no-emul-boot -b images/mindi-bootroot.8192.img -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_" 191 #define MONDO_MKISOFS_REGULAR_ELILO MONDO_MKISOFS"-J -no-emul-boot -b images/mindi-bootroot."IA64_BOOT_SIZE".img -c boot.cat " 196 192 197 193 /** -
branches/2.2.10/mondo/src/restore-scripts/mondo/grub-MR
r2508 r2635 69 69 70 70 echo -en "\ 71 device (hd$driveno) $mbr part\n\71 device (hd$driveno) $mbrdev\n\ 72 72 $extraline\n\ 73 73 root (hd$driveno,$partno)\n\ … … 77 77 log_file=/tmp/grub.output 78 78 if [ "$MNT_RESTORING" ] ; then 79 chroot /mnt/RESTORING grub --batch < /tmp/feed.txt > $log_file79 chroot $MNT_RESTORING grub --batch < /tmp/feed.txt > $log_file 80 80 else 81 81 grub --batch < /tmp/feed.txt > $log_file … … 104 104 105 105 echo "Now I'll use grub-install" >> $LOGFILE 106 chroot /mnt/RESTORING grub-install $1 >> $LOGFILE 107 res=$? 106 if [ "$MNT_RESTORING" ] ; then 107 chroot $MNT_RESTORING grub-install $1 2>&1 | tee -a $LOGFILE 108 res=$? 109 else 110 grub-install $1 2>&1 | tee -a $LOGFILE 111 res=$? 112 fi 108 113 echo "grub-install returned $res" >> $LOGFILE 109 114 [ "$res" -eq "0" ] && exit 0 110 115 116 # For some OpenSuSE 117 echo "Now I'll use grub-install.unsupported" >> $LOGFILE 118 if [ "$MNT_RESTORING" ] ; then 119 chroot $MNT_RESTORING grub-install.unsupported $1 2>&1 | tee -a $LOGFILE 120 res=$? 121 else 122 grub-install.unsupported $1 2>&1 | tee -a $LOGFILE 123 res=$? 124 fi 125 echo "grub-install.unsupported returned $res" >> $LOGFILE 126 [ "$res" -eq "0" ] && exit 0 127 111 128 echo "Trying a hack" >> $LOGFILE 112 FindBootPart $1 $2 113 mbr part=$1129 FindBootPart $1 $2 2>&1 | tee -a $LOGFILE 130 mbrdev=`echo $1 | sed 's/\([^0-9]*\)[0-9]*$/\1/'` 114 131 if echo $bootpart | grep "/cciss/" > /dev/null ; then 115 132 partno=`basename $bootpart | cut -d'p' -f2` 133 mbrdev=`echo $mbrdev | cut -d'p' -f1` 116 134 elif echo $bootpart | grep "/mapper/mpath" > /dev/null ; then 117 135 partno=`basename $bootpart | cut -d'p' -f3` 136 mbrdev=`echo $mbrdev | cut -d'p' -f1` 118 137 else 119 partno=`basename $bootpart | sed s/[a-z]*//`138 partno=`basename $bootpart | sed 's/[a-z]*//'` 120 139 fi 121 140 if [ ! "$partno" ] ; then … … 125 144 fi 126 145 if echo $bootpart | grep "/md" > /dev/null ; then 146 # FIXME: Why this if not used later 127 147 base=`basename $bootpart` 128 148 line=`grep $base /proc/mdstat | head -n1` 129 echo "mbr part was $mbrpart"130 mbr part=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' | cut -d' ' -f2`131 echo "mbr part is $mbrpart"149 echo "mbrdev was $mbrdev" 2>&1 | tee -a $LOGFILE 150 mbrdev=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' | cut -d' ' -f2` 151 echo "mbrdev is $mbrdev" 2>&1 | tee -a $LOGFILE 132 152 partno="0"; # cheating - FIXME 133 153 fi 134 echo ".............Cool." 154 echo ".............Cool." 2>&1 | tee -a $LOGFILE 135 155 136 156 grub=`FindPathOfRESTExe grub` … … 142 162 for driveno in 0 1 2 ; do 143 163 try_grub_hack $driveno $partno "" >> $LOGFILE 2>> $LOGFILE && break 144 try_grub_ Hack $driveno $partno "find $BOOTPATHNAME/stage1" >> $LOGFILE 2>> $LOGFILE && break164 try_grub_hack $driveno $partno "find $BOOTPATHNAME/stage1" >> $LOGFILE 2>> $LOGFILE && break 145 165 done 146 166 res=$? … … 152 172 echo "Now I'll use grub-install.patched" >> $LOGFILE 153 173 cp -f `which grub-install.patched` /mnt/RESTORING/sbin 154 chroot /mnt/RESTORING grub-install.patched $1 >>$LOGFILE174 chroot /mnt/RESTORING grub-install.patched $1 2>&1 | tee -a $LOGFILE 155 175 res=$? 156 176 echo "grub-install.patched returned $res" >> $LOGFILE … … 160 180 161 181 if [ -f "/mnt/RESTORING/boot/grub/menu.lst" ]; then 162 GRUBCFGFILE=/boot/grub/menu.lst182 grep -vE '^#' /boot/grub/menu.lst > /mnt/RESTORING/tmp/grub.conf 163 183 elif [ -f "/mnt/RESTORING/boot/grub/grub.cfg" ]; then 164 GRUBCFGFILE=/boot/grub/grub.cfg184 grep -vE '^#' /boot/grub/grub.cfg > /mnt/RESTORING/tmp/grub.conf 165 185 else 166 echo "Unable to find Grub conf file" 186 echo "Unable to find Grub conf file" | tee -a $LOGFILE 167 187 exit -1 168 188 fi 169 echo "Trying to use the existing $GRUBCFGFILE file in batch mode" >> $LOGFILE 170 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING$GRUBCFGFILE 189 echo "Trying to use the existing grub conf file in batch mode" >> $LOGFILE 190 cat /mnt/RESTORING/tmp/grub.conf >> $LOGFILE 191 chroot /mnt/RESTORING grub --batch < /mnt/RESTORING/tmp/grub.conf 171 192 res=$? 172 echo "$GRUBCFGFILE approach returned $res" >> $LOGFILE 193 echo "grub conf file approach returned $res" >> $LOGFILE 194 rm -f /mnt/RESTORING/tmp/grub.conf 173 195 [ "$res" -eq "0" ] && exit 0 174 196
Note:
See TracChangeset
for help on using the changeset viewer.