Ignore:
Timestamp:
Apr 29, 2011, 3:42:55 PM (13 years ago)
Author:
Bruno Cornec
Message:

svn merge (in svk) -r 2714:2773 2.2.9 in 2.2.10

r4207@localhost (orig r2716): bruno | 2011-02-03 01:29:51 +0100

  • Increase boot size again to support better fedora 13/14


r4208@localhost (orig r2717): bruno | 2011-02-12 15:43:36 +0100

  • Excluding vmhgfs FS for VMWare guests mounting areas of the host.


r4209@localhost (orig r2718): bruno | 2011-02-18 00:30:35 +0100
-Extend EXTRA-SIZE for Debian 6.0 (at least)


r4210@localhost (orig r2719): bruno | 2011-02-18 00:45:40 +0100

  • Fix #462 (removes temp dir if analyze-my-lvm launched in stand alonae mode)


r4213@localhost (orig r2722): bruno | 2011-02-25 18:44:47 +0100

  • Fixes for RHEL6 support at least around dm extensions, bnx2x and cp210x dependencies


r4214@localhost (orig r2723): bruno | 2011-02-25 19:00:17 +0100

  • Adds a restore quiet option


r4215@localhost (orig r2724): bruno | 2011-02-25 19:43:50 +0100

  • Adds support for dm-log used on RHEL6 as well.


r4216@localhost (orig r2725): bruno | 2011-02-25 21:26:54 +0100

  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3


r4217@localhost (orig r2726): bruno | 2011-02-26 11:38:29 +0100

  • Fix error introduced in previous patch in the if/then/else case without member in the then


r4218@localhost (orig r2727): bruno | 2011-02-26 12:05:33 +0100

  • With mindi-busybox 1.18.3 the syntax of openvt changed. This patch keeps a compatible init script for both previous and current version.


r4219@localhost (orig r2728): bruno | 2011-02-26 15:27:40 +0100

  • Latest lvdisplay print MiB instead of MB. Impact on analyze-my-lvm fixed.


r4220@localhost (orig r2729): bruno | 2011-02-26 16:39:32 +0100

  • Adds feature rpc to mindi-busybox in case of need



r4221@localhost (orig r2730): bruno | 2011-02-26 16:42:43 +0100

  • Adds the rebot command to the list of mandatory ones at restore time


r4222@localhost (orig r2731): bruno | 2011-02-26 17:37:13 +0100

  • Adds functions and /bin/loadkeys (new location) to minimal set of commands to have
  • provides a makemessage option to mindi and this function now works with pbdistrocheck
  • Do not create an error when a phys device has 0 size and is a /dev/dm-* device


r4223@localhost (orig r2732): bruno | 2011-02-26 19:07:43 +0100

  • Syntax fix


r4224@localhost (orig r2733): bruno | 2011-02-26 19:51:16 +0100

  • Fix test on dm which was made in wrong sense
  • Adds a driver to allow raid456 to work


r4225@localhost (orig r2734): bruno | 2011-02-26 20:55:00 +0100

  • Fix 2 redirections issues


r4317@localhost (orig r2737): bruno | 2011-03-13 13:12:57 +0100

  • Add support for libahci driver, mandatory for debian 6.


r4318@localhost (orig r2738): bruno | 2011-03-13 14:46:37 +0100

  • Update from Lester Wade (lester.wade_at_hp.com) incorporating latest ML feedbacks


r4319@localhost (orig r2739): bruno | 2011-03-13 17:49:15 +0100

  • Updated Lab for TES 2011


r4323@localhost (orig r2743): bruno | 2011-03-20 01:37:40 +0100

  • Fix a seg fault bug when using the GUI in case exclude_paths was NULL (mc_at_carreira.com.pt)


r4324@localhost (orig r2744): bruno | 2011-03-20 19:38:14 +0100

  • Adds Arch Linux Keyboard support (mc_at_carreira.com.pt)


