Changeset 3098


Ignore:
Timestamp:
Apr 26, 2013, 8:08:45 PM (6 years ago)
Author:
bruno
Message:
  • Add cifs support for #208 with first modifications to add cifs support as an external FS
Location:
branches/3.0
Files:
6 edited

Legend:

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

    r3036 r3098  
    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/rootfs/sbin/start-netfs

    r2951 r3098  
    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

    r3068 r3098  
    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/src/common/libmondo-cli.c

    r3060 r3098  
    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

    r3062 r3098  
    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);
  • branches/3.0/mondo/src/mondorestore/mondorestore.c

    r3060 r3098  
    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                }
Note: See TracChangeset for help on using the changeset viewer.