Changeset 1903 in MondoRescue for branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Apr 10, 2008, 1:13:58 AM (16 years ago)
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.