[Galaxy S III Themes and Apps] mad_ady:
This Tasker App will allow you to mount and unmount NFS shares on your phone/tablet by using a simple GUI (a Tasker Scene). It is suitable for mounting multiple shares from the same server (only one server is supported), but it could be extended. It was inspired a little from Cifs Manager, but with much simpler functionality.

* Prerequisites:

- Tasker 4.2

- a kernel with NFS support (the task doesn't try to load the NFS module, so it must be loaded before).

root@android:/ # lsmod | grep nfs
nfs 336540 0 - Live 0x00000000
lockd 82761 1 nfs, Live 0x00000000
auth_rpcgss 34392 1 nfs, Live 0x00000000
sunrpc 194880 3 nfs,lockd,auth_rpcgss, Live 0x00000000

- a NFS-enabled busybox - if you run strings on it and grep for NFS it should list about 9 lines:

root@android:/ # strings /system/xbin/busybox | grep -i nfs | wc -l
9

- SuperSU v1.93 or later (it includes the --mount-master switchs which allows you to mount shares in android 4.2 or later and have them accessible in all processes (it can manipulate the master mount namespace)).

- ES File Explorer (optional)

* Installation:

- Unzip the zip somewhere in your phone.

- Copy NFS_Mounter.tsk.xml and NFS_Toggle.tsk.xml to /sdcard/Tasker/tasks

- Copy NFS_Mounter.scn.xml to /sdcard/Tasker/scenes

- Start Tasker, long-press the Tasks tab and select Import. Import both NFS* tasks

- In Tasker long-press the Scenes tab and select Import. Import the NFS_Mounter scene.

* Configuration

You will need to configure your interface with the shares that you have and the server, etc.

- Open Tasker -> Scenes -> NFS Mounter. Tap on the Items tab. Edit the items to suit your needs. You can add or delete items to suit your needs. The text label should be the share directory name (for instance, for a share 192.168.1.5:/DataVolume/Download you should only enter Download here).

- If you're not using ES File Explorer or you prefer a different file manager, you can edit it in the "Item long tap" tab.

- Go to Tasker -> Tasks -> NFS Toggle.

- Set the variable %busybox to the path of your NFS-enabled busybox (/sbin/busybox by default)

- Set the variable %destination to the path of the destination mount point (/mnt/nfs by default). Directories that don't exist will be created.

- Set the variable %server to the base path of your shares (e.g. 192.168.1.5:/DataVolume for the example above)

- Set the variable %opt with your desired mount options (by default it's read-only).

* Usage

You can start the GUI by running the NFS Mounter task. It will display a list (as visible in the screenshots) with your choices. When you tap a share, it will be mounted if it is unmounted and unmounted if it is mounted. If you long-tap that entry it will open the folder path in your file explorer.

You can create a desktop shortcut for this task in your launcher by creating a Shortcut -> Task Shortcut -> NFS Mounter.

* Tested on

This task/scene was tested on a Galaxy S3 running NeatRom 2.8 (SlimKat 2.8 variant (Android 4.4.2)) and with Boeffla-Kernel. It *should* work on other devices as well, since it is configurable and depends on system apps to do it's job.

* Commands issued

The task basically executes the following commands

#remount the root filesystem rw so that we can create the mountpoint
/sbin/busybox mount -o remount,rw /
#create the mountpoint
/sbin/busybox mkdir -p /mnt/nfs/Download
#make the mountpoint world readable so that all user apps can access it
/sbin/busybox chmod 777 /mnt/nfs
/sbin/busybox chmod 777 /mnt/nfs/Download
#remount / as ro
/sbin/busybox remount,ro /
#mount the actual NFS share (on 192.168.1.5:/DataVolume/Download)
su --mount-master -c "/sbin/busybox mount -o nolock,ro,hard,intr,vers=3 -t nfs 192.168.1.5:/DataVolume/Download /mnt/nfs/Download"
#check that it was mounted
mount | grep /mnt/nfs/Download

* Code

NFS Toggle (62)
<path to your nfs-enabled busybox>
A1: Variable Set [ Name:%busybox To:/sbin/busybox Do Maths:eek:ff Append:eek:ff ]
<destination mount point (will be created if it doesn't exist)>
A2: Variable Set [ Name:%destination To:/mnt/nfs Do Maths:eek:ff Append:eek:ff ]
<NFS server and share path (base)>
A3: Variable Set [ Name:%server To:192.168.1.5:/DataVolume Do Maths:eek:ff Append:eek:ff ]
<NFS mount options. Adjust to fit your needs.>
A4: Variable Set [ Name:%opt To:ro,nolock,hard,intr,vers=3 Do Maths:eek:ff Append:eek:ff ]
<See if the share is already mounted>
A5: Run Shell [ Command:%busybox mount | %busybox grep %destination/%par1 Timeout (Seconds):0 Use Root:eek:ff Store Output In:%mnt Store Errors In: Store Result In: Continue Task After Error:eek:n ]
A6: Flash [ Text:%mnt Long:eek:ff ] If [ %mnt Is Set ]
<it is mounted>
A7: If [ %mnt ~R %destination ]
A8: Flash [ Text:Unmounting %destination/%par1 Long:eek:ff ]
<requires supersu 1.93 or later to avoid the mount namespaces issue on android 4.2+>
A9: Run Shell [ Command:su --mount-master -c "%busybox umount -l -f %destination/%par1" Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In:%error Store Result In: Continue Task After Error:eek:n ]
A10: Else
<Remount / as rw and create a mountpoint>
A11: Run Shell [ Command:%busybox mount -o remount,rw /; %busybox mkdir -p %destination/%par1; %busybox chmod 777 %destination; %busybox chmod 777 %destination/%par1; %busybox mount -o remount,ro / Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In:%err Store Result In: Continue Task After Error:eek:n ]
A12: Flash [ Text:Mounting %destination/%par1 Long:eek:ff ]
<requires supersu 1.93 or later to avoid the mount namespaces issue on android 4.2+>
A13: Run Shell [ Command:su --mount-master -c "%busybox mount -o %opt -t nfs %server/%par1 %destination/%par1"; mount | grep %destination/%par1 Timeout (Seconds):0 Use Root:eek:n Store Output In: Store Errors In:%err Store Result In: Continue Task After Error:eek:n ]
A14: End If
A15: Flash [ Text:%err Long:eek:ff ] If [ %err Is Set ]
A16: Return [ Value:%err Stop:eek:ff ]

NFS Mounter (60)
A1: Show Scene [ Name:NFS Mounter Display As:Dialog, Dim Behind Heavy Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:eek:n Continue Task Immediately:eek:n ]

Scene: NFS Mounter
P:698x1210	L:-1x-1
Element: mounts/Menu
Geometry:
P:58,228 582x883 L:-1,-1 -1x-1
Content:
Source: Manual
Variable:
Selection Mode: Single
Item Layout: Builtin Item Layout
Horizontal Space: 1
Vertical Space: 1
Events:
ItemClick: 69
ItemLongClick: 67
Items:
1. Label: Download
2. Label: Kits
3. Label: Copii
4. Label: Movies
5. Label: Music
6. Label: Pictures

Element: Text1/Text
Geometry:
P:33,59 655x146 L:-1,-1 -1x-1
Content:
Text: Tap an entry below to mount or umount a NFS share. Long tap to open the share in ES Explorer
Text Size: 16
Text Width Scale Percent: 100
Text Colour: #FFFFFFFF
Position: Centre
Vertical Fit Mode: None
Text Format: Plain Text

* Bugs

So far I have no major bugs, just some things that could be improved. I'm also open to feedback.

* Version history

- v0.2 - Fixed a minor bug that set the permissions on the mount point on umounting. The mount options are now a parameter and can be easily changed.

- v0.1 - initial release