r4325@localhost (orig r2745): bruno | 2011-03-20 19:48:01 +0100

  • Avoids coredump again when exclude_path is NULL with mr_make_devlist_from_pathlist (feedback from mc_at_carreira.com.pt)


r4326@localhost (orig r2746): bruno | 2011-03-20 19:39:47 +0100

  • Remove blkid from busybox to solve #435


r4327@localhost (orig r2747): bruno | 2011-03-20 19:43:22 +0100

  • Adds reboot to fix #435


r4328@localhost (orig r2748): bruno | 2011-03-22 00:58:07 +0100

  • Fix Arch Linux kbd printed in log file now instead of screen.


r4329@localhost (orig r2749): bruno | 2011-03-22 00:59:58 +0100

  • Again increase size for boot env to support better fedora 14 and other latest distros


r4356@localhost (orig r2750): bruno | 2011-03-25 19:30:01 +0100

  • Improve Arch Linux support for mindi tools (mc_at_carreira.com.pt)


r4357@localhost (orig r2751): bruno | 2011-03-25 19:48:33 +0100

  • Accept to work with either wodim or cdreord and genisoimage or mkisofs


r4358@localhost (orig r2752): bruno | 2011-03-25 20:20:49 +0100

  • Documents option -v of mondoarchive


r4359@localhost (orig r2753): bruno | 2011-03-29 01:34:30 +0200

  • Use modprobe instead of insmod to load loop, cd, ... modules (in order to force them at rstore time). Also drop very old aes support for mdk 9.2


r4360@localhost (orig r2754): bruno | 2011-03-29 01:38:49 +0200

  • Arch Linux support for boot message of mindi (mc_at_carreira.com.pt) using /etc/arch-release and pacman.log


r4383@localhost (orig r2755): bruno | 2011-04-07 09:49:38 +0200

  • Adds a UdevadmTrigger function at restore time to deal with the various syntax formats changes ddepending on version (mc_at_carreira.com.pt)


r4384@localhost (orig r2756): bruno | 2011-04-07 10:05:24 +0200

  • Increase again sizes for Debian 6 support (victor.gattegno_at_hp.com)


r4385@localhost (orig r2757): bruno | 2011-04-07 10:13:00 +0200
Conform to the report of size really !


r4386@localhost (orig r2758): bruno | 2011-04-07 11:31:12 +0200

  • Improved message for Arch Linux for rebuilding the initrd (mc_at_carreira.com.pt)


r4390@localhost (orig r2759): bruno | 2011-04-12 01:15:00 +0200

  • Typo in Web site


r4392@localhost (orig r2761): bruno | 2011-04-14 00:23:38 +0200

  • Adds download references for latest versions.


r4394@localhost (orig r2763): bruno | 2011-04-16 00:35:08 +0200

  • Adds support for MT back mandatory for OBDR.


r4395@localhost (orig r2764): bruno | 2011-04-20 12:18:46 +0200
Function resize_drive_proportionately_to_suit_new_drives

  • Integrate some mr_asprintf
  • Use systematically long long data types in all computation to match the struct mountlist_reference size member and have correct precision
  • Apply JB general_at_itpsg.com patch to make the partition resizing work properly according to the drive size (keeping all calculation in KB and converting only for display)


r4396@localhost (orig r2765): bruno | 2011-04-21 11:20:58 +0200

  • Remove very old code creating confusing symlinks pico to nano in init (patch from MC). Fix #477


r4397@localhost (orig r2766): bruno | 2011-04-21 11:57:44 +0200

  • text's are properly centered in open_and_list_dir (Patch from Chucky). Fix #404.


r4398@localhost (orig r2767): bruno | 2011-04-21 12:49:40 +0200

  • Attempt to fix #432 with a better message at a start.


r4399@localhost (orig r2768): bruno | 2011-04-21 13:00:37 +0200

Log content of mondo-restore.cfg


r4400@localhost (orig r2769): bruno | 2011-04-21 13:48:52 +0200

  • Introduce a new bkpinfo member (subdir) to support storing the subdir under which ISO images are stored on an external HDD. Should fix mostly #433.


