Changeset 2094


Ignore:
Timestamp:
Dec 17, 2008, 12:59:22 AM (11 years ago)
Author:
bruno
Message:
  • Adds support for initrd regeneration at restore time.
Location:
branches/2.2.8/mondo/src/mondorestore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.8/mondo/src/mondorestore/mondo-rstr-newt.c

    r2080 r2094  
    11/***************************************************************************
    2 mondo-rstr-newt.c  -  description
    3 -----------------
    4 
    5 begin: Fri Apr 19 16:40:35 EDT 2002
    6 copyright : (C) 2002 Mondo  Hugo Rabson
    7 email     : Hugo Rabson <hugorabson@msn.com>
    8 edited by : by Stan Benoit 4/2002
    9 email     : troff@nakedsoul.org
    10 cvsid     : $Id$
    11 ***************************************************************************/
    12 
    13 /***************************************************************************
    14  *                                                                         *
    15  *   This program is free software; you can redistribute it and/or modify  *
    16  *   it under the terms of the GNU General Public License as published by  *
    17  *   the Free Software Foundation; either version 2 of the License, or     *
    18  *   (at your option) any later version.                                   *
    19  *                                                                         *
    20  ***************************************************************************/
    21 /* mondo-rstr-newt.c               Hugo Rabson
    22 
    23 
    24 07/12
    25 - wider mountlist entry editor window
    26 
    27 03/28/2004
    28 - removed g_mountlist_fname
    29 
    30 07/02/2003
    31 - fixed calls to popup_and_get_string()
    32 
    33 06/05
    34 - cleaned up get_isodir_info()
    35 
    36 05/02
    37 - added strip_path() to improve file list display for long paths (Conor)
    38 
    39 04/24
    40 - added lots of assert()'s and log_OS_error()'s
    41 
    42 04/08/2003
    43 - commented out call to sort_mountlist_by_device(), just in case it's
    44   futzing with LVM/RAID users
    45 
    46 08/21/2002
    47 - fix MOUNTLIST_FNAME and RAIDTAB_FNAME if Reload button finds them empty
    48 
    49 08/19
    50 - fixed what_number_cd_is_this() to take bkpinfo as parameter
    51 
    52 07/01 - 07/31
    53 - renamed from mondo-newt.c to mondo-rstr-newt.c
    54 - moved lots of subroutines to libmondo-newt.c
    55 - added hooks to libmondo
    56 - better handling of yes/no/YES/NO
    57 - better "% done" feedback (Philippe de Muyter)
    58 
    59 05/01 - 06/30
    60 - trim trailing \n from fgets() in a couple of functions
    61 - expanded "May I write mountlist?" message
    62 - replace scanf() with a properly restricted fgets() (Troff)
    63 
    64 02/01 - 02/28/2002
    65 - allow up to 50 chars in popup_and_get_string()'s input field
    66 - if g_current_progress > g_maximum_progress then g_current_progress=g_max...
    67   to stop the progress bar from shooting off the RHS of the screen :)
    68 - beefed up the RAID-related logging a bit
    69 - don't complain if partition format is a number (1-255)
    70 - if hard disk does not exist then warn user when editing mountlist
    71 - when running 'eject -t', log its output
    72 
    73 [...]
    74 
    75 08/09/2001
    76 - created
    77 */
     2 * $Id$
     3 */
    784
    795
  • branches/2.2.8/mondo/src/mondorestore/mondo-rstr-tools.c

    r2087 r2094  
    13481348}
    13491349
     1350void offer_to_make_initrd() {
     1351
     1352if (bkpinfo->restore_mode != nuke) {
     1353    if (!ask_me_yes_or_no
     1354        ("You will now be able to re-generate your initrd.\nThis specially useful if you changed of hardware configuration, cloned, made P2V, used multipath... Do you need to do it ?")) {
     1355        return;
     1356    }
     1357    popup_and_OK("You'll now be chrooted under your future / partition.\nGo under /boot and rebuild your initrd with\nmkinitrd -f -v initrd-2.x.y.img 2.x.y e.g.\nThen type exit to finish.");
     1358    newtSuspend();
     1359    (void)system("chroot " MNT_RESTORING);
     1360    newtResume();
     1361} else {
     1362    log_to_screen("Non-interactive mode: no way to give you the keyboard so that you re-generate your initrd. Hope it's OK");
     1363    log_msg(1,"Non-interactive mode: no way to give you the keyboard so that you re-generate your initrd. Hope it's OK");
     1364}
     1365}
     1366
    13501367
    13511368/**
     
    13891406    paranoid_free(tmp);
    13901407    system("sync");
     1408
     1409    offer_to_make_initrd();
    13911410    if (!strcmp(name, "LILO")) {
    13921411        res = run_lilo(offer_to_hack_scripts);
     
    15061525    }
    15071526    if (offer_to_run_stabgrub
    1508         && ask_me_yes_or_no("Did you change the mountlist?"))
     1527        && ask_me_yes_or_no("Did you change the mountlist or cloned the system ?"))
    15091528        /* interactive mode */
    15101529    {
     
    16131632    strcpy(editor, find_my_editor());
    16141633    if (offer_to_run_stabelilo
    1615         && ask_me_yes_or_no("Did you change the mountlist?"))
     1634        && ask_me_yes_or_no("Did you change the mountlist or cloned the system ?"))
    16161635
    16171636        /* interactive mode */
     
    16871706    strcpy(editor, find_my_editor());
    16881707    if (offer_to_run_stablilo
    1689         && ask_me_yes_or_no("Did you change the mountlist?"))
     1708        && ask_me_yes_or_no("Did you change the mountlist or cloned the system ?"))
    16901709
    16911710        /* interactive mode */
     
    18001819
    18011820    if (offer_to_hack_scripts
    1802         && ask_me_yes_or_no("Did you change the mountlist?"))
     1821        && ask_me_yes_or_no("Did you change the mountlist or cloned the system ?"))
    18031822        /* interactive mode */
    18041823    {
     
    24292448    paranoid_free(raidlist);
    24302449}
     2450
     2451
  • branches/2.2.8/mondo/src/mondorestore/mondorestore.c

    r2087 r2094  
    391391    asprintf(&editor, "%s", find_my_editor());
    392392    asprintf(&tmp1,"chroot %s %s /etc/multipath.conf", MNT_RESTORING, editor);
     393    popup_and_OK("You will now edit multipath.conf");
     394    if (!g_text_mode) {
     395        newtSuspend();
     396    }
    393397    paranoid_system(tmp1);
    394398    paranoid_free(tmp1);
     
    630634    }
    631635
     636    clean_multiconf();
    632637    if (ask_me_yes_or_no("Initialize the boot loader?")) {
    633638        run_boot_loader(TRUE);
     
    639644
    640645    clean_blkid();
    641     clean_multiconf();
    642646    protect_against_braindead_sysadmins();
    643647    retval += unmount_all_devices(mountlist);
     
    867871    iamhere("Restoring everything");
    868872    retval += restore_everything(NULL);
     873    clean_multiconf();
    869874    if (!run_boot_loader(FALSE)) {
    870875        log_msg(1,
     
    873878    }
    874879    clean_blkid();
    875     clean_multiconf();
    876880    protect_against_braindead_sysadmins();
    877881    retval += unmount_all_devices(mountlist);
     
    28182822    bool run_postnuke = FALSE;
    28192823
    2820   /**************************************************************************
    2821    * hugo-                                                                  *
    2822    * busy stuff here - it needs some comments -stan                           *
    2823    *                                                                        *
    2824    **************************************************************************/
    28252824    if (getuid() != 0) {
    28262825        fprintf(stderr, "Please run as root.\r\n");
Note: See TracChangeset for help on using the changeset viewer.