Changeset 3107 in MondoRescue


Ignore:
Timestamp:
May 5, 2013, 4:23:30 AM (11 years ago)
Author:
Bruno Cornec
Message:
 
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/README.pxe

    r3098 r3107  
    1111label mondo
    1212        kernel vmlinuz-mondo
    13         append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 selinux=0 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs|smbfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [hwaddr=M:A:C:A:D:R] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ...
     13        append initrd=initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=131072 selinux=0 rw root=/dev/ram iso acpi=off apm=off devfs=nomount exec-shield=0 pxe [proto=nfs|sshfs] [prefix=machine] [ipconf=(ipdev:ipadr:netmask:broadcast:gateway|ipdev:dhcp)] [hwaddr=M:A:C:A:D:R] [netfsmount=server:mountpoint] [netfsopt=-o option][netfspath=local_path] [ping=#] ...
    1414
    1515ipdev is the device name (e.g. eth2)
     
    2020dhcp is a keyword. Using it will provide all the previous 4 values to activate the LAN interface.
    2121hwaddr is the MAC address of the device you want to use to restore through
    22 proto is the protocol to use for mounting the remote share (default is NFS, sshfs and smbfs are also available)
     22proto is the protocol to use for mounting the remote share (default is NFS, sshfs is also available)
    2323server is the ip addr of the Remote Network server
    2424mountpoint is the mount point on the Remote Network server to use (if NFS, should be in /etc/exports of the NFS server)
  • branches/3.0/mindi/mindi

    r3103 r3107  
    756756
    757757    # say where we are.
    758     LogFile "INFO: GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"
     758    LogFile "INFO:   GetInitrdFilesystemToUse(): called with parameter: $lvKernelImage"
    759759
    760760    # verify that file exists
    761761    [ ! -f $lvKernelImage ] && Die "File $lvKernelImage not found. Terminating."
    762762
    763     # Kernel may be gzip compressed - Case of RHEL5 - SLES11SP1
     763    # Kernel may be gzip compressed
    764764    file $lvKernelImage 2>&1 | grep -q gzip
    765765    if [ $? -eq 0 ]; then
    766         LogFile "INFO: Found a gzip compressed kernel $lvKernelImage"
    767         lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null`
    768     else
    769         LogFile "INFO: Found a non gzip compressed kernel $lvKernelImage"
    770         # kernel is x86 boot sector in RHEL3/4 with embedded gzip content
    771         # get offet of gzip magic "1f8b0800" in file (for these older kernels)
    772         lvOffset=`od -vA n -t x1 $lvKernelImage | tr -d '[:space:]' | awk '{ print match($0, "1f8b0800")}' 2> /dev/null`
    773         if [ $lvOffset -eq 0 ]; then
    774             LogFile "INFO: gzip magic not found in file $lvKernelImage. Supposing initramfs."
    775             lvScanRes=$lcMagicInitfs
     766        lvScanRes=`gzip -cd $lvKernelImage | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs"`
     767
     768        # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs
     769        if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then
     770            lvUseFilesystem="ext2fs"
     771        elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then
     772            lvUseFilesystem="ext3fs"
     773        elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then
     774            lvUseFilesystem="initramfs"
     775        elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then
     776            lvUseFilesystem="cramfs"
    776777        else
    777             lvOffset=`expr $lvOffset / 2`
    778             LogFile "INFO: GetInitrdFilesystemToUse(): gzip magic found at lvOffset $lvOffset."
    779             # scan again  kernel image
    780             lvScanRes=`dd ibs=1 skip=$lvOffset if=$lvKernelImage obs=1M 2>/dev/null | gunzip -c 2> /dev/null | strings | grep -E "$lcMagicCramfs|$lcMagicExt2fs|$lcMagicExt3fs|$lcMagicInitfs" 2> /dev/null`
    781         fi
    782     fi
    783 
    784     # determine which filesystem to use for initrd image: ext2|3fs, gzip'ed cpio (initramfs) or cramfs
    785     if [ `echo $lvScanRes | grep -Ec "$lcMagicExt2fs"` -eq 1 ]; then
    786         lvUseFilesystem="ext2fs"
    787     elif [ `echo $lvScanRes | grep -Ec "$lcMagicExt3fs"` -eq 1 ]; then
    788         lvUseFilesystem="ext3fs"
    789     elif [ `echo $lvScanRes | grep -Ec "$lcMagicInitfs"` -eq 1 ]; then
     778            lvUseFilesystem="UNSUPPORTED"
     779        fi
     780
     781    else
     782        # In that case, we are after 2.6.30 and use the supported initramfs
    790783        lvUseFilesystem="initramfs"
    791     elif [ `echo $lvScanRes | grep -Ec "$lcMagicCramfs"` -eq 1 ]; then
    792         lvUseFilesystem="cramfs"
    793     else
    794         # In that case, we are most probably after 2.6.30 and use the supported initramfs
    795         LogFile "No automatic detection found previously. Supposing initramfs."
    796         LogFile "Report on the MondoRescue mailing-list withyour log files"
    797         lvUseFilesystem="initramfs"
    798     fi
    799 
     784    fi
    800785    # say what we are using
    801     LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem."
     786    LogFile "INFO:   GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem."
    802787
    803788    # return file system to use
     
    937922    file="$1"
    938923
    939     while [ `echo $file | grep -Ec '\.\./'` -ne 0 ]; do
     924    echo $file | grep -q '\.\./'
     925    if [ $? -eq 0 ]; then
    940926        # We need to normalise the path with .. in it
    941         file=`echo $file | perl -pi -e 's|([^/]*)/([^/]+)/\.\./([^/]+)|$1/$3|g'`
    942     done
     927        file=`echo $file | perl -pi -e 's|([^/]+)/([^/]+)/\.\./([^/]+)|$1/$3|'`
     928    fi
    943929    echo "$file"
    944930    if [ ! -h $file ]; then
     
    18181804    for i in $options ; do
    18191805        ooo=$i
    1820         [ "$ooo" = "RESTORE" ] && ooo="RESTORE nuke"
     1806        [ "$ooo" = "RESTORE" ] && ooo="nuke"
    18211807        if [ "$type" = "elilo" ]; then
    18221808            outstr="image=/vmlinuz\n\tlabel=$i\n\tinitrd=/initrd.img\n\troot=/dev/ram0 append=\" rw ramdisk_size=$ramdisk_size $ooo $MINDI_ADDITIONAL_BOOT_PARAMS \"\n"
     
    26022588        fi
    26032589    done
    2604     tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log
     2590    tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "ERROR: Problem in minimal analysis" $MINDI_TMP/$$.log
    26052591
    26062592    # To improve support for distribution scripts, we now prefer to use bash as the std shell. Also fixes #600
     
    32453231
    32463232for i in loop cdrom ide-cd isofs linear raid0 raid1 raid5 ; do
    3247     modinfo $i 2> /dev/null 1> /dev/null
     3233    modinfo 2> /dev/null 1> /dev/null
    32483234    if [ $? -eq 0 ]; then
    32493235        modprobe $i 2>&1 > /dev/null
  • branches/3.0/mindi/rootfs/sbin/start-netfs

    r3098 r3107  
    104104        ln -sf /dev/console /dev/tty
    105105        sshfs -o ro,StrictHostKeyChecking=no $netfsopt $netfsmount /tmp/isodir
    106     elif [ "$proto" = "smbfs" ]; then
    107         LogIt "Mounting SMBFS share ($netfsmount) on /tmp/isodir..."
    108         mount -t cifs $netfsopt $netfsmount /tmp/isodir -o ro
    109106    elif [ "$proto" != "" ]; then
    110107        if [ -x /sbin/rpcbind ]; then
  • branches/3.0/mondo-doc/mondoarchive.8

    r3098 r3107  
    127127and mondoarchive will try to do its best to support it.
    128128Other protocols are available such as sshfs for fuse SSH based filesystem
    129 mount, with the same syntax e.g. 'sshfs://user@192.168.1.3:/home/nfs' and
    130 smbfs (aka cifs) for SaMBa or Windows based filesystem mount.
     129mount, with the same syntax e.g. 'sshfs://user@192.168.1.3:/home/nfs'
    131130
    132131.TP
  • branches/3.0/mondo-doc/mondorescue-howto.sgml

    r3096 r3107  
    324324        If you want to backup the whole computer (excluding /sys, /run and /proc,
    325325        naturally as well as /tmp) then leave this as / which is the default. Otherwise,
    326 specify subsets, (e.g. /usr/local|/home ) being sure to put a pipe
     326specify subsets, (e.g. /usr/local /home ) being sure to put a space
    327327in between each path.
    328328</entry>
     
    338338If you are backing up your whole computer then you might want to
    339339exclude certain directories, e.g. /shared/MP3. Please specify them
    340 in the 'exclude directories' dialog box. Please put a pipe in
    341 between each path, e.g. /shared/private|/scratch|/nfs|/windows
     340in the 'exclude directories' dialog box. Please put a space in
     341between each path, e.g. /shared/private /scratch /nfs /windows
    342342</entry>
    343343</row>
  • branches/3.0/mondo/src/common/libmondo-cli.c

    r3098 r3107  
    536536                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    537537                    sprintf(tmp, "sshfs %s@%s", bkpinfo->netfs_user, bkpinfo->netfs_mount);
    538                 } else if (strstr(bkpinfo->netfs_proto, "smbfs")) {
    539                     sprintf(tmp, "mount -t cifs %s -o user=%s", bkpinfo->netfs_mount, bkpinfo->netfs_user);
    540538                } else if (strstr(bkpinfo->netfs_proto, "nfs")) {
    541539                    sprintf(tmp, "mount %s@%s", bkpinfo->netfs_user, bkpinfo->netfs_mount);
     
    547545                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    548546                    sprintf(tmp, "sshfs %s", bkpinfo->netfs_mount);
    549                 } else if (strstr(bkpinfo->netfs_proto, "smbfs")) {
    550                     sprintf(tmp, "mount -t cifs %s", bkpinfo->netfs_mount);
    551547                } else if (strstr(bkpinfo->netfs_proto, "nfs")) {
    552548                    sprintf(tmp, "mount %s", bkpinfo->netfs_mount);
  • branches/3.0/mondo/src/common/libmondo-devices.c

    r3099 r3107  
    21742174{
    21752175    char *tmp = NULL;
    2176     char *tmpro = NULL;
    21772176    char *tmp1 = NULL;
    21782177    char *mds = NULL;
     
    25292528        strcpy(tmp1, bkpinfo->netfs_proto);
    25302529        if (!popup_and_get_string
    2531             ("Network protocol", "Which protocol should I use (nfs/sshfs/smbfs) ?",
     2530            ("Network protocol", "Which protocol should I use (nfs/sshfs) ?",
    25322531             tmp1, MAX_STR_LEN)) {
    25332532            log_to_screen("User has chosen not to backup the PC");
     
    25682567            sprintf(command, "mkdir -p %s", bkpinfo->isodir);
    25692568            run_program_and_log_output(command, 5);
    2570 
    25712569            if (bkpinfo->restore_data) {
    2572                 /*  mount th FS read-only in restore mode to avoid any erase of whatever */
    2573                 mr_asprintf(&tmpro, "-o ro");
     2570                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
     2571                    mr_asprintf(&tmp, "sshfs -o ro");
     2572                } else {
     2573                    mr_asprintf(&tmp, "mount -t %s -o nolock,ro", bkpinfo->netfs_proto);
     2574                }
    25742575            } else {
    2575                 mr_asprintf(&tmpro, "");
    2576             }
    2577 
    2578             /*  Build the mount string */
    2579             if (strstr(bkpinfo->netfs_proto, "smbfs")) {
    2580                 mr_asprintf(&tmp, "mount -t cifs %s %s %s",bkpinfo->netfs_mount, bkpinfo->isodir,tmpro);
    2581                 if (bkpinfo->netfs_user) {
    2582                     mr_strcat(tmp, " -o user=%s", bkpinfo->netfs_user);
     2576                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
     2577                    mr_asprintf(&tmp, "sshfs");
     2578                } else {
     2579                    mr_asprintf(&tmp, "mount -t %s -o nolock", bkpinfo->netfs_proto);
    25832580                }
    2584             else {
    2585                 if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    2586                     mr_asprintf(&tmp, "sshfs %s ",tmpro);
    2587                 } else {
    2588                     mr_asprintf(&tmp, "mount -t %s -o nolock %s ", bkpinfo->netfs_proto,tmpro);
    2589                 }
    2590                 if (bkpinfo->netfs_user) {
    2591                     mr_strcat(tmp, "%s@", bkpinfo->netfs_user);
    2592                 }
    2593                 mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir);
    2594             }
     2581            }
     2582            mr_strcat(tmp, " ");
     2583            if (bkpinfo->netfs_user) {
     2584                mr_strcat(tmp, "%s@", bkpinfo->netfs_user);
     2585            }
     2586            mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir);
    25952587            run_program_and_log_output(tmp, 3);
    25962588            mr_free(tmp);
     
    25982590            malloc_string(g_selfmounted_isodir);
    25992591            strcpy(g_selfmounted_isodir, bkpinfo->isodir);
    2600             }
    26012592        }
    26022593        if (!is_this_device_mounted(bkpinfo->netfs_mount)) {
  • branches/3.0/mondo/src/mondorestore/mondorestore.c

    r3098 r3107  
    31343134                            bkpinfo->netfs_mount);
    31353135                    }
    3136                 } else  {
    3137                     if (strstr(bkpinfo->netfs_proto, "smbfs")) {
    3138                         if (bkpinfo->netfs_user) {
    3139                             sprintf(tmp, "mount -t cifs %s /tmp/isodir -o user=%s,nolock,ro ",
    3140                                 bkpinfo->netfs_mount,bkpinfo->netfs_user);
    3141                         } else {
    3142                             sprintf(tmp, "mount -t cifs %s /tmp/isodir -o nolock,ro ",
    3143                                 bkpinfo->netfs_mount);
    3144                         }
     3136                } else {
     3137                    if (bkpinfo->netfs_user) {
     3138                        sprintf(tmp, "mount %s@%s -o nolock,ro /tmp/isodir",
     3139                            bkpinfo->netfs_user,bkpinfo->netfs_mount);
    31453140                    } else {
    3146                         if (bkpinfo->netfs_user) {
    3147                             sprintf(tmp, "mount %s@%s -o nolock,ro /tmp/isodir",
    3148                                 bkpinfo->netfs_user,bkpinfo->netfs_mount);
    3149                         } else {
    3150                             sprintf(tmp, "mount %s -o nolock,ro /tmp/isodir",
    3151                                 bkpinfo->netfs_mount);
    3152                         }
     3141                        sprintf(tmp, "mount %s -o nolock,ro /tmp/isodir",
     3142                            bkpinfo->netfs_mount);
    31533143                    }
    31543144                }
  • branches/3.0/mondo/test/Makefile.am

    r3100 r3107  
    22
    33## The program
    4 sbin_PROGRAMS         = mrtest_mountlist mrtest_truncname mrtest_stresc
     4sbin_PROGRAMS         = mrtest_mountlist mrtest_truncname
    55mrtest_mountlist_SOURCES  = test-mountlist.c ${top_builddir}/src/mondorestore/mondo-prep.c ${top_builddir}/src/mondorestore/mondo-rstr-newt.c ${top_builddir}/src/mondorestore/mondo-rstr-tools.c
    66mrtest_mountlist_LDADD    = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@
    77mrtest_truncname_SOURCES  = test-truncname.c ${top_builddir}/src/common/libmondo-string.c
    88mrtest_truncname_LDADD    = ${top_builddir}/src/common/libmondo.a ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@
    9 mrtest_stresc_SOURCES     = test-mr_stresc.c
    10 mrtest_stresc_LDADD       = ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@
  • branches/3.0/website/mondorescue.org.conf

    r3104 r3107  
    3434    </Directory>
    3535
    36 </VirtualHost>
    37 
    38 <VirtualHost 10.3.252.23>
    39     ServerName ftp.mondorescue.org
    40     ServerAdmin webmaster@mondorescue.org
    41     DocumentRoot /prj/www/html/mondorescue
    42     CustomLog /var/log/httpd/www.mondorescue.org/access_log combined
    43     Errorlog /var/log/httpd/www.mondorescue.org/error_log
    44     RewriteEngine On
    45     RewriteRule     ^/index\.html$  /index.shtml
    46     RewriteRule     ^/$  /index.shtml
    47 
    48     <Directory "/prj/www/html/mondorescue">
    49     DirectoryIndex index.shtml
    50         Options -Indexes MultiViews FollowSymLinks +Includes
    51         AllowOverride None
    52         Order allow,deny
    53         Allow from all
    54     </Directory>
    55 
    56     <Directory "/prj/www/html/mondorescue/ftp">
    57         Options Indexes MultiViews FollowSymLinks
    58         AllowOverride None
    59         Order allow,deny
    60         Allow from all
    61     </Directory>
    6236</VirtualHost>
    6337
     
    139113    CustomLog /var/log/httpd/www.mondorescue.com/access_log combined
    140114    Errorlog /var/log/httpd/www.mondorescue.com/error_log
    141     RewriteEngine On
    142     RewriteRule     ^/index\.html$  /index.shtml
    143     RewriteRule     ^/$  /index.shtml
    144115    <Directory "/prj/www/html/mondorescue">
    145116    DirectoryIndex index.shtml
     
    157128
    158129</VirtualHost>
    159 
    160 <VirtualHost 10.3.252.23>
    161     ServerName ftp.mondorescue.com
    162     ServerAdmin webmaster@mondorescue.com
    163     DocumentRoot /prj/www/html/mondorescue
    164     CustomLog /var/log/httpd/www.mondorescue.com/access_log combined
    165     Errorlog /var/log/httpd/www.mondorescue.com/error_log
    166     RewriteEngine On
    167     RewriteRule     ^/index\.html$  /index.shtml
    168     RewriteRule     ^/$  /index.shtml
    169     <Directory "/prj/www/html/mondorescue">
    170     DirectoryIndex index.shtml
    171         Options -Indexes MultiViews FollowSymLinks +Includes
    172         AllowOverride None
    173         Order allow,deny
    174         Allow from all
    175     </Directory>
    176     <Directory "/prj/www/html/mondorescue/ftp">
    177         Options Indexes MultiViews FollowSymLinks
    178         AllowOverride None
    179         Order allow,deny
    180         Allow from all
    181     </Directory>
    182 
    183 </VirtualHost>
  • devel/mr/Makefile.PL

    r3102 r3107  
    115115        $text .= "\t".'cp etc/PBPROJ.conf $(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist ; install -m 755 -d ".' $(DESTDIR)'."$mandir/man5 ; pod2man etc/PBPROJ.conf > ".'$(DESTDIR)'."$mandir/man5/PBPROJ.conf.5\n";
    116116        $text .= "\t".'md5sum $(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist > ".'$(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf.dist.md5\n";
    117         $text .= "\t".'if [ ! -f "'.'$(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf".'" ]; then echo "# Local configuration file for Mondorescue" > $(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf".'; echo "# Adapt content taken from the distribution conf file PBPROJ.conf.dist which should remain untouched" >> $(DESTDIR)'."$confdir/PBPROJ/PBPROJ.conf ; fi\n";
    118117        $text .= "\t".'cp lib/MondoRescue/DynConf.pm $(DESTDIR)/$(VENDORLIBEXP)/MondoRescue/'."\n";
    119118
  • devel/mr/etc/mondorescue.conf

    r3101 r3107  
    3232mr_proc_devices linux = /proc/devices
    3333mr_proc_meminfo linux = /proc/meminfo
     34mr_proc_version linux = /proc/version
    3435mr_proc_mounts linux = /proc/mounts
    3536mr_proc_misc linux = /proc/misc
Note: See TracChangeset for help on using the changeset viewer.