Changeset 3161 in MondoRescue for branches/3.1/mondo/src/mondorestore/mondo-rstr-tools.c
- Timestamp:
- Jun 25, 2013, 10:53:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/mondo/src/mondorestore/mondo-rstr-tools.c
r3148 r3161 80 80 char *incoming = NULL; 81 81 char *question = NULL; 82 char *q;83 char *q;84 82 85 83 assert_string_is_neither_NULL_nor_zerolength(infname); … … 182 180 char *mds = NULL; 183 181 int retval = 0, i; 184 bool already_mounted = FALSE;185 182 char *isodir_format = NULL; 186 183 … … 553 550 mr_free(command); 554 551 555 chdir(bkpinfo->tmpdir); 552 if (chdir(bkpinfo->tmpdir)) { 553 //FIXME 554 } 556 555 557 556 mr_free(mountpt); … … 576 575 if (try_plan_B) { 577 576 log_msg(2, "gcffa --- OK, switching to Plan B"); 578 chdir(bkpinfo->tmpdir); 577 if (chdir(bkpinfo->tmpdir)) { 578 // FIXME 579 } 579 580 run_program_and_log_output("mkdir -p tmp", FALSE); 580 581 … … 1082 1083 char *command = NULL; 1083 1084 char *tmp; 1084 char *tmp1 = NULL;1085 1085 char *q; 1086 1086 int res = 0; … … 1402 1402 bool mntlistchg = FALSE; 1403 1403 FILE *fin = NULL; 1404 bool mntlistchg = FALSE;1405 FILE *fin = NULL;1406 1404 1407 1405 assert_string_is_neither_NULL_nor_zerolength(bd); … … 1436 1434 } 1437 1435 1438 if ((res) || (mntlistchg)){ 1439 popup_and_OK 1440 ("GRUB installation failed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install"); 1441 } else { 1442 popup_and_OK("The mountlist was changed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install"); 1443 } 1444 if (!g_text_mode) { 1445 newtSuspend(); 1446 } 1447 sprintf(tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor); 1448 paranoid_system(tmp); 1449 sprintf(tmp, "chroot %s %s /etc/mtab", MNT_RESTORING, editor); 1450 paranoid_system(tmp); 1451 if (does_file_exist(MNT_RESTORING"/boot/grub/menu.lst")) { 1452 sprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor); 1453 } else if (does_file_exist(MNT_RESTORING"/boot/grub/grub.cfg")) { 1454 sprintf(tmp, "chroot %s %s /boot/grub/grub.cfg", MNT_RESTORING, editor); 1455 } else if (does_file_exist(MNT_RESTORING"/boot/grub2/grub.cfg")) { 1456 sprintf(tmp, "chroot %s %s /boot/grub2/grub.cfg", MNT_RESTORING, editor); 1457 } 1458 paranoid_system(tmp); 1459 if (does_file_exist(MNT_RESTORING"/boot/grub/device.map")) { 1460 sprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor); 1461 } else if (does_file_exist(MNT_RESTORING"/boot/grub2/device.map")) { 1462 sprintf(tmp, "chroot %s %s /boot/grub2/device.map", MNT_RESTORING, editor); 1463 } 1464 paranoid_system(tmp); 1465 if (!g_text_mode) { 1466 newtResume(); 1467 } 1468 sprintf(command, "stabgrub-me %s", boot_device); 1469 res = run_program_and_log_output(command, 1); 1470 if (res) { 1471 popup_and_OK 1472 ("GRUB installation failed. Please fix the conf files so that a manual install using 'grub-install' or similar command works. You are now chroot()'ed to your restored system. Please type 'exit' when you are done."); 1473 newtSuspend(); 1474 paranoid_system("chroot " MNT_RESTORING); 1475 newtResume(); 1476 popup_and_OK("Thank you."); 1477 } else { 1478 popup_and_OK("GRUB is now installed correctly"); 1479 done = TRUE; 1480 } 1436 if ((res) || (mntlistchg)) { 1437 popup_and_OK("GRUB installation failed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install"); 1481 1438 } else { 1439 popup_and_OK("The mountlist was changed. You will now edit fstab, mtab, device.map and menu.lst/grub.cfg in order to fix grub install"); 1440 } 1441 if (!g_text_mode) { 1442 newtSuspend(); 1443 } 1444 mr_asprintf(tmp, "chroot %s %s /etc/fstab", MNT_RESTORING, editor); 1445 paranoid_system(tmp); 1446 mr_free(tmp); 1447 1448 mr_asprintf(tmp, "chroot %s %s /etc/mtab", MNT_RESTORING, editor); 1449 paranoid_system(tmp); 1450 mr_free(tmp); 1451 1452 if (does_file_exist(MNT_RESTORING"/boot/grub/menu.lst")) { 1453 mr_asprintf(tmp, "chroot %s %s /boot/grub/menu.lst", MNT_RESTORING, editor); 1454 } else if (does_file_exist(MNT_RESTORING"/boot/grub/grub.cfg")) { 1455 mr_asprintf(tmp, "chroot %s %s /boot/grub/grub.cfg", MNT_RESTORING, editor); 1456 } else if (does_file_exist(MNT_RESTORING"/boot/grub2/grub.cfg")) { 1457 mr_asprintf(tmp, "chroot %s %s /boot/grub2/grub.cfg", MNT_RESTORING, editor); 1458 } 1459 paranoid_system(tmp); 1460 mr_free(tmp); 1461 1462 if (does_file_exist(MNT_RESTORING"/boot/grub/device.map")) { 1463 mr_asprintf(tmp, "chroot %s %s /boot/grub/device.map", MNT_RESTORING, editor); 1464 } else if (does_file_exist(MNT_RESTORING"/boot/grub2/device.map")) { 1465 mr_asprintf(tmp, "chroot %s %s /boot/grub2/device.map", MNT_RESTORING, editor); 1466 } 1467 paranoid_system(tmp); 1468 mr_free(tmp); 1469 1470 if (!g_text_mode) { 1471 newtResume(); 1472 } 1473 mr_asprintf(command, "stabgrub-me %s", boot_device); 1474 res = run_program_and_log_output(command, 1); 1475 mr_free(command); 1476 if (res) { 1477 popup_and_OK("GRUB installation failed. Please fix the conf files so that a manual install using 'grub-install' or similar command works. You are now chroot()'ed to your restored system. Please type 'exit' when you are done."); 1478 newtSuspend(); 1479 paranoid_system("chroot " MNT_RESTORING); 1480 newtResume(); 1481 popup_and_OK("Thank you."); 1482 } else { 1483 popup_and_OK("GRUB is now installed correctly"); 1482 1484 done = TRUE; 1483 1485 } … … 1879 1881 FILE *fout; 1880 1882 char *incoming = NULL; 1881 char *q;1882 char *q;1883 1883 1884 1884 assert_string_is_neither_NULL_nor_zerolength(output_file);
Note:
See TracChangeset
for help on using the changeset viewer.