r4401@localhost (orig r2770): bruno | 2011-04-21 14:14:52 +0200

  • Fix compilation issues due to level of visibility of functions


r4402@localhost (orig r2771): bruno | 2011-04-22 01:49:03 +0200

  • Adds GUI support for compresion type. Fix half of #468.


r4403@localhost (orig r2772): bruno | 2011-04-22 02:00:07 +0200

  • Adds support of ext attr through the GUI. Fix second part of #468


r4404@localhost (orig r2773): bruno | 2011-04-22 02:22:24 +0200

  • Propose more variables in the mindi.conf example
  • More explicit messages when size unsufficient in mindi for kernel + initrd as per #471
  • Better loging of labeling in mondo when in nuke mode


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/mondorestore/mondo-prep.c

    r2704 r2816  
    466466        {
    467467            if (!does_file_exist("/etc/raidtab")) {
    468                 log_to_screen
    469                     ("Cannot find /etc/raidtab - cannot extrapolate the fdisk entries");
     468                log_to_screen("Cannot find /etc/raidtab - cannot extrapolate the fdisk entries");
    470469                finish(1);
    471470            }
     
    690689        if (!vinum_started_yet) {
    691690            if (!does_file_exist("/tmp/raidconf.txt")) {
    692                 log_to_screen
    693                     ("/tmp/raidconf.txt does not exist. I therefore cannot start Vinum.");
     691                log_to_screen("/tmp/raidconf.txt does not exist. I therefore cannot start Vinum.");
    694692            } else {
    695693                int res;
     
    698696                    ("vinum create /tmp/raidconf.txt", TRUE);
    699697                if (res) {
    700                     log_to_screen
    701                         ("`vinum create /tmp/raidconf.txt' returned errors. Please fix them and re-run mondorestore.");
     698                    log_to_screen("`vinum create /tmp/raidconf.txt' returned errors. Please fix them and re-run mondorestore.");
    702699                    finish(1);
    703700                }
     
    757754        }
    758755#else
    759         log_to_screen(tmp, "Initializing RAID device %s", device);
    760         log_to_screen(tmp);
    761         mr_free(tmp);
     756        log_to_screen("Initializing RAID device %s", device);
    762757
    763758// Shouldn't be necessary.
     
    808803    mr_asprintf(tmp, "Formatting %s as %s", device, format);
    809804    update_progress_form(tmp);
    810     mr_free(tmp);
    811805
    812806    res = run_program_and_log_output(program, FALSE);
     
    1005999    if (retval) {
    10061000        mvaddstr_and_log_it(g_currentY++, 74, "Failed.");
    1007         log_to_screen
    1008             ("Errors occurred during the formatting of your hard drives.");
     1001        log_to_screen("Errors occurred during the formatting of your hard drives.");
    10091002    } else {
    10101003        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    10161009        if (retval > 0 && !interactively) {
    10171010//123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
    1018             log_to_screen
    1019                 ("Partition table locked up %d times. At least one 'mkfs' (format) command",
    1020                  g_partition_table_locked_up);
    1021             log_to_screen
    1022                 ("failed. I think these two events are related. Sometimes, fdisk's ioctl() call");
    1023             log_to_screen
    1024                 ("to refresh its copy of the partition table causes the kernel to lock the ");
    1025             log_to_screen
    1026                 ("partition table. I believe this has just happened.");
    1027             if (ask_me_yes_or_no
    1028                 ("Please choose 'yes' to reboot and try again; or 'no' to ignore this warning and continue."))
    1029             {
     1011            log_to_screen("Partition table locked up %d times. At least one 'mkfs' (format) command", g_partition_table_locked_up);
     1012            log_to_screen("failed. I think these two events are related. Sometimes, fdisk's ioctl() call");
     1013            log_to_screen("to refresh its copy of the partition table causes the kernel to lock the ");
     1014            log_to_screen("partition table. I believe this has just happened.");
     1015            if (ask_me_yes_or_no("Please choose 'yes' to reboot and try again; or 'no' to ignore this warning and continue.")) {
    10301016                sync();
    10311017                sync();
     
    10341020            }
    10351021        } else {
    1036             log_to_screen
    1037                 ("Partition table locked up %d time%c. However, disk formatting succeeded.",
    1038                  g_partition_table_locked_up,
    1039                  (g_partition_table_locked_up == 1) ? '.' : 's');
     1022            log_to_screen("Partition table locked up %d time%c. However, disk formatting succeeded.", g_partition_table_locked_up, (g_partition_table_locked_up == 1) ? '.' : 's');
    10401023        }
    10411024    }
     
    14621445                    mr_asprintf(command, "disklabel -B %s", basename(drivename));
    14631446                    if (system(command)) {
    1464                         log_to_screen
    1465                             ("Warning! Unable to make the drive bootable.");
     1447                        log_to_screen("Warning! Unable to make the drive bootable.");
    14661448                    }
    14671449                    mr_free(command);
     
    15501532#ifndef __IA64__
    15511533        if (current_devno == 5 && previous_devno == 4) {
    1552             log_to_screen
    1553                 ("You must leave at least one partition spare as the Extended partition.");
     1534            log_to_screen("You must leave at least one partition spare as the Extended partition.");
    15541535            mr_free(device_str);
    15551536            mr_free(format);
     
    15661547            retval += label_drive_or_slice(mountlist, device_str, 0);
    15671548            if (system(tmp)) {
    1568                 log_to_screen
    1569                     ("Warning! Unable to make the slice bootable.");
     1549                log_to_screen("Warning! Unable to make the slice bootable.");
    15701550            }
    15711551            mr_free(tmp);
     
    16111591
    16121592        if (g_partition_table_locked_up > 0) {
    1613             log_to_screen
    1614                 ("A flaw in the Linux kernel has locked the partition table. Even calling partprobe did not suceed :-(");
     1593            log_to_screen("A flaw in the Linux kernel has locked the partition table. Even calling partprobe did not suceed :-(");
    16151594        }
    16161595    }
     
    18751854    if (retval) {
    18761855        mvaddstr_and_log_it(g_currentY++, 74, "Failed.");
    1877         log_to_screen
    1878             ("Errors occurred during the partitioning of your hard drives.");
     1856        log_to_screen("Errors occurred during the partitioning of your hard drives.");
    18791857    } else {
    18801858        mvaddstr_and_log_it(g_currentY++, 74, "Done.");
     
    23112289
    23122290    /** float ***********************************************************/
    2313     float factor;
    2314     float new_size;
    2315 //  float newcylinderno;
     2291    long long factor;
     2292    long long new_size;
    23162293
    23172294    /** long *************************************************************/
    2318     long newsizL = 0L;
    2319     long current_size_of_drive = 0L;
    2320     long original_size_of_drive = 0L;
    2321     long final_size = 0L;           /* all in Megabytes */
     2295    long long newsizL = 0LL;
     2296    long long totalsizL = 0LL;
     2297    long long current_size_of_drive = 0LL;  /* use KB interally for precision */
     2298    long long original_size_of_drive = 0LL; /* use KB interally for precision */
    23222299    struct mountlist_reference *drivemntlist;
    23232300
     
    23362313    }
    23372314
    2338     current_size_of_drive = get_phys_size_of_drive(drive_name);
    2339 
    2340     if (current_size_of_drive <= 0) {
     2315    current_size_of_drive = (long long) get_phys_size_of_drive(drive_name) * 1024LL;
     2316
     2317    if (current_size_of_drive <= 0LL) {
    23412318        log_it("Not resizing to match %s - can't find drive", drive_name);
    23422319        return;
    23432320    }
    2344     log_to_screen("Expanding entries to suit drive %s (%ld MB)", drive_name, current_size_of_drive);
     2321    log_to_screen("Expanding entries to suit drive %s (%lld MB)", drive_name, current_size_of_drive / 1024);
    23452322
    23462323    drivemntlist = malloc(sizeof(struct mountlist_reference));
     
    23542331
    23552332    for (partno = 0; partno < drivemntlist->entries; partno++) {
    2356         if (drivemntlist->el[partno]->size > 0) {
    2357             original_size_of_drive += (drivemntlist->el[partno]->size / 1024L);
     2333        if (drivemntlist->el[partno]->size > 0LL) {
     2334            /* Keep KB here */
     2335            original_size_of_drive += drivemntlist->el[partno]->size;
    23582336        }
    23592337    }
     
    23632341        return;
    23642342    }
    2365     factor = (float) (current_size_of_drive) / (float) (original_size_of_drive);
    2366     log_to_screen("Disk %s was %ld MB; is now %ld MB; factor = %f", drive_name, original_size_of_drive, current_size_of_drive, factor);
     2343    factor = (current_size_of_drive) / (original_size_of_drive);
     2344    log_to_screen("Disk %s was %lld MB; is now %lld MB; Proportionally resizing partitions (factor ~= %lld)", drive_name, original_size_of_drive/1024, current_size_of_drive/1024, factor);
    23672345
    23682346    lastpart = drivemntlist->entries - 1;
     
    23702348        /* the 'atoi' thing is to make sure we don't try to resize _images_, whose formats will be numeric */
    23712349        if (!atoi(drivemntlist->el[partno]->format)) {
    2372             new_size = (float) (drivemntlist->el[partno]->size) * factor;
     2350            new_size = (drivemntlist->el[partno]->size) * factor;
    23732351        } else {
    23742352            new_size = drivemntlist->el[partno]->size;
     
    23792357                    drivemntlist->el[partno]->device,
    23802358                    drivemntlist->el[partno]->mountpoint);
    2381             newsizL = (long) new_size;  // It looks wrong but it's not
    2382         } else {
    2383             newsizL = (long) new_size;
    2384         }
     2359        }
     2360        newsizL = new_size;
    23852361
    23862362        /* Do not apply the factor if partition was of negative size */
    2387         if (newsizL < 0) {
     2363        if (newsizL < 0LL) {
    23882364            newsizL = drivemntlist->el[partno]->size;
    23892365        }
    2390 
    2391         log_to_screen("Changing %s from %lld KB to %ld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL);
     2366        totalsizL += newsizL;
     2367
     2368        log_to_screen("Changing %s from %lld KB to %lld KB", drivemntlist->el[partno]->device, drivemntlist->el[partno]->size, newsizL);
    23922369        drivemntlist->el[partno]->size = newsizL;
    23932370    }
    2394     final_size = get_phys_size_of_drive(drive_name);
    2395     log_to_screen("final_size = %ld MB", final_size);
     2371    // Ensures over-allocation alert and prompt for interactive mode does not happen
     2372    if (totalsizL > current_size_of_drive) {
     2373        log_to_screen("Last partition size calculated would be over-allocated, reducing %s from %lld KB to %lld KB.", drivemntlist->el[lastpart]->device, drivemntlist->el[lastpart]->size, drivemntlist->el[lastpart]->size - (totalsizL - current_size_of_drive));
     2374        drivemntlist->el[drivemntlist->entries-1]->size -= (totalsizL - current_size_of_drive);
     2375    } else if (totalsizL < current_size_of_drive) {
     2376        log_to_screen("Last partition size calculated would be under-allocated, increasing %s from %lld KB to %lld KB.",drivemntlist->el[lastpart]->device, drivemntlist->el[lastpart]->size, drivemntlist->el[lastpart]->size + (current_size_of_drive - totalsizL));
     2377        drivemntlist->el[drivemntlist->entries-1]->size += (current_size_of_drive - totalsizL);
     2378    }
     2379    log_to_screen("final_size = %lld MB", current_size_of_drive / 1024);
    23962380}
    23972381
Note: See TracChangeset for help on using the changeset viewer.