Changeset 3297 for branches/3.2


Ignore:
Timestamp:
Jun 7, 2014, 10:39:10 AM (5 years ago)
Author:
bruno
Message:
  • stabgrub-me now supports also grub2
  • Fix an error using mountlist.txt under /var/cache/mindi instead of /tmp - for now - with grub-MR
Location:
branches/3.2/mondo/src
Files:
2 edited

Legend:

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

    r3292 r3297  
    13841384    strcpy(boot_device, bd);
    13851385
    1386     if (offer_to_run_stabgrub
    1387         && ask_me_yes_or_no("Did you change the mountlist or cloned the system ?")) {
     1386    if (offer_to_run_stabgrub && ask_me_yes_or_no("Did you change the mountlist or cloned the system ?")) {
    13881387        /* interactive mode */
    1389         mvaddstr_and_log_it(g_currentY,
    1390                             0,
    1391                             "Modifying fstab, mtab, device.map and menu.lst/grub.cfg, and running GRUB...                             ");
     1388        mvaddstr_and_log_it(g_currentY, 0, "Modifying fstab, mtab, device.map and menu.lst/grub.cfg, and running GRUB...");
    13921389        /*  Did we changed the mountlist ? If yes, then force editing conf files */
    13931390        if ((fin = fopen(MONDO_MNTLISTCHG, "r")) != NULL) {
     
    13951392        }
    13961393        for (done = FALSE; !done;) {
    1397             popup_and_get_string("Boot device", "Please confirm/enter the boot device. If in doubt, try /dev/hda", boot_device, MAX_STR_LEN / 4);
     1394            popup_and_get_string("Boot device", "Please confirm/enter the boot device. If in doubt, try /dev/sda", boot_device, MAX_STR_LEN / 4);
    13981395            /*  Only try to adapt grub here first if the mountlist wasn't changed before */
    13991396            if (! mntlistchg) {
     
    14651462        if (!run_program_and_log_output("which grub-MR", FALSE)) {
    14661463            log_msg(1, "Yay! grub-MR found...");
    1467             mr_asprintf(command, "grub-MR %s "MINDI_CACHE"/mountlist.txt", boot_device);
     1464            mr_asprintf(command, "grub-MR %s /"MOUNTLIST_FNAME_STUB, boot_device);
    14681465            log_msg(1, "command = %s", command);
    14691466        } else {
     1467            // Or grub2-install
    14701468            mr_asprintf(command, "chroot " MNT_RESTORING " grub-install %s", boot_device);
    14711469            log_msg(1, "WARNING - grub-MR not found; using grub-install");
     
    17491747    } else {
    17501748        /* nuke mode */
    1751         mr_asprintf(command, "raw-MR %s "MINDI_CACHE"/mountlist.txt", boot_device);
     1749        mr_asprintf(command, "raw-MR %s /"MOUNTLIST_FNAME_STUB, boot_device);
    17521750        log_msg(2, "run_raw_mbr() --- command='%s'", command);
    17531751
     
    18091807    } else {
    18101808        sprintf(g_mondo_cfg_file, "%s/%s", temppath, MONDO_CFG_FILE_STUB);
    1811         sprintf(g_mountlist_fname, "%s/%s", temppath,
    1812                 MOUNTLIST_FNAME_STUB);
     1809        sprintf(g_mountlist_fname, "%s/%s", temppath, MOUNTLIST_FNAME_STUB);
    18131810    }
    18141811}
  • branches/3.2/mondo/src/restore-scripts/mondo/stabgrub-me

    r2944 r3297  
    184184    grub_res=$?
    185185    if [ "$grub_res" -ne "0" ] ; then
    186         LogIt "grub-install failed. Running grub-MR..."
     186        LogIt "grub-MR failed. Running grub-install..."
    187187        chroot /mnt/RESTORING grub-install '(hd0)' >> $LOGFILE 2>> $LOGFILE
    188188        grub_res=$?
     189    else
     190        LogIt "grub-MR ran ok." 2
    189191    fi
    190192    if [ "$grub_res" -ne "0" ] ; then
    191     LogIt "GRUB failed." 3
     193        LogIt "grub failed. Running grub2-install..." 3
     194        chroot /mnt/RESTORING grub2-install /dev/sda >> $LOGFILE 2>> $LOGFILE
     195        grub_res=$?
    192196    else
    193197        LogIt "GRUB ran ok." 2
    194198    fi
     199    if [ "$grub_res" -ne "0" ] ; then
     200        LogIt "grub2 failed..." 3
     201    else
     202        LogIt "GRUB2 ran ok." 2
     203    fi
    195204fi
    196205
Note: See TracChangeset for help on using the changeset viewer.