Changeset 3111 in MondoRescue


Ignore:
Timestamp:
May 5, 2013, 4:55:42 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • revert patch 3106-2107 from SVK which had removed good code and fixes !!
Files:
1 added
12 edited

Legend:

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

    r3107 r3111  
    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] [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|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=#] ...
    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 is also available)
     22proto is the protocol to use for mounting the remote share (default is NFS, sshfs and smbfs are 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

    r3107 r3111  
    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
     763    # Kernel may be gzip compressed - Case of RHEL5 - SLES11SP1
    764764    file $lvKernelImage 2>&1 | grep -q gzip
    765765    if [ $? -eq 0 ]; then
    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"
     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
    777776        else
    778             lvUseFilesystem="UNSUPPORTED"
    779         fi
    780 
    781     else
    782         # In that case, we are after 2.6.30 and use the supported initramfs
     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
    783790        lvUseFilesystem="initramfs"
    784     fi
     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
    785800    # say what we are using
    786     LogFile "INFO:   GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem."
     801    LogFile "INFO: GetInitrdFilesystemToUse(): Filesytem to use for initial ram disk is $lvUseFilesystem."
    787802
    788803    # return file system to use
     
    922937    file="$1"
    923938
    924     echo $file | grep -q '\.\./'
    925     if [ $? -eq 0 ]; then
     939    while [ `echo $file | grep -Ec '\.\./'` -ne 0 ]; do
    926940        # We need to normalise the path with .. in it
    927         file=`echo $file | perl -pi -e 's|([^/]+)/([^/]+)/\.\./([^/]+)|$1/$3|'`
    928     fi
     941        file=`echo $file | perl -pi -e 's|([^/]*)/([^/]+)/\.\./([^/]+)|$1/$3|g'`
     942    done
    929943    echo "$file"
    930944    if [ ! -h $file ]; then
     
    18041818    for i in $options ; do
    18051819        ooo=$i
    1806         [ "$ooo" = "RESTORE" ] && ooo="nuke"
     1820        [ "$ooo" = "RESTORE" ] && ooo="RESTORE nuke"
    18071821        if [ "$type" = "elilo" ]; then
    18081822            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"
     
    25882602        fi
    25892603    done
    2590     tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "ERROR: Problem in minimal analysis" $MINDI_TMP/$$.log
     2604    tar cf - $finallist 2>> $MINDI_TMP/$$.log | tar xUf - || LogIt "WARNING: Problem in minimal analysis" $MINDI_TMP/$$.log
    25912605
    25922606    # To improve support for distribution scripts, we now prefer to use bash as the std shell. Also fixes #600
     
    32313245
    32323246for i in loop cdrom ide-cd isofs linear raid0 raid1 raid5 ; do
    3233     modinfo 2> /dev/null 1> /dev/null
     3247    modinfo $i 2> /dev/null 1> /dev/null
    32343248    if [ $? -eq 0 ]; then
    32353249        modprobe $i 2>&1 > /dev/null
  • branches/3.0/mindi/rootfs/sbin/start-netfs

    r3107 r3111  
    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
    106109    elif [ "$proto" != "" ]; then
    107110        if [ -x /sbin/rpcbind ]; then
  • branches/3.0/mondo-doc/mondoarchive.8

    r3107 r3111  
    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'
     129mount, with the same syntax e.g. 'sshfs://user@192.168.1.3:/home/nfs' and
     130smbfs (aka cifs) for SaMBa or Windows based filesystem mount.
    130131
    131132.TP
  • branches/3.0/mondo-doc/mondorescue-howto.sgml

    r3107 r3111  
    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 space
     326specify subsets, (e.g. /usr/local|/home ) being sure to put a pipe
    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 space in
    341 between each path, e.g. /shared/private /scratch /nfs /windows
     340in the 'exclude directories' dialog box. Please put a pipe in
     341between each path, e.g. /shared/private|/scratch|/nfs|/windows
    342342</entry>
    343343</row>
  • branches/3.0/mondo/src/common/libmondo-cli.c

    r3107 r3111  
    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);
    538540                } else if (strstr(bkpinfo->netfs_proto, "nfs")) {
    539541                    sprintf(tmp, "mount %s@%s", bkpinfo->netfs_user, bkpinfo->netfs_mount);
     
    545547                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    546548                    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);
    547551                } else if (strstr(bkpinfo->netfs_proto, "nfs")) {
    548552                    sprintf(tmp, "mount %s", bkpinfo->netfs_mount);
  • branches/3.0/mondo/src/common/libmondo-devices.c

    r3107 r3111  
    21742174{
    21752175    char *tmp = NULL;
     2176    char *tmpro = NULL;
    21762177    char *tmp1 = NULL;
    21772178    char *mds = NULL;
     
    25282529        strcpy(tmp1, bkpinfo->netfs_proto);
    25292530        if (!popup_and_get_string
    2530             ("Network protocol", "Which protocol should I use (nfs/sshfs) ?",
     2531            ("Network protocol", "Which protocol should I use (nfs/sshfs/smbfs) ?",
    25312532             tmp1, MAX_STR_LEN)) {
    25322533            log_to_screen("User has chosen not to backup the PC");
     
    25672568            sprintf(command, "mkdir -p %s", bkpinfo->isodir);
    25682569            run_program_and_log_output(command, 5);
     2570
    25692571            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");
     2574            } 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);
     2583                }
     2584            else {
    25702585                if (strstr(bkpinfo->netfs_proto, "sshfs")) {
    2571                     mr_asprintf(&tmp, "sshfs -o ro");
     2586                    mr_asprintf(&tmp, "sshfs %s ",tmpro);
    25722587                } else {
    2573                     mr_asprintf(&tmp, "mount -t %s -o nolock,ro", bkpinfo->netfs_proto);
     2588                    mr_asprintf(&tmp, "mount -t %s -o nolock %s ", bkpinfo->netfs_proto,tmpro);
    25742589                }
    2575             } else {
    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);
     2590                if (bkpinfo->netfs_user) {
     2591                    mr_strcat(tmp, "%s@", bkpinfo->netfs_user);
    25802592                }
    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);
     2593                mr_strcat(tmp, "%s %s", bkpinfo->netfs_mount, bkpinfo->isodir);
     2594            }
    25872595            run_program_and_log_output(tmp, 3);
    25882596            mr_free(tmp);
     
    25902598            malloc_string(g_selfmounted_isodir);
    25912599            strcpy(g_selfmounted_isodir, bkpinfo->isodir);
     2600            }
    25922601        }
    25932602        if (!is_this_device_mounted(bkpinfo->netfs_mount)) {
  • branches/3.0/mondo/src/mondorestore/mondorestore.c

    r3107 r3111  
    31343134                            bkpinfo->netfs_mount);
    31353135                    }
    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);
     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                        }
    31403145                    } else {
    3141                         sprintf(tmp, "mount %s -o nolock,ro /tmp/isodir",
    3142                             bkpinfo->netfs_mount);
     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                        }
    31433153                    }
    31443154                }
  • branches/3.0/mondo/test/Makefile.am

    r3107 r3111  
    22
    33## The program
    4 sbin_PROGRAMS         = mrtest_mountlist mrtest_truncname
     4sbin_PROGRAMS         = mrtest_mountlist mrtest_truncname mrtest_stresc
    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@
     9mrtest_stresc_SOURCES     = test-mr_stresc.c
     10mrtest_stresc_LDADD       = ${top_builddir}/src/lib/libmr.a @MONDORESTORE_STATIC@
  • branches/3.0/website/mondorescue.org.conf

    r3107 r3111  
    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>
    3662</VirtualHost>
    3763
     
    113139    CustomLog /var/log/httpd/www.mondorescue.com/access_log combined
    114140    Errorlog /var/log/httpd/www.mondorescue.com/error_log
     141    RewriteEngine On
     142    RewriteRule     ^/index\.html$  /index.shtml
     143    RewriteRule     ^/$  /index.shtml
    115144    <Directory "/prj/www/html/mondorescue">
    116145    DirectoryIndex index.shtml
     
    128157
    129158</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

    r3107 r3111  
    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";
    117118        $text .= "\t".'cp lib/MondoRescue/DynConf.pm $(DESTDIR)/$(VENDORLIBEXP)/MondoRescue/'."\n";
    118119
  • devel/mr/etc/mondorescue.conf

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