Changeset 1903 in MondoRescue for branches/stable/mondo/src/mondorestore
- Timestamp:
- Apr 10, 2008, 1:13:58 AM (16 years ago)
- Location:
- branches/stable/mondo/src/mondorestore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1842 r1903 56 56 char *g_getfacl = NULL; 57 57 58 extern void kill_anything_like_this(char *str); 59 58 60 /** 59 61 * @addtogroup restoreUtilityGroup … … 387 389 388 390 char *command = NULL; 391 char *tmp = NULL; 389 392 char *mountdir = NULL; 390 393 char *mountpoint = NULL; … … 439 442 mr_msg(2, "command='%s'", command); 440 443 } 444 441 445 res = run_program_and_log_output(command, TRUE); 446 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 447 mr_msg(1, "Re-trying without the fancy extra parameters"); 448 mr_asprintf(&tmp, "mount -t %s %s %s 2>> %s", format, device, 449 mountdir, MONDO_LOGFILE); 450 res = run_program_and_log_output(tmp, TRUE); 451 mr_free(tmp); 452 } 442 453 if (res) { 443 454 mr_msg(1, "Unable to mount device %s (type %s) at %s", device, … … 449 460 } else { 450 461 mr_msg(2, "Retrying w/o the '-t' switch"); 451 mr_free(command); 452 453 mr_asprintf(&command, "mount %s %s 2>> %s", device, mountdir, 462 mr_asprintf(&tmp, "mount %s %s 2>> %s", device, mountdir, 454 463 MONDO_LOGFILE); 455 mr_msg(2, "2nd command = '%s'", command); 456 res = run_program_and_log_output(command, TRUE); 464 mr_msg(2, "2nd command = '%s'", tmp); 465 res = run_program_and_log_output(tmp, TRUE); 466 mr_free(tmp); 457 467 if (res == 0) { 458 468 mr_msg(1, … … 473 483 } 474 484 mr_free(mountpoint); 475 476 485 return (res); 477 486 } … … 623 632 mr_msg(1, "isodir is being set to %s", bkpinfo->isodir); 624 633 } 634 625 635 #ifdef __FreeBSD__ 626 636 mr_asprintf(&mount_cmd, "/mnt/isodir/%s/%s/%s-%d.iso", bkpinfo->isodir, … … 687 697 break; 688 698 } else { 689 mr_msg(2, "Failed to mount CD-ROM drive.");699 mr_msg(2, "Failed to mount device."); 690 700 sleep(5); 691 701 run_program_and_log_output("sync", FALSE); … … 806 816 } else if (!strcmp(value, "nfs")) { 807 817 bkpinfo->backup_media_type = nfs; 818 bkpinfo->please_dont_eject = TRUE; 808 819 if (read_cfg_var(cfg_file, "iso-prefix", value) == 0) { 809 820 mr_allocstr(bkpinfo->prefix,value); … … 842 853 fatal_error("backup-media-type not specified!"); 843 854 } 855 844 856 if (bkpinfo->disaster_recovery) { 845 857 if (bkpinfo->backup_media_type == cdstream) { … … 1286 1298 #endif 1287 1299 char *name = NULL; 1300 char *cmd = NULL; 1288 1301 1289 1302 malloc_string(device); 1290 1303 malloc_string(name); 1304 1305 /* In order to have a working bootloader, we need to have all devices 1306 * ready in the chroot. If they are not there (udev) then copy them from 1307 * the current /dev location 1308 */ 1309 asprintf(&cmd,"tar cf - /dev | ( cd %s ; tar xf - )",MNT_RESTORING); 1310 run_program_and_log_output(cmd, 3); 1311 paranoid_free(cmd); 1312 1291 1313 backup_crucial_file(MNT_RESTORING, "/etc/fstab"); 1292 1314 backup_crucial_file(MNT_RESTORING, "/etc/grub.conf"); 1293 1315 backup_crucial_file(MNT_RESTORING, "/etc/lilo.conf"); 1294 1316 backup_crucial_file(MNT_RESTORING, "/etc/elilo.conf"); 1317 backup_crucial_file(MNT_RESTORING, "/boot/grub/device.map"); 1318 backup_crucial_file(MNT_RESTORING, "/etc/mtab"); 1295 1319 read_cfg_var(g_mondo_cfg_file, "bootloader.device", device); 1296 1320 read_cfg_var(g_mondo_cfg_file, "bootloader.name", name); … … 1312 1336 mr_free(tmp); 1313 1337 } else { 1314 mr_asprintf(&tmp, "ls /dev | grep -Eq '^%ss[1-4].* $'", device);1338 mr_asprintf(&tmp, "ls /dev | grep -Eq '^%ss[1-4].*'", device); 1315 1339 if (!system(tmp)) { 1316 1340 mr_free(tmp); … … 1534 1558 newtSuspend(); 1535 1559 } 1536 mr_asprintf(&tmp, " %s " MNT_RESTORING "/etc/fstab", editor);1560 mr_asprintf(&tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor); 1537 1561 paranoid_system(tmp); 1538 1562 mr_free(tmp); 1539 1563 1540 mr_asprintf(&tmp, " %s " MNT_RESTORING "/etc/elilo.conf", editor);1564 mr_asprintf(&tmp, "chroot %s %s /etc/elilo.conf", MNT_RESTORING, editor); 1541 1565 paranoid_system(tmp); 1542 1566 mr_free(tmp); … … 2173 2197 if (!does_file_exist("tmp/mondo-restore.cfg")) { 2174 2198 log_to_screen(_ 2175 ("Cannot find config info on tape/CD"));2199 ("Cannot find config info on media")); 2176 2200 return (1); 2177 2201 } -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1770 r1903 437 437 read_cfg_file_into_bkpinfo(g_mondo_cfg_file); 438 438 iamhere("Done loading config file; resizing ML"); 439 if (bkpinfo->backup_media_type != usb) {439 if (bkpinfo->backup_media_type == nfs) { 440 440 mr_asprintf(&tmp,bkpinfo->prefix); 441 441 if (popup_and_get_string … … 1994 1994 _("Please wait. This may take some time."), 1995 1995 "", total_slices); 1996 for (bigfileno = 0 , finished = FALSE; !finished;) {1996 for (bigfileno = 0 ; bigfileno < noof_biggiefiles ;) { 1997 1997 mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1); 1998 1998 if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) { … … 2004 2004 g_current_media_number); 2005 2005 mr_msg(3, "Slicename would have been %s", 2006 slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, ""));2006 slice_fname(bigfileno, 0, ARCHIVES_PATH, "")); 2007 2007 // I'm not positive 'just_changed_cds' is even necessary... 2008 2008 if (just_changed_cds) { … … 2017 2017 just_changed_cds = TRUE; 2018 2018 } else { 2019 /* That big file doesn't exist, but the followings may */ 2020 /* So we need to continue looping */ 2019 2021 mr_msg(2, "There was no bigfile #%ld. That's OK.", 2020 2022 bigfileno + 1); 2021 2023 mr_msg(2, "I'm going to stop restoring bigfiles now."); 2022 finished = TRUE; 2024 retval++; 2025 bigfileno++; 2023 2026 } 2024 2027 } else { … … 3012 3015 } 3013 3016 3017 if (argc == 3 && strcmp(argv[1], "-K") == 0) { 3018 g_loglevel = atoi(argv[2]); 3019 log_msg(1,"Loglevel forced to %s",g_loglevel); 3020 } 3014 3021 3015 3022 if (argc == 2 && strcmp(argv[1], "--live-grub") == 0) { … … 3169 3176 mvaddstr_and_log_it(g_currentY++, 3170 3177 0, 3171 _("Run complete. Please remove CD/media and reboot."));3178 _("Run complete. Please remove media and reboot.")); 3172 3179 } else { 3173 3180 run_program_and_log_output("sync", FALSE); … … 3226 3233 unlink("/tmp/mondo-run-prog.tmp"); 3227 3234 set_signals(FALSE); 3228 mr_asprintf(&tmp, "rm -Rf %s", bkpinfo->tmpdir);3229 run_program_and_log_output(tmp, FALSE);3230 mr_free(tmp);3231 3235 3232 3236 log_to_screen … … 3243 3247 run_program_and_log_output("mount / -o remount,rw", 2); 3244 3248 } // for b0rken distros 3249 mr_asprintf(&tmp, "rm -Rf %s", bkpinfo->tmpdir); 3250 run_program_and_log_output(tmp, FALSE); 3251 mr_free(tmp); 3252 3245 3253 paranoid_MR_finish(retval); // frees global stuff plus bkpinfo 3246 3254 free_libmondo_global_strings(); // it's fine to have this here :) really :)
Note:
See TracChangeset
for help on using the changeset viewer.