Changeset 870 in MondoRescue


Ignore:
Timestamp:
Oct 3, 2006, 4:12:38 PM (18 years ago)
Author:
Bruno Cornec
Message:
  • Checks variables berfore getting them from env during restore
  • source start-nfs to get env. Var. correctly set for mondorestore
Location:
branches/stable
Files:
2 edited

Legend:

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

    r866 r870  
    458458    ExtractDataDisksAndLoadModules
    459459elif [ "`grep -i pxe /proc/cmdline`" ]; then
    460     /sbin/start-nfs
     460    # We need to get here exported variables from start-nfs
     461    . /sbin/start-nfs
    461462
    462463    # Simulate a local CD
     
    467468    HandleCDROMorFloppies
    468469    ExtractDataDisksAndLoadModules
    469     /sbin/start-nfs
     470    # We need to get here exported variables from start-nfs
     471    . /sbin/start-nfs
    470472fi
    471473res=$?
  • branches/stable/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r801 r870  
    973973{
    974974  /** add mallocs **/
    975     char *value;
    976     char *tmp;
    977     char *command;
    978     char *iso_mnt;
    979     char *iso_path;
    980     char *old_isodir;
     975    char *value = NULL;
     976    char *tmp = NULL;
     977    char *tmp1 = NULL;
     978    char *command = NULL;
     979    char *iso_mnt = NULL;
     980    char *iso_path = NULL;
     981    char *old_isodir = NULL;
    981982    char cfg_file[100];
    982983    t_bkptype media_specified_by_user;
     
    10461047            /* We need to override prefix value in PXE mode as it's
    10471048             * already done in start-nfs */
     1049            if (tmp = getenv("imgname") == NULL) {
     1050                fatal_error("no imgname variable in environment");
     1051            }
    10481052            if (strstr(call_program_and_get_last_line_of_output
    10491053               ("cat /proc/cmdline"), "pxe")) {
    1050                     strcpy(bkpinfo->prefix,getenv("imgname"));
     1054                    strcpy(bkpinfo->prefix,tmp);
    10511055            }
    10521056
     
    11601164        /* We need to override values in PXE mode as it's
    11611165         * already done in start-nfs */
     1166        if (tmp = getenv("nfsmount") == NULL) {
     1167            fatal_error("no nfsmount variable in environment");
     1168        }
     1169        if (tmp1 = getenv("dirimg") == NULL) {
     1170            fatal_error("no dirimg variable in environment");
     1171        }
    11621172        if (strstr(call_program_and_get_last_line_of_output
    11631173           ("cat /proc/cmdline"), "pxe")) {
    1164                 strcpy(bkpinfo->nfs_mount,getenv("nfsmount"));
    1165                 strcpy(bkpinfo->nfs_remote_dir,getenv("dirimg"));
     1174                strcpy(bkpinfo->nfs_mount,tmp);
     1175                strcpy(bkpinfo->nfs_remote_dir,tmp1);
    11661176            }
    11671177    } else if (bkpinfo->backup_media_type == iso) {
Note: See TracChangeset for help on using the changeset viewer.