Ignore:
Timestamp:
Jun 25, 2013, 10:53:14 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • Apply fixes to 3.1 tree so that at least mondo compiles again (but that branch probably doesn't work at all again).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/mondo/src/mondorestore/mondo-rstr-tools.c

    r3148 r3161  
    8080char *incoming = NULL;
    8181char *question = NULL;
    82 char *q;
    83 char *q;
    8482
    8583assert_string_is_neither_NULL_nor_zerolength(infname);
     
    182180    char *mds = NULL;
    183181    int retval = 0, i;
    184     bool already_mounted = FALSE;
    185182    char *isodir_format = NULL;
    186183
     
    553550    mr_free(command);
    554551
    555     chdir(bkpinfo->tmpdir);
     552    if (chdir(bkpinfo->tmpdir)) {
     553        //FIXME
     554    }
    556555
    557556    mr_free(mountpt);
     
    576575        if (try_plan_B) {
    577576            log_msg(2, "gcffa --- OK, switching to Plan B");
    578             chdir(bkpinfo->tmpdir);
     577            if (chdir(bkpinfo->tmpdir)) {
     578                // FIXME
     579            }
    579580            run_program_and_log_output("mkdir -p tmp", FALSE);
    580581
     
    10821083char *command = NULL;
    10831084char *tmp;
    1084 char *tmp1 = NULL;
    10851085char *q;
    10861086int res = 0;
     
    14021402    bool mntlistchg = FALSE;
    14031403    FILE *fin = NULL;
    1404     bool mntlistchg = FALSE;
    1405     FILE *fin = NULL;
    14061404
    14071405    assert_string_is_neither_NULL_nor_zerolength(bd);
     
    14361434            }
    14371435
    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");
    14811438            } 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");
    14821484                done = TRUE;
    14831485            }
     
    18791881    FILE *fout;
    18801882    char *incoming = NULL;
    1881     char *q;
    1882     char *q;
    18831883
    18841884    assert_string_is_neither_NULL_nor_zerolength(output_file);
Note: See TracChangeset for help on using the changeset viewer.