Changeset 1079 in MondoRescue for trunk/mondo


Ignore:
Timestamp:
Jan 28, 2007, 5:58:18 PM (17 years ago)
Author:
Bruno Cornec
Message:

merge -r1045:1078 £SVN_M/branches/stable

Location:
trunk/mondo
Files:
1 deleted
31 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/mondo/INSTALL

    r129 r1079  
    1313configure --with-maximum-noof-media=<big-number>. To make a statically
    1414linked mondorestore (not tested), configure --enable-static-mr.
    15 
    1615
    1716[original entry]
  • trunk/mondo/Makefile.am

    r824 r1079  
    22SUBDIRS        = src po
    33man8_MANS      = docs/man/mondoarchive.8 docs/man/mondorestore.8
    4 
    54ACLOCAL_AMFLAGS = -I m4
    6 
    7 EXTRA_DIST = config.rpath mkinstalldirs
    8 
    9 
  • trunk/mondo/bootstrap

    r507 r1079  
    11#!/bin/bash
     2#
     3# $Id$
    24#
    35# Built from scratch
  • trunk/mondo/configure.in

    r932 r1079  
    7474        AC_CHECK_LIB(pthread, pthread_create, true, [echo "*** Cannot find -lpthread."; echo "*** Please make sure you have the linuxthreads glibc add-on installed."; exit 1])
    7575        PTHREAD="-lpthread"
    76         CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_REENTRANT"
     76        CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -Wshadow -funsigned-char -Wstrict-prototypes -Wunused -Winit-self -Wcast-align"
    7777        ;;
    7878    *)
  • trunk/mondo/distributions/rpm/mondo.spec

    r1043 r1079  
    1616Source:     SSS
    1717BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
    18 BuildRequires:  newt-devel >= 0.50
     18BuildRequires:  newt-devel >= 0.50, gettext-devel
    1919ExcludeArch:    ppc
    2020OBS
    21 Requires:   mindi >= 1.2.1, bzip2 >= 0.9, afio, mkisofs, binutils, newt >= 0.50, DDD
     21Requires:   mindi >= 1.2.1, bzip2 >= 0.9, afio, mkisofs, binutils, newt >= 0.50, gettext, DDD
    2222%ifarch ia64
    2323Requires:   elilo, parted
  • trunk/mondo/po/POTFILES.in

    r975 r1079  
    3939src/common/newt-specific.h
    4040src/common/libmondo-tools.h
    41 src/common/libmondo-string.c
    4241src/common/libmondo-fork.h
    4342src/common/libmondo-files.h
    4443src/common/libmondo-filelist.c
    45 src/common/libmondo-string.h
    4644src/common/libmondo-raid.c
    4745src/common/libmondo-filelist.h
     
    4947src/common/libmondo-raid.h
    5048src/common/mondostructures.h
    51 src/common/libmondo-msg.c
    5249src/common/libmondo-archive.h
    5350src/common/libmondo-stream.c
  • trunk/mondo/src/common/Makefile.am

    r839 r1079  
     1##
     2## $Id$
    13##
    24## Process this file with Automake to generate `Makefile.in'
  • trunk/mondo/src/common/libmondo-archive.c

    r1074 r1079  
    3232#include "libmondo-verify-EXT.h"
    3333#include "libmondo-archive.h"
     34
    3435#define DVDRWFORMAT 1
    3536
     
    544545    char *tmp = NULL;
    545546    char *tmp1 = NULL;
     547    char *tmp2 = NULL;
    546548    char *command = NULL;
    547549    char *use_lzo_sz = NULL;
     
    786788        mr_asprintf(&value, "dvd");
    787789        break;
     790    case usb:
     791        strcpy(value, "usb");
     792        break;
    788793    default:
    789794        fatal_error("Unknown backup_media_type");
     
    854859    log_msg(1, "lines_in_filelist = %ld", lines_in_filelist);
    855860
     861    if (bkpinfo->backup_media_type == usb) {
     862        asprintf(&tmp2, "--usb %s", bkpinfo->media_device);
     863    } else {
     864        asprintf(&tmp2,"");
     865    }
     866
    856867    // Watch it! This next line adds a parameter...
    857868    if (bkpinfo->nonbootable_backup) {
     
    862873
    863874    mr_asprintf(&command,
    864 /*     "mindi --custom 2=%s 3=%s/images 4=\"%s\" 5=\"%s\" \
    865 6=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \
    866 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/
    867              "mindi --custom %s %s/images '%s' '%s' \
     875            "mindi %s --custom '%s' '%s/images' '%s' '%s' \
    868876'%s' %ld '%s' '%s' '%s' \
    869 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'", bkpinfo->tmpdir,  // parameter #2
    870              bkpinfo->scratchdir,   // parameter #3
    871              bkpinfo->kernel_path,  // parameter #4
    872              tape_device,       // parameter #5
    873              tape_size_sz,      // parameter #6
    874              lines_in_filelist, // parameter #7 (INT)
    875              use_lzo_sz,        // parameter #8
    876              cd_recovery_sz,    // parameter #9
    877              bkpinfo->image_devs,   // parameter #10
    878              broken_bios_sz,    // parameter #11
    879              last_filelist_number,  // parameter #12 (STRING)
    880              estimated_total_noof_slices,   // parameter #13 (INT)
    881              devs_to_exclude,   // parameter #14
    882              use_comp_sz,       // parameter #15
    883              use_lilo_sz,       // parameter #16
    884              use_star_sz,       // parameter #17
    885              bkpinfo->internal_tape_block_size, // parameter #18 (LONG)
    886              bkpinfo->differential, // parameter #19 (INT)
    887              use_gzip_sz,       // parameter #20 (STRING)
    888              tmp);
     877'%s' %s %ld '%s' '%s' '%s' '%s' %ld %d '%s'",
     878            tmp2,
     879            bkpinfo->tmpdir,        // parameter #2
     880            bkpinfo->scratchdir,    // parameter #3
     881            bkpinfo->kernel_path,   // parameter #4
     882            tape_device,            // parameter #5
     883            tape_size_sz,           // parameter #6
     884            lines_in_filelist,      // parameter #7 (INT)
     885            use_lzo_sz,             // parameter #8
     886            cd_recovery_sz,         // parameter #9
     887            bkpinfo->image_devs,    // parameter #10
     888            broken_bios_sz,         // parameter #11
     889            last_filelist_number,   // parameter #12 (STRING)
     890            estimated_total_noof_slices,    // parameter #13 (INT)
     891            devs_to_exclude,        // parameter #14
     892            use_comp_sz,            // parameter #15
     893            use_lilo_sz,            // parameter #16
     894            use_star_sz,            // parameter #17
     895            bkpinfo->internal_tape_block_size,  // parameter #18 (LONG)
     896            bkpinfo->differential,  // parameter #19 (INT)
     897            use_gzip_sz,            // parameter #20 (STRING)
     898            tmp);
    889899    mr_free(tmp);
    890900    mr_free(tape_size_sz);
     
    899909    mr_free(use_lilo_sz);
    900910    mr_free(use_gzip_sz);
     911    mr_free(tmp2);
    901912
    902913    log_msg(2, command);
  • trunk/mondo/src/common/libmondo-devices.c

    r1000 r1079  
    1 /*
    2  * $Id$
    3  * Subroutines for handling devices
    4  */
     1/* libmondo-devices.c                 Subroutines for handling devices
     2   $Id$
     3*/
     4
    55/**
    66 * @file
     
    14691469    case cdrw:
    14701470    case dvd:
     1471    case usb:
    14711472        if (archiving_to_media) {
    1472             if (bkpinfo->backup_media_type != dvd) {
     1473            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    14731474                if (ask_me_yes_or_no
    14741475                    (_("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")))
     
    14901491                mr_asprintf(&sz_size, "%d", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB
    14911492                log_msg(1, "Setting to DVD defaults");
     1493            } else if (bkpinfo->backup_media_type == usb) {
     1494                strcpy(bkpinfo->media_device, VANILLA_USB_DEVICE);
     1495                strcpy(sz_size, "512");
    14921496            } else {
    14931497                mr_allocstr(bkpinfo->media_device,VANILLA_SCSI_CDROM );
     
    14961500                log_msg(1, "Setting to CD defaults");
    14971501            }
    1498             if (bkpinfo->backup_media_type != dvd) {
     1502            if ((bkpinfo->backup_media_type != dvd) && (bkpinfo->backup_media_type != usb)) {
    14991503                if (!popup_and_get_string(_("Speed"), comment, tmp)) {
    15001504                    log_to_screen(_("User has chosen not to backup the PC"));
  • trunk/mondo/src/common/libmondo-fifo.c

    r956 r1079  
    11/* $Id$ */
    2 
    32/**
    43 * @file
  • trunk/mondo/src/common/libmondo-fork.c

    r900 r1079  
    22 * $Id$
    33 */
    4 
    54#include "my-stuff.h"
    65#include "mondostructures.h"
  • trunk/mondo/src/common/libmondo-raid.c

    r900 r1079  
    1717#include "libmondo-raid.h"
    1818#include "mr_mem.h"
     19#include "mr_str.h"
    1920
    2021#ifdef __FreeBSD__
  • trunk/mondo/src/common/libmondo-tools.c

    r1046 r1079  
    181181
    182182/**
    183  * Locate mondoarchive's home directory. Searches in /usr/local/mondo, /usr/share/mondo,
     183 * Locate mondoarchive's home directory. Searches in /usr/share/mondo,
    184184 * /usr/local/share/mondo, /opt, or if all else fails, search /usr.
    185185 *
  • trunk/mondo/src/common/libmondo-verify.c

    r1074 r1079  
    11/* $Id$ */
    2 
    32/**
    43 * @file
  • trunk/mondo/src/common/mondostructures.h

    r1043 r1079  
    167167    nfs,                        ///< Back up to an NFS mount on the local subnet.
    168168    tape,                       ///< Back up to tapes.
     169    usb,                        ///< Back up to USB devices.
    169170    udev                        ///< Back up to another unsupported device; just send a stream of bytes.
    170171} t_bkptype;
     
    312313   * The device we're backing up to.
    313314   * If backup_media_type is @b cdr, @b cdrw, or @b cdstream, this should be the SCSI node (e.g. 0,1,0).
    314    * If backup_media_type is @b dvd, @b tape, or @b udev, this should be a /dev entry.
     315   * If backup_media_type is @b dvd, @b tape, @b usb or @b udev, this should be a /dev entry.
    315316   * If backup_media_type is anything else, this should be blank.
    316317   */
  • trunk/mondo/src/include/mr_conf.h

    • Property svn:eol-style set to native
  • trunk/mondo/src/include/mr_str.h

    • Property svn:eol-style set to native
  • trunk/mondo/src/include/my-stuff.h

    • Property svn:eol-style set to native
    r1074 r1079  
    126126#define ARBITRARY_MAXIMUM 2000  ///< The maximum number of items showing at once in the mountlist or filelist editor.
    127127#define MAX_TAPECATALOG_ENTRIES 8192    ///< The maximum number of entries in the tape catalog.
    128 #define MAX_STR_LEN 380         ///< The maximum length of almost all @p char buffers in Mondo.
     128#define MAX_STR_LEN 384         ///< The maximum length of almost all @p char buffers in Mondo.
     129                                        ///  Note: Make this divisible by eight to avoid aligment issues
     130                                        ///        on 64bit platforms like ia64.
    129131#define MAXIMUM_RAID_DEVS 32    ///< The maximum number of RAID devices in the raidlist.
    130132#define MAXIMUM_ADDITIONAL_RAID_VARS 32 ///< The maximum number of additional RAID variables per RAID device in the raidlist.
  • trunk/mondo/src/lib/mr_conf.c

    • Property svn:eol-style set to native
  • trunk/mondo/src/lib/mr_str.c

    • Property svn:eol-style set to native
  • trunk/mondo/src/mondoarchive/Makefile.am

    r900 r1079  
     1## $Id$
     2##
    13## $Id$
    24##
  • trunk/mondo/src/mondoarchive/mondo-cli.c

    r1043 r1079  
    216216    i = flag_set['c'] + flag_set['i'] + flag_set['n'] +
    217217        flag_set['t'] + flag_set['u'] + flag_set['r'] +
    218         flag_set['w'] + flag_set['C'];
     218        flag_set['w'] + flag_set['C'] + flag_set['U'];
    219219    if (i == 0) {
    220220        retval++;
     
    404404    }
    405405
     406    if (flag_set['U'])          // USB
     407    {
     408        if (! flag_set['d']) {
     409            fatal_error
     410                ("You need to specify a device file with -d for bootable USB device creation");
     411        }
     412        if (!flag_set['s']) {
     413            fatal_error("You did not specify a size (-s) for your USB device. Aborting");
     414        }
     415    }
     416
    406417    if (flag_set['r'])          // DVD
    407418    {
     
    453464            }
    454465        }
    455     } else {                    /* CD size */
     466    } else {                    /* CD|USB size */
    456467        if (flag_set['s']) {
    457468            if (process_the_s_switch(bkpinfo, flag_val['s'])) {
     
    505516    if (flag_set['w']) {
    506517        bkpinfo->backup_media_type = cdrw;
     518    }
     519    if (flag_set['U']) {
     520        bkpinfo->backup_media_type = usb;
    507521    }
    508522    if (flag_set['z']) {
     
    641655    }
    642656
    643     if (flag_set['d']) {        /* backup directory (if ISO/NFS) */
     657    if (flag_set['d']) {        /* backup directory (if ISO/NFS/USB) */
    644658        if (flag_set['i']) {
    645659            mr_allocstr(bkpinfo->isodir,flag_val['d']);
     
    653667            mr_allocstr(bkpinfo->nfs_remote_dir,flag_val['d']);
    654668        } else {                /* backup device (if tape/CD-R/CD-RW) */
    655 
    656669            mr_allocstr(bkpinfo->media_device, flag_val['d']);
    657670        }
     
    673686
    674687    if (!flag_set['d']
    675         && (flag_set['c'] || flag_set['w'] || flag_set['C'])) {
     688        && (flag_set['c'] || flag_set['w'] || flag_set['C'] || flag_set['U'])) {
    676689        if (g_kernel_version >= 2.6) {
    677690            if (popup_and_get_string
     
    902915    while ((opt =
    903916            getopt(argc, argv,
    904                    "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:VWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
     917                   "0123456789A:B:C:DE:FGHI:J:K:LNOP:QRS:T:UVWb:c:d:ef:gik:l:mn:op:rs:tuw:x:z"))
    905918           != -1) {
    906919        if (opt == '?') {
  • trunk/mondo/src/mondorestore/Makefile.am

    r900 r1079  
     1## $Id$
     2##
    13## $Id$
    24##
    35## Process with Automake to generate Makefile.in
    46##
     7AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include
    58
    69AM_CPPFLAGS = -DMONDO_CONF_DIR=\"$(sysconfdir)\" -I${top_builddir}/src/include
  • trunk/mondo/src/mondorestore/mondo-restore.c

    r1043 r1079  
    11/***************************************************************************
    2  * $Id$
    3  */
     2$Id$
     3restores mondoarchive data
     4***************************************************************************/
    45
    56/**
     
    21562157            mr_free(tarball_fname);
    21572158            mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%ld.afio.lzo",
     2159                current_tarball_number);
     2160        }
     2161        if (!does_file_exist(tarball_fname)) {
     2162            mr_free(tarball_fname);
     2163            mr_asprintf(&tarball_fname, MNT_CDROM "/archives/%ld.afio.gz",
    21582164                    current_tarball_number);
    21592165        }
  • trunk/mondo/src/mondorestore/mondo-rstr-tools.h

    r914 r1079  
    99void kill_petris(void);
    1010int mount_cdrom(struct s_bkpinfo *bkpinfo);
     11int mount_device(char *, char *, char *, bool);
    1112int mount_all_devices(struct mountlist_itself *, bool);
    1213void protect_against_braindead_sysadmins(void);
  • trunk/mondo/src/test/mktest

    r900 r1079  
    66#
    77
    8 gcc -O2 -I../common -I../lib test-conf.c ../lib/mr_conf.c ../common/libmondo-msg.c -o test-conf
    9 gcc -O2 -I../common -I../lib test-string.c ../lib/mr_str.c -o test-string
     8lib="../lib/mr_conf.c ../lib/mr_msg.c ../lib/mr_err.c ../lib/mr_mem.c"
     9OPT="-Wall -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -Wstrict-prototypes -Wshadow -funsigned-char -Wunused -Winit-self -Wcast-align -O2 -g -I../common -I../include"
    1010
    11 for f in "test-conf"; do
     11echo "Generating test-msg"
     12gcc $OPT test-msg.c $lib -o test-msg
     13echo "Generating test-string"
     14gcc $OPT test-string.c ../lib/mr_str.c $lib -o test-string
     15echo "Generating test-conf"
     16gcc $OPT test-conf.c $lib -o test-conf
     17
     18echo "Testing against previous run"
     19for f in test-conf test-string test-msg; do
    1220    chmod 755 $f
    1321    ./$f > /tmp/$f.res
     
    1624        echo "$f test KO !!"
    1725    fi
     26    valgrind -q --error-exitcode=1 --leak-check=yes ./$f 2>&1 > /tmp/valgrind-$f.res
     27    if [ $? -ne 0 ]; then
     28        echo "valgrind $f test KO !!"
     29    fi
    1830done
  • trunk/mondo/src/test/mondo.conf

    r531 r1079  
    55# Test conf file for mondo
    66testfalse = TRUE
     7# For msg tests
     8logfile = "/tmp/mondo-test.log"
     9loglevel = 3
  • trunk/mondo/src/test/test-conf.c

    • Property svn:eol-style set to native
    r900 r1079  
    77
    88#include <stdio.h>
    9 #include "my-stuff.h"
     9#include <stdlib.h>
     10
    1011#include "mr_conf.h"
    1112#include "mr_mem.h"
     
    1415int g_buffer_pid = 0;
    1516
    16 main() {
     17int main(void) {
    1718    int ret = 0;
    1819    int i = 0;
  • trunk/mondo/src/test/test-conf.res

    r561 r1079  
    11Integer : ***3***
    22Float : ***32.670000***
    3 String : ***"The big string"***
     3String : ***The big string***
  • trunk/mondo/src/test/test-string.c

    • Property svn:eol-style set to native
    r900 r1079  
    66 */
    77
    8 #define _GNU_SOURCE
    98#include <string.h>
    109#include <stdlib.h>
    1110#include <stdio.h>
    1211
    13 #include "my-stuff.h"
    1412#include "mr_str.h"
    1513#include "mr_mem.h"
    1614
    17 main() {
     15int main(void) {
    1816    const char delims[3] = ": \n";
    1917   
     
    3129    }
    3230    mr_free(string);
     31
    3332    exit(0);
    3433}
  • trunk/mondo/src/test/test-string.res

    r561 r1079  
    66token=|hda1[0]|, lastpos=28
    77token=|hda12[3]|, lastpos=37
    8 token=|hda6[2]]|, lastpos=45
    9 token=|hda5[1]]|, lastpos=53
     8token=|hda6[2]|, lastpos=45
     9token=|hda5[1]|, lastpos=53
Note: See TracChangeset for help on using the changeset viewer.