Changeset 2296 in MondoRescue for branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Jul 23, 2009, 2:53:30 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c
r2287 r2296 368 368 log_msg(3, "Mommm! SME is being a dildo!"); 369 369 } else { 370 mr_asprintf(&mountpoint, mpt);370 mr_asprintf(&mountpoint, "%s", mpt); 371 371 } 372 372 … … 408 408 mr_free(command); 409 409 410 mr_asprintf(&command, "mount -t %s %s %s %s 2>> %s", format, device, 411 additional_parameters, mountdir, MONDO_LOGFILE); 410 mr_asprintf(&command, "mount -t %s %s %s %s 2>> %s", format, device, additional_parameters, mountdir, MONDO_LOGFILE); 412 411 log_msg(2, "command='%s'", command); 413 412 } … … 418 417 log_msg(1, "Re-trying without the fancy extra parameters"); 419 418 mr_free(command); 420 mr_asprintf(&command, "mount -t %s %s %s 2>> %s", format, device, 421 mountdir, MONDO_LOGFILE); 419 mr_asprintf(&command, "mount -t %s %s %s 2>> %s", format, device, mountdir, MONDO_LOGFILE); 422 420 res = run_program_and_log_output(command, TRUE); 423 421 } … … 497 495 "Again with the /proc - why is this in your mountlist?"); 498 496 } else if (is_this_device_mounted(mountlist->el[lino].device)) { 499 mr_asprintf(&tmp, "%s is already mounted", 500 mountlist->el[lino].device); 497 mr_asprintf(&tmp, "%s is already mounted", mountlist->el[lino].device); 501 498 log_to_screen(tmp); 502 499 mr_free(tmp); … … 607 604 mr_asprintf(&mount_cmd, "mount_cd9660 -r %s " MNT_CDROM, mddev); 608 605 #else 609 mr_asprintf(&mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->nfs_remote_dir, 610 bkpinfo->prefix, g_current_media_number, MNT_CDROM); 606 mr_asprintf(&mount_cmd, "mount %s/%s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->nfs_remote_dir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 611 607 #endif 612 608 … … 619 615 mr_asprintf(&mount_cmd, "mount_cd9660 -r %s %s", mddev, MNT_CDROM); 620 616 #else 621 mr_asprintf(&mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", 622 bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 617 mr_asprintf(&mount_cmd, "mount %s/%s-%d.iso -t iso9660 -o loop,ro %s", bkpinfo->isodir, bkpinfo->prefix, g_current_media_number, MNT_CDROM); 623 618 #endif 624 619 } else if (bkpinfo->backup_media_type == usb) { … … 1101 1096 unlink(FILELIST_FULL_STUB); 1102 1097 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { 1103 mr_asprintf(&command, "tar -b %ld -zxf %s ./%s ./%s ./%s ./%s ./%s", 1104 bkpinfo->internal_tape_block_size, 1105 bkpinfo->media_device, 1106 MOUNTLIST_FNAME_STUB, 1107 BIGGIELIST_TXT_STUB, 1108 FILELIST_FULL_STUB, 1109 IWANTMYLVM_STUB, 1110 MONDO_CFG_FILE_STUB); 1098 mr_asprintf(&command, "tar -b %ld -zxf %s ./%s ./%s ./%s ./%s ./%s", bkpinfo->internal_tape_block_size, bkpinfo->media_device, MOUNTLIST_FNAME_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB, MONDO_CFG_FILE_STUB); 1111 1099 log_msg(1, "tarcommand = %s", command); 1112 1100 run_program_and_log_output(command, 1); … … 1116 1104 /* Doing that allow us to remain compatible with pre-2.2.5 versions */ 1117 1105 log_msg(2, "pre-2.2.4 compatible mode on"); 1118 mr_asprintf(&command, 1119 "tar -b %ld -zxf %s %s %s %s %s %s", 1120 bkpinfo->internal_tape_block_size, 1121 bkpinfo->media_device, 1122 MOUNTLIST_FNAME_STUB, 1123 BIGGIELIST_TXT_STUB, 1124 FILELIST_FULL_STUB, 1125 IWANTMYLVM_STUB, 1126 MONDO_CFG_FILE_STUB); 1106 mr_asprintf(&command, "tar -b %ld -zxf %s %s %s %s %s %s", bkpinfo->internal_tape_block_size, bkpinfo->media_device, MOUNTLIST_FNAME_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB, MONDO_CFG_FILE_STUB); 1127 1107 log_msg(1, "tarcommand = %s", command); 1128 1108 run_program_and_log_output(command, 1); … … 1136 1116 log_msg(2, "Back from iotcn"); 1137 1117 run_program_and_log_output("mount", 1); 1138 mr_asprintf(&command, 1139 "tar -zxf %s/images/all.tar.gz ./%s ./%s ./%s ./%s ./%s", 1140 MNT_CDROM, 1141 MOUNTLIST_FNAME_STUB, 1142 BIGGIELIST_TXT_STUB, 1143 FILELIST_FULL_STUB, 1144 IWANTMYLVM_STUB, 1145 MONDO_CFG_FILE_STUB); 1118 mr_asprintf(&command, "tar -zxf %s/images/all.tar.gz ./%s ./%s ./%s ./%s ./%s", MNT_CDROM, MOUNTLIST_FNAME_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB, MONDO_CFG_FILE_STUB); 1146 1119 1147 1120 log_msg(1, "tarcommand = %s", command); … … 1152 1125 /* Doing that allow us to remain compatible with pre-2.2.5 versions */ 1153 1126 log_msg(2, "pre-2.2.4 compatible mode on"); 1154 mr_asprintf(&command, 1155 "tar -zxf %s/images/all.tar.gz %s %s %s %s %s", 1156 MNT_CDROM, 1157 MOUNTLIST_FNAME_STUB, 1158 BIGGIELIST_TXT_STUB, 1159 FILELIST_FULL_STUB, 1160 IWANTMYLVM_STUB, 1161 MONDO_CFG_FILE_STUB); 1127 mr_asprintf(&command, "tar -zxf %s/images/all.tar.gz %s %s %s %s %s", MNT_CDROM, MOUNTLIST_FNAME_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB, MONDO_CFG_FILE_STUB); 1162 1128 1163 1129 log_msg(1, "tarcommand = %s", command); … … 1195 1161 && 1196 1162 ask_me_yes_or_no("Do you want to retrieve the mountlist as well?")) { 1197 mr_asprintf(&command, "ln -sf %s/%s /tmp", MOUNTLIST_FNAME_STUB, 1198 bkpinfo->tmpdir); 1163 mr_asprintf(&command, "ln -sf %s/%s /tmp", MOUNTLIST_FNAME_STUB, bkpinfo->tmpdir); 1199 1164 paranoid_system(command); 1200 1165 mr_free(command); … … 1225 1190 mr_free(command); 1226 1191 } 1227 mr_asprintf(&command, "grep -E '^/dev/.*' %s > %s", 1228 g_biggielist_txt, g_filelist_imagedevs); 1192 mr_asprintf(&command, "grep -E '^/dev/.*' %s > %s", g_biggielist_txt, g_filelist_imagedevs); 1229 1193 paranoid_system(command); 1230 1194 mr_free(command); … … 2044 2008 "Well, I know a certain kitty-kitty who'll be sleeping with Mommy tonight..."); 2045 2009 } else { 2046 mr_asprintf(&command, "umount " MNT_RESTORING "%s", 2047 mountlist->el[lino].mountpoint); 2010 mr_asprintf(&command, "umount " MNT_RESTORING "%s", mountlist->el[lino].mountpoint); 2048 2011 2049 2012 /* To support latest Ubuntu where /var is a separate FS … … 2112 2075 } 2113 2076 2114 mr_asprintf(&command, 2115 "dd if=%s bs=%ld count=%ld 2> /dev/null | tar -zx ./%s ./%s ./%s ./%s ./%s", 2116 dev, 2117 bkpinfo->internal_tape_block_size, 2118 1024L * 1024 * 32 / bkpinfo->internal_tape_block_size, 2119 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2120 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB); 2077 mr_asprintf(&command, "dd if=%s bs=%ld count=%ld 2> /dev/null | tar -zx ./%s ./%s ./%s ./%s ./%s", dev, bkpinfo->internal_tape_block_size, 1024L * 1024 * 32 / bkpinfo->internal_tape_block_size, MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB); 2121 2078 log_msg(2, "command = '%s'", command); 2122 2079 res = run_program_and_log_output(command, -1); … … 2129 2086 /* Doing that allow us to remain compatible with pre-2.2.5 versions */ 2130 2087 log_msg(2, "pre-2.2.4 compatible mode on"); 2131 mr_asprintf(&command, 2132 "dd if=%s bs=%ld count=%ld 2> /dev/null | tar -zx %s %s %s %s %s", 2133 dev, 2134 bkpinfo->internal_tape_block_size, 2135 1024L * 1024 * 32 / bkpinfo->internal_tape_block_size, 2136 MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, 2137 BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB); 2088 mr_asprintf(&command, "dd if=%s bs=%ld count=%ld 2> /dev/null | tar -zx %s %s %s %s %s", dev, bkpinfo->internal_tape_block_size, 1024L * 1024 * 32 / bkpinfo->internal_tape_block_size, MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, IWANTMYLVM_STUB); 2138 2089 log_msg(2, "command = '%s'", command); 2139 2090 res = run_program_and_log_output(command, -1); … … 2226 2177 log_msg(2, "media_device is blank; assuming %s"); 2227 2178 } 2228 mr_asprintf(&tmp, bkpinfo->media_device);2179 mr_asprintf(&tmp, "%s", bkpinfo->media_device); 2229 2180 if (extract_cfg_file_and_mountlist_from_tape_dev 2230 2181 (bkpinfo->media_device)) { … … 2335 2286 /* Is this code really useful ??? */ 2336 2287 if (extract_mountlist_stub) { 2337 mr_asprintf(&command, "cp -f %s %s/%s", MOUNTLIST_FNAME_STUB, 2338 bkpinfo->tmpdir, MOUNTLIST_FNAME_STUB); 2288 mr_asprintf(&command, "cp -f %s %s/%s", MOUNTLIST_FNAME_STUB, bkpinfo->tmpdir, MOUNTLIST_FNAME_STUB); 2339 2289 run_program_and_log_output(command, FALSE); 2340 2290 mr_free(command);
Note:
See TracChangeset
for help on using the changeset viewer.