Changeset 2607 in MondoRescue


Ignore:
Timestamp:
Mar 22, 2010, 1:56:46 PM (14 years ago)
Author:
Bruno Cornec
Message:

r3763@localhost: bruno | 2010-03-18 12:03:49 +0100

  • Fix CMDLINE variable initialization to do it after /proc is mounted
  • Fix backup-media-type handling in mondorestore (wrong test)
Location:
branches/2.2.10
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mindi/rootfs/sbin/init

    r2603 r2607  
    77
    88export MINDI_CACHE=CCC
    9 
    10 if [ -e "/proc/cmdline" ]; then
    11     export CMDLINE="/proc/cmdline"
    12 elif [ -e "/tmp/cmdline" ]; then
    13     export CMDLINE="/tmp/cmdline"
    14 else
    15     export CMDLINE="/dev/null"
    16 fi
    17 
    189
    1910
     
    721712#/bin/update
    722713mount /proc/ /proc -v -t proc
     714
     715# Now we can look at command line
     716if [ -e "/proc/cmdline" ]; then
     717    # Linux
     718    export CMDLINE="/proc/cmdline"
     719elif [ -e "/tmp/cmdline" ]; then
     720    # BSD ?
     721    export CMDLINE="/tmp/cmdline"
     722else
     723    export CMDLINE="/dev/null"
     724fi
     725
    723726mkdir /sys 2> /dev/null
    724727mount /sys/ /sys -v -t sysfs 2>> $LOGFILE
     
    891894
    892895fi
    893 if [ -f $MINDI_CACHE/mondorestore.cfg ] && [ grep "backup-media-type" $MINDI_CACHE/mondorestore.cfg > /dev/null 2> /dev/null ]; then
    894     LogIt "backup-media-type is specified in config file - great."
    895     LogIt "Calling post-init"
    896     # start-netfs moved it under /tmp as the NFS share is already unmounted
    897     if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
    898         pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
    899     fi
    900     if [ -x $pre ]; then
    901         echo "Executing preliminary script $pre"
    902         LogIt "Executing preliminary script $pre"
    903         $pre
    904     fi
    905     post-init
     896if [ -f $MINDI_CACHE/mondorestore.cfg ]; then
     897    grep -q "backup-media-type" $MINDI_CACHE/mondorestore.cfg
     898    if [ $? -eq 0 ]; then
     899        LogIt "backup-media-type is specified in config file - great."
     900        LogIt "Calling post-init"
     901        # start-netfs moved it under /tmp as the NFS share is already unmounted
     902        if [ "`echo $pre | grep -E '^/tmp/isodir'`" ]; then
     903            pre=`echo $pre | sed 's|^/tmp/isodir|/tmp|'`
     904        fi
     905        if [ -x $pre ]; then
     906            echo "Executing preliminary script $pre"
     907            LogIt "Executing preliminary script $pre"
     908            $pre
     909        fi
     910        post-init
     911    else
     912        LogIt "backup-media-type is not specified in config file."
     913        LogIt "I think this media has no archives on it."
     914    fi
    906915else
    907     LogIt "backup-media-type is not specified in config file."
     916    LogIt "$MINDI_CACHE/mondorestore.cfg not found."
    908917    LogIt "I think this media has no archives on it."
    909918fi
  • branches/2.2.10/mondo/src/common/libmondo-fork.c

    r2546 r2607  
    6666            log_msg(9, "Loop result: ***%s***", tmp);
    6767            */
    68             /*  There is empty contant at the end of the file that needs to be skiped */
     68            /*  There is empty content at the end of the file that needs to be skiped */
    6969            if (strlen(tmp) > 0) {
    7070                mr_free(result);
     
    7373            mr_free(tmp);
    7474        }
    75         log_msg(4, "Result: %s", result);
     75        log_msg(9, "Pre-Result: %s", result);
    7676        mr_strip_spaces(result);
    7777        paranoid_pclose(fin);
     
    8080    }
    8181    mr_free(tmpf);
     82    log_msg(4, "Result: %s", result);
    8283    return(result);
    8384}
    84 
    85 
    86 
    87 
    88 
    8985
    9086#define MONDO_POPMSG  "Your PC will not retract the CD tray automatically. Please call mondoarchive with the -m (manual CD tray) flag."
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2510 r2607  
    10351035 * @param label What to read from the file.
    10361036 * @param value Where to put it.
    1037  * @return 0 for success, 1 for failure.
     1037 * @return value of the param or NULL if not found
    10381038 */
    10391039char *read_cfg_var(char *config_file, char *label)
     
    10501050        log_to_screen("(read_cfg_var) Cannot find %s config file", config_file);
    10511051        return (NULL);
    1052         /* BERLIOS: not sure the usage of this one ?
    1053     } else if ((value != NULL) && (strstr(value, "/dev/") && strstr(value, "t0") && !strcmp(label, "media-dev"))) {
    1054         log_msg(2, "FYI, I can't read new value for %s - already got %s", label, value);
    1055         return (0);
    1056         */
    10571052    } else {
    10581053        mr_asprintf(command, "grep '%s .*' %s| cut -d' ' -f2,3,4,5", label, config_file);
     
    10601055        mr_free(command);
    10611056
     1057        log_msg(4, "Configuration item %s is %s", label, value);
    10621058        if (strlen(value) == 0) {
    10631059            return (NULL);
  • branches/2.2.10/mondo/src/mondorestore/mondo-rstr-tools.c

    r2508 r2607  
    709709media_specified_by_user = bkpinfo->backup_media_type;   // or 'none', if not specified
    710710
    711 if ((value = read_cfg_var(cfg_file, "backup-media-type")) == 0) {
     711if ((value = read_cfg_var(cfg_file, "backup-media-type")) != NULL) {
    712712    if (!strcmp(value, "cdstream")) {
    713713        bkpinfo->backup_media_type = cdstream;
Note: See TracChangeset for help on using the changeset viewer.