Changeset 1924 in MondoRescue for branches/stable/mondo


Ignore:
Timestamp:
Apr 18, 2008, 1:41:41 AM (17 years ago)
Author:
Bruno Cornec
Message:

svn merge -r 1902:1923 $SVN_M/branches/2.2.6

Location:
branches/stable/mondo/src
Files:
3 deleted
14 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/Makefile.am

    r1056 r1924  
    1313                       libmondo-mountlist.c libmondo-raid.c \
    1414                       libmondo-stream.c libmondo-string.c libmondo-tools.c \
    15                        libmondo-verify.c newt-specific.c \
     15                       libmondo-verify.c newt-specific.c libmondo-cli.c \
    1616                       libmondo-archive.h libmondo-devices.h \
    1717                       libmondo-filelist.h libmondo-files.h libmondo-fork.h \
    1818                       libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \
    1919                       libmondo-stream.h libmondo-string.h libmondo-tools.h \
    20                        libmondo-verify.h libmondo-fifo.h \
     20                       libmondo-verify.h libmondo-fifo.h libmondo-cli.h \
    2121                       libmondo-archive-EXT.h my-stuff.h mondostructures.h \
    2222                       libmondo-devices-EXT.h libmondo-fifo-EXT.h \
     
    2525                       libmondo-mountlist-EXT.h libmondo-raid-EXT.h  \
    2626                       libmondo-string-EXT.h libmondo-tools-EXT.h \
    27                        libmondo-verify-EXT.h  libmondo-stream-EXT.h \
     27                       libmondo-verify-EXT.h  libmondo-stream-EXT.h libmondo-cli-EXT.h \
    2828                       newt-specific.h
  • branches/stable/mondo/src/common/libmondo-devices.c

    r1903 r1924  
    6161 */
    6262bool g_restoring_live_from_cd = FALSE;
     63bool g_restoring_live_from_nfs = FALSE;
    6364
    6465extern t_bkptype g_backup_media_type;   // set by main()
     
    18521853                }
    18531854            } else {
    1854                 sz_size = 0;
     1855                strcpy(sz_size, "0");
    18551856            }
    18561857            mr_free(comment);
  • branches/stable/mondo/src/common/libmondo-filelist.c

    r1903 r1924  
    15901590        mr_asprintf(&tmp2, call_program_and_get_last_line_of_output("mount | grep -Ew 'ntfs|fat|vfat|dos' | awk '{print $3}'"));
    15911591        if (strlen(tmp2) < 1) {
    1592             mr_asprintf(&tmp1,"");
     1592            mr_asprintf(&tmp1," ");
    15931593        } else {
    15941594            mr_msg(2, "Found windows FS: %s",tmp2);
  • branches/stable/mondo/src/common/libmondo-mountlist.c

    r1904 r1924  
    843843#if linux
    844844        sscanf(incoming,
    845                "%s %s %s %s %s %s",
     845               "%s %s %s %s %s",
    846846               mountlist->el[items].device,
    847847               mountlist->el[items].mountpoint,
     
    909909                     mountlist->el[items].format,
    910910                     mountlist->el[items].size,
    911                     mountlist->el[items].label);
     911                     mountlist->el[items].label);
    912912            items++;
    913913        }
     
    948948    for (i = 0; i < mountlist->entries; i++) {
    949949        fprintf(fout,
    950                 "%-15s %-15s %-15s %-15lld %-15s %-15s\n",
     950                "%-15s %-15s %-15s %-15lld %-15s\n",
    951951                mountlist->el[i].device, mountlist->el[i].mountpoint,
    952952                mountlist->el[i].format, mountlist->el[i].size,
  • branches/stable/mondo/src/common/libmondo-stream.c

    r1904 r1924  
    695695    (void) getcwd(old_cwd, MAX_STR_LEN);
    696696    chdir(bkpinfo->tmpdir);
    697     mr_asprintf(&tmp, "tar -zxf %s tmp/mondo-restore.cfg 2> /dev/null",
     697    mr_asprintf(&tmp, "tar -zxf %s ./tmp/mondo-restore.cfg 2> /dev/null",
    698698             outfname);
    699699    paranoid_system(tmp);
  • branches/stable/mondo/src/common/libmondo-tools.c

    r1903 r1924  
    2121#include "libmondo-fork-EXT.h"
    2222#include "libmondo-raid-EXT.h"
     23#include "libmondo-devices-EXT.h"
    2324#include <sys/socket.h>
    2425#include <netdb.h>
     
    7879
    7980extern bool am_I_in_disaster_recovery_mode(void);
     81
     82/* Return a string containing the date */
     83char *mr_date(void) {
     84
     85        time_t tcurr;
     86
     87        tcurr = time(NULL);
     88        return(ctime(&tcurr));
     89}
     90
     91/*-----------------------------------------------------------*/
    8092
    8193
     
    692704    strcpy(bkpinfo->tmpdir,p);
    693705    paranoid_free(tmp);
    694 
    695     //sprintf(bkpinfo->tmpdir, "%s/tmpfs/mondo.tmp.%d", "/tmp", (int) (random() % 32768));  // for mondorestore
    696706}
    697707
     
    711721    memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo));
    712722
    713     /* special case for tmpdir as used eveywhere after */
    714     setup_tmpdir(NULL);
     723    sensibly_set_tmpdir_and_scratchdir();
    715724
    716725    bkpinfo->manual_tray = mr_conf->manual_tray;
     
    764773    bkpinfo->prefix = tmp;
    765774
    766     bkpinfo->scratchdir[0] = '\0';
    767775    bkpinfo->make_filelist = TRUE;  // unless -J supplied to mondoarchive
    768776    bkpinfo->optimal_set_size = 0;
     
    823831 * - make sure afio, cdrecord, bzip2, awk, md5sum, strings, mindi, and buffer exist
    824832 * - make sure CD-ROM is unmounted
    825  * - make sure /etc/modules.conf exists
    826833 * - make sure user's mountlist is OK by running <tt>mindi --makemountlist</tt>
    827834 *
     
    940947    }
    941948    mr_free(tmp);
    942 #ifndef __FreeBSD__
    943     if (!does_file_exist("/etc/modules.conf")) {
    944         if (does_file_exist("/etc/conf.modules")) {
    945             log_it("Linking /etc/modules.conf to /etc/conf.modules");
    946             run_program_and_log_output
    947                 ("ln -sf /etc/conf.modules /etc/modules.conf", 5);
    948         } else if (does_file_exist("/etc/modprobe.d")) {
    949             log_it
    950                 ("Directory /etc/modprobe.d found. mindi will use its contents.");
    951         } else if (does_file_exist("/etc/modprobe.conf")) {
    952             log_it("Linking /etc/modules.conf to /etc/modprobe.conf");
    953             run_program_and_log_output
    954                 ("ln -sf /etc/modprobe.conf /etc/modules.conf", 5);
    955         } else {
    956             retval++;
    957             log_to_screen
    958                 (_("Please find out what happened to /etc/modules.conf"));
    959         }
    960     }
    961 #endif
    962949
    963950    run_program_and_log_output("cat /etc/fstab", 5);
  • branches/stable/mondo/src/include/my-stuff.h

    r1770 r1924  
    1818#define MINDI_CACHE "/var/cache/mindi"
    1919#define MONDORESTORECFG MONDO_CACHE"/mondo-restore.cfg"
     20
    2021/**
    2122 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked).
    2223 */
    23 #define MONDO_CFG_FILE_STUB "tmp/mondo-restore.cfg"
    24 
    25 
     24#define MONDO_CFG_FILE_STUB "./tmp/mondo-restore.cfg"
    2625
    2726/**
     
    7675 * The biggielist stub (appended to the directory where all.tar.gz was unpacked).
    7776 */
    78 #define BIGGIELIST_TXT_STUB "tmp/biggielist.txt"
     77#define BIGGIELIST_TXT_STUB "./tmp/biggielist.txt"
    7978
    8079/**
    8180 * The filelist stub (appended to the directory where all.tar.gz was unpacked).
    8281 */
    83 #define FILELIST_FULL_STUB "tmp/filelist.full.gz"
     82#define FILELIST_FULL_STUB "./tmp/filelist.full.gz"
    8483
    8584/**
    8685 * The mountlist stub (appended to the directory where all.tar.gz was unpacked).
    8786 */
    88 #define MOUNTLIST_FNAME_STUB "tmp/mountlist.txt"
     87#define MOUNTLIST_FNAME_STUB "./tmp/mountlist.txt"
     88
     89/**
     90 * The mondo-restore.cfg stub (appended to the directory where all.tar.gz was unpacked).
     91 */
     92#define MONDO_CFG_FILE_STUB "./tmp/mondo-restore.cfg"
    8993
    9094/**
  • branches/stable/mondo/src/lib/mr_str.c

    r1594 r1924  
    66 */
    77
     8#include <stdlib.h>
    89#include <stdio.h>
    910#include <string.h>
  • branches/stable/mondo/src/mondoarchive/Makefile.am

    r1560 r1924  
    77
    88## Headers
    9 noinst_HEADERS       = mondo-cli-EXT.h mondo-cli.h mondoarchive.h
     9noinst_HEADERS       = mondoarchive.h
    1010
    1111## The program
    1212sbin_PROGRAMS        = mondoarchive
    13 mondoarchive_SOURCES = mondoarchive.c mondo-cli.c
     13mondoarchive_SOURCES = mondoarchive.c
    1414mondoarchive_LDADD   = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1842 r1924  
    5959
    6060/****************** subroutines used only here ******************/
     61
     62/**
     63 * Whether we're restoring from ISOs. Obviously not, since this is the
     64 * backup program.
     65 * @note You @b MUST declare this variable somewhere in your program if
     66 * you use libmondo. Otherwise the link will fail.
     67 * @ingroup globalGroup
     68 */
     69bool g_ISO_restore_mode = FALSE;
     70
     71/* Do we use extended attributes and acl ?
     72 *  * By default no, use --acl & --attr options to force their usage */
     73char *g_getfacl = NULL;
     74char *g_getfattr = NULL;
    6175
    6276/* Reference to global bkpinfo */
  • branches/stable/mondo/src/mondoarchive/mondoarchive.h

    r1326 r1924  
    1717 */
    1818char *MONDO_LOGFILE = "/var/log/mondoarchive.log";
     19char *MONDO_OPTIONS = "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z";
    1920
    2021/* No restriction on ps options */
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r1903 r1924  
    11181118                    BIGGIELIST_TXT_STUB,
    11191119                    FILELIST_FULL_STUB,
    1120                     "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
     1120                    "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    11211121            mr_msg(1, "tarcommand = %s", command);
    11221122            run_program_and_log_output(command, 1);
     
    11351135                    BIGGIELIST_TXT_STUB,
    11361136                    FILELIST_FULL_STUB,
    1137                     "tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
     1137                    "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    11381138            mr_msg(1, "tarcommand = %s", command);
    11391139            run_program_and_log_output(command, 1);
     
    11421142            if (!does_file_exist(BIGGIELIST_TXT_STUB)) {
    11431143                fatal_error
    1144                     ("all.tar.gz did not include tmp/biggielist.txt");
     1144                    ("all.tar.gz did not include ./tmp/biggielist.txt");
    11451145            }
    11461146            if (!does_file_exist(FILELIST_FULL_STUB)) {
    11471147                fatal_error
    1148                     ("all.tar.gz did not include tmp/filelist.full.gz");
     1148                    ("all.tar.gz did not include ./tmp/filelist.full.gz");
    11491149            }
    11501150        }
     
    20832083            1024L * 1024 * 32 / bkpinfo->internal_tape_block_size,
    20842084            MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB,
    2085             BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm");
     2085            BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "./tmp/i-want-my-lvm");
    20862086    mr_msg(2, "command = '%s'", command);
    20872087    res = run_program_and_log_output(command, -1);
     
    21132113    char *ramdisk_fname = NULL;
    21142114    char *mountlist_file = NULL;
    2115     int res = 0;
    21162115
    21172116    bool try_plan_B = FALSE;
     
    22052204                mr_msg(2,
    22062205                        "gcffa --- Plan B, a.k.a. untarring some file from all.tar.gz");
    2207                 mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "tmp/i-want-my-lvm"); // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary
     2206                mr_asprintf(&command, "tar -zxvf " MNT_CDROM "/images/all.tar.gz %s %s %s %s %s", MOUNTLIST_FNAME_STUB, MONDO_CFG_FILE_STUB, BIGGIELIST_TXT_STUB, FILELIST_FULL_STUB, "./tmp/i-want-my-lvm");   // add -b TAPE_BLOCK_SIZE if you _really_ think it's necessary
    22082207                run_program_and_log_output(command, TRUE);
    22092208                mr_free(command);
  • branches/stable/mondo/src/mondorestore/mondorestore.c

    r1904 r1924  
    924924
    925925    strcpy(bkpinfo->restore_path, "/");
    926     if (!g_restoring_live_from_cd) {
     926    if (!g_restoring_live_from_cd && !g_restoring_live_from_nfs) {
    927927        popup_and_OK
    928928            (_("Please insert tape/CD/USB key, then hit 'OK' to continue."));
    929929        sleep(1);
    930930    }
    931     interactively_obtain_media_parameters_from_user(FALSE);
     931    if (!g_restoring_live_from_nfs) {
     932        interactively_obtain_media_parameters_from_user(FALSE);
     933    }
    932934    if (!bkpinfo->media_device) {
    933935        mr_msg(2, "Warning - failed to find media dev");
     
    948950    retval = load_mountlist(mountlist, g_mountlist_fname);
    949951    load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    950     filelist = process_filelist_and_biggielist();
    951     if (filelist) {
     952
     953    if (!g_restoring_live_from_nfs && (filelist = process_filelist_and_biggielist())) {
    952954        save_filelist(filelist, "/tmp/selected-files.txt");
    953955        mr_asprintf(&old_restpath,bkpinfo->restore_path);
     
    961963        strcpy(bkpinfo->restore_path, old_restpath);
    962964        mr_free(old_restpath);
     965    } else {
     966        retval += restore_everything(NULL);
    963967    }
    964968    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
     
    27062710    paranoid_fclose(fout);
    27072711    sprintf(command,
    2708             "tar -zxvf %s tmp/mondo-restore.cfg tmp/mountlist.txt tmp/filelist.full tmp/biggielist.txt",
     2712            "tar -zxvf %s ./tmp/mondo-restore.cfg ./tmp/mountlist.txt ./tmp/filelist.full ./tmp/biggielist.txt",
    27092713            datadisks_fname);
    27102714    run_program_and_log_output(command, 4);
     
    30443048            g_restoring_live_from_cd = TRUE;
    30453049        }
     3050        if (bkpinfo->backup_media_type == nfs) {
     3051            g_restoring_live_from_nfs = TRUE;
     3052        }
    30463053        if (argc == 5 && strcmp(argv[1], "--monitas-live") == 0) {
    30473054            retval =
  • branches/stable/mondo/src/mondorestore/mr-externs.h

    r1663 r1924  
    108108extern bool g_text_mode;
    109109extern bool g_restoring_live_from_cd;
     110extern bool g_restoring_live_from_nfs;
    110111extern int fput_string_one_char_at_a_time(FILE *, char *);
    111112
Note: See TracChangeset for help on using the changeset viewer.