Changeset 801


Ignore:
Timestamp:
Sep 22, 2006, 1:06:49 AM (13 years ago)
Author:
bruno
Message:

Should fix bug #21 by exporting variables from start-nfs and overriding values in mondo-rstr-tools.c with thee exports

Location:
branches/stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/rootfs/sbin/start-nfs

    r742 r801  
    33# $Id$
    44#
    5 # This script set up the network + NFS environement if needed.
     5# This script setup 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
  • branches/stable/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r799 r801  
    10441044                    strcpy(bkpinfo->prefix,STD_PREFIX);
    10451045            }
     1046            /* We need to override prefix value in PXE mode as it's
     1047             * already done in start-nfs */
     1048            if (strstr(call_program_and_get_last_line_of_output
     1049               ("cat /proc/cmdline"), "pxe")) {
     1050                    strcpy(bkpinfo->prefix,getenv("imgname"));
     1051            }
     1052
    10461053        } else if (!strcmp(value, "tape")) {
    10471054            bkpinfo->backup_media_type = tape;
     
    11511158            log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    11521159        }
     1160        /* We need to override values in PXE mode as it's
     1161         * already done in start-nfs */
     1162        if (strstr(call_program_and_get_last_line_of_output
     1163           ("cat /proc/cmdline"), "pxe")) {
     1164                strcpy(bkpinfo->nfs_mount,getenv("nfsmount"));
     1165                strcpy(bkpinfo->nfs_remote_dir,getenv("dirimg"));
     1166            }
    11531167    } else if (bkpinfo->backup_media_type == iso) {
    11541168        /* Patch by Conor Daly 23-june-2004
     
    12021216                    } else {
    12031217                        log_msg(1,
    1204                                 "You backed up to disk, then burned some CDs. Naughty monkey!");
     1218                                "You backed up to disk, then burned some CDs.");
    12051219                    }
    12061220                }
Note: See TracChangeset for help on using the changeset viewer.