Changeset 808 in MondoRescue


Ignore:
Timestamp:
Sep 22, 2006, 11:12:37 PM (18 years ago)
Author:
Bruno Cornec
Message:

merge -r793:807 $SVN_M/branches/stable
src => common for the moment it's easier to manage merges

Location:
trunk
Files:
12 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/mindi/README.pxe

    r687 r808  
    1111label mondo
    1212        kernel vmlinuz-mondo
    13         append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [nfsmount=server:mountpoint] [ping=#] ...
     13        append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [nfsmount=server:mountpoint] [ping=#] ...
    1414
    1515ipdev is the device name (e.g. eth2)
  • trunk/mindi/distributions/debian/rules

    r588 r808  
    2626    dh_installdirs
    2727    # Build the installation tree:
    28     ( export PREFIX=$(CURDIR)/debian/$(PACKAGE_NAME)/usr && export CONFDIR=$(CURDIR)/debian/$(PACKAGE_NAME)/etc && ./install.sh )
     28    ( export RPMBUILDMINDI=true && export PREFIX=$(CURDIR)/debian/$(PACKAGE_NAME)/usr && export CONFDIR=$(CURDIR)/debian/$(PACKAGE_NAME)/etc && ./install.sh )
    2929
    3030# Build architecture-independent files here.
  • trunk/mindi/mindi

    r794 r808  
    534534    local my_partitions i
    535535    echo "MINDI_VERSION is $MINDI_VERSION" >> $LOGFILE
     536    echo "End date : `date`" >> $LOGFILE
    536537    if [ "$1" = "" ] ; then
    537     LogIt "Fatal error\n"
    538     else
    539     LogIt "Fatal error. $1\n"
     538        LogIt "Fatal error\n"
     539    else
     540        LogIt "Fatal error. $1\n"
    540541    fi
    541542    sync
     
    14221423            actual_dev=""
    14231424   
    1424             # 1st try : blkid, the good way for all LABEL
     1425            # 1st try : blkid, the good way for all LABEL except swap
    14251426            if [ -x "/sbin/blkid" ]; then
    14261427                actual_dev=`/sbin/blkid | /bin/grep "$redhat_label" | grep LABEL= | /bin/cut -d':' -f1`
     
    30223023echo "mindi called with the following arguments:" >> $LOGFILE
    30233024echo "$@" >> $LOGFILE
     3025echo "Start date : `date`" >> $LOGFILE
    30243026
    30253027if [ -e "/etc/conf.modules" ] && [ ! -e "/etc/modules.conf" ] ; then
     
    34833485done
    34843486echo "Mindi is exiting" >> $LOGFILE
     3487echo "End date : `date`" >> $LOGFILE
    34853488exit 0
  • trunk/mindi/rootfs/sbin/start-nfs

    r764 r808  
    33# $Id$
    44#
    5 # This script set up the network + NFS environement if needed.
     5# This script sets up the network + NFS environment if needed.
    66#
    77
     
    1717ipgateway=`grep nfs-client-defgw /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    1818ipconf=""
    19 nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    20 imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     19export nfsmount=`grep nfs-server-mount /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     20export imgname=`grep iso-prefix /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    2121if [ "$imgname" = "" ]; then
    22     imgname="mondorescue"
     22    export imgname="mondorescue"
    2323fi
    24 dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`
     24export dirimg=`grep nfs-server-path /tmp/mondo-restore.cfg | cut -d' ' -f2-`
    2525if [ "$dirimg" = "" ]; then
    26     dirimg="/"
     26    export dirimg="/"
    2727fi
    2828
     
    3131    echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`
    3232    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`
    33     echo $i | grep -qi nfsmount= && nfsmount=`echo $i | cut -d= -f2`
    34     echo $i | grep -qi prefix= && imgname=`echo $i | cut -d= -f2`
     33    echo $i | grep -qi nfsmount= && export nfsmount=`echo $i | cut -d= -f2`
     34    echo $i | grep -qi prefix= && export imgname=`echo $i | cut -d= -f2`
    3535done
    3636
     
    7373mount -t nfs -o nolock $nfsmount /tmp/isodir
    7474
    75 LogIt "Mounting NFS image $imgname-1.iso in $dirimg on /mnt/cdrom in loopback"
    76 losetup /dev/loop7 /tmp/isodir/$dirimg/$imgname-1.iso
     75LogIt "Mounting NFS image ${imgname}-1.iso in $dirimg on /mnt/cdrom in loopback"
     76losetup /dev/loop7 /tmp/isodir/$dirimg/${imgname}-1.iso
    7777mount -o ro -t iso9660 /dev/loop7 /mnt/cdrom
  • trunk/mondo/mondo/common/libmondo-devices.c

    r795 r808  
    18231823                    bkpinfo->media_size[i] = atoi(sz_size);
    18241824                }
    1825                 paranoid_free(sz_size);
    1826 
    1827                 if (!popup_and_get_string
    1828                     (_("Prefix."),
    1829                      _("Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files"),
    1830                      bkpinfo->prefix)) {
    1831                     log_to_screen("User has chosen not to backup the PC");
    1832                     finish(1);
    1833                 }
    1834                 log_msg(3, "prefix set to %s", bkpinfo->prefix);
    18351825            } else {
    18361826                for (i = 0; i <= MAX_NOOF_MEDIA; i++) {
     
    18391829            }
    18401830        }
     1831        if (!popup_and_get_string
     1832            ("Prefix.",
     1833             "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files",
     1834             bkpinfo->prefix, MAX_STR_LEN / 4)) {
     1835            log_to_screen("User has chosen not to backup the PC");
     1836            finish(1);
     1837        }
     1838        log_msg(3, "prefix set to %s", bkpinfo->prefix);
    18411839        break;
    18421840    default:
  • trunk/mondo/mondo/common/libmondo-fifo.c

    r795 r808  
    158158    sync();
    159159    asprintf(&command,
    160             "ps | grep -F \"%s\" | grep -Fv grep | awk '{print $1;}' | grep -v PID | tr -s '\n' ' ' | awk '{ print $1; }'", ps_options,
     160            "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $1;}' | grep -v PID | tr -s '\n' ' ' | awk '{ print $1; }'", ps_options,
    161161            g_sz_call_to_buffer);
    162162    paranoid_free(g_sz_call_to_buffer);
  • trunk/mondo/mondo/common/libmondo-files.c

    r783 r808  
    10271027    /*@ buffers ******** */
    10281028    char *nfs_dev = NULL;
     1029    char *mac_addr = NULL;
    10291030    char *nfs_mount = NULL;
    10301031    char *nfs_client_ipaddr = NULL;
     
    10511052
    10521053    asprintf(&nfs_mount, p);
     1054    /* BERLIOS : there is a bug #67 here as it only considers the first NIC */
    10531055    asprintf(&command,
    10541056            "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\n' | head -n1 | cut -d' ' -f1");
     
    10881090    }
    10891091    make_hole_for_dir("/var/cache/mondo-archive");
     1092    /********
     1093    * If the NFS device that found above is a bonded device,
     1094    * we need to replace it with an ethN device or the
     1095    * networking will not start during an NFS restore.
     1096    *
     1097    * If the NFS device in nfs_dev begins with the word "bond",
     1098    * look for the corresponding slave ethN device and copy it to nfs_dev.
     1099    * Using the common MAC address
     1100    ********/
     1101    if (!strncmp(nfs_dev, "bond", 4)) {
     1102        log_to_screen("Found bonding device %s; looking for corresponding ethN slave device\n", nfs_dev);
     1103        asprintf(&command,
     1104                "ifconfig %s | awk '{print $5}'", nfs_dev);
     1105        mac_addr = call_program_and_get_last_line_of_output(command);
     1106        asprintf(&command,
     1107                "ifconfig | grep -E '%s' | head -n1  | cut -d' ' -f1", mac_addr);
     1108        paranoid_free(nfs_dev);
     1109        nfs_dev = call_program_and_get_last_line_of_output(command);
     1110        paranoid_free(command);
     1111        paranoid_free(mac_addr);
     1112
     1113        log_to_screen("Replacing it with %s\n", nfs_dev);
     1114    }
    10901115
    10911116    asprintf(&tmp, "%s/NFS-DEV", bkpinfo->tmpdir);
  • trunk/mondo/mondo/common/newt-specific.c

    r795 r808  
    240240char *tmp = NULL;
    241241
    242 asprintf(&tmp,"kill `ps %s | grep \"" %s "\" | awk '{print $1;}' | grep -vx \"\\?\"`", ps_options, str);
     242asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print $1;}' | grep -vx \"\\?\"`", ps_options, str);
    243243run_program_and_log_output(tmp, TRUE);
    244244paranoid_free(tmp);
  • trunk/mondo/mondo/mondoarchive/main.c

    r794 r808  
    167167    /* Initialize Configuration Structure */
    168168    mr_archive_init_conf(bkpinfo->mr_conf);
    169 
     169    log_msg(0, "Start date : %s", get_time());
    170170
    171171    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
     
    182182    unlink(MONDO_LOGFILE);
    183183
    184 /* Configure the bkpinfo structure, global file paths, etc. */
     184    /* Configure the bkpinfo structure, global file paths, etc. */
    185185    g_main_pid = getpid();
    186186    log_msg(9, "This");
     
    417417
    418418    run_program_and_log_output("date", 1);
     419    log_msg(0, "End date : %s", get_time());
    419420
    420421    if (!g_text_mode) {
  • trunk/mondo/mondo/mondoarchive/mondo-cli.c

    r783 r808  
    512512            if (q != NULL) {
    513513                *q = '\0';
     514                /* Fix bug 14 where ending / cause a problem later
     515                 * so handled here for the moment */
     516                q--;
     517                if (*q = '/') {
     518                    *q = '\0';
     519                }
     520                q++;
     521                /* End of bug fix */
    514522                if (stat(p, &buf) != 0) {
    515523                    log_msg(1, "WARNING ! %s doesn't exist", p);
  • trunk/mondo/mondo/mondorestore/mondo-restore.c

    r794 r808  
    29192919        paranoid_MR_finish(retval);
    29202920    } else {
    2921 /* Disaster recovery mode (must be) */
     2921        /* Disaster recovery mode (must be) */
    29222922        log_msg(1, "I must be in disaster recovery mode.");
    29232923        log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r794 r808  
    851851                paranoid_alloc(bkpinfo->prefix, STD_PREFIX);
    852852            }
     853            /* We need to override prefix value in PXE mode as it's
     854             * already done in start-nfs */
     855            if (strstr(call_program_and_get_last_line_of_output
     856               ("cat /proc/cmdline"), "pxe")) {
     857                    strcpy(bkpinfo->prefix,getenv("imgname"));
     858            }
     859
    853860        } else if (!strcmp(value, "tape")) {
    854861            bkpinfo->backup_media_type = tape;
     
    975982            log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    976983        }
     984        /* We need to override values in PXE mode as it's
     985         * already done in start-nfs */
     986        if (strstr(call_program_and_get_last_line_of_output
     987           ("cat /proc/cmdline"), "pxe")) {
     988                strcpy(bkpinfo->nfs_mount,getenv("nfsmount"));
     989                strcpy(bkpinfo->nfs_remote_dir,getenv("dirimg"));
     990            }
    977991    } else if (bkpinfo->backup_media_type == iso) {
    978992        /* Patch by Conor Daly 23-june-2004
     
    10371051                    } else {
    10381052                        log_msg(1,
    1039                                 "You backed up to disk, then burned some CDs. Naughty monkey!");
     1053                                "You backed up to disk, then burned some CDs.");
    10401054                    }
    10411055                }
     
    23852399
    23862400    assert(wait_for_percentage <= 100);
    2387     iamhere("Help, my boat is sync'ing. (Get it? Urp! Urp!)");
     2401    iamhere("wait_until_software_raids_are_prepped");
    23882402    while (unfinished_mdstat_devices > 0) {
    23892403        if (parse_mdstat(raidlist, "/dev/")) {
Note: See TracChangeset for help on using the changeset viewer.