Difference between revisions of "Mounting an CIFS/SAMBA share on a USB device to bypass DLNA"


From SamyGO
Jump to: navigation, search
(TODO : Virtual USB)
(TODO : Virtual USB)
Line 19: Line 19:
 
*Load Kernel Modules for VUSB
 
*Load Kernel Modules for VUSB
  
dd if=/dev/zero of=/dtv/vusb bs=512 count=4
+
<pre>dd if=/dev/zero of=/dtv/vusb bs=512 count=4
  
 
insmod $Module/dummy_hcd.ko #Get it from SamyGo_AllExtensions
 
insmod $Module/dummy_hcd.ko #Get it from SamyGo_AllExtensions
Line 39: Line 39:
 
insmod $Module/cifs.ko  
 
insmod $Module/cifs.ko  
 
sleep 3
 
sleep 3
 +
<\pre>
  
 
== Mounting cifs share ==
 
== Mounting cifs share ==

Revision as of 13:48, 26 November 2010

This is article about mounting CIFS shares on Samsung TVs. Tested on LExxB65x.

Neither this WIKI/Forum nor the author(s) of articles and information provided accept any responsibility for damage that may be caused by use of the information provided. You do everything at your own risk. Be aware that "hacking" activities do void your warranty!

What we need?

Preperation

  • Share at least one directory (right click on directory -> sharing -> share this folder)
  • Download cifs.ko module from SamyGO Samba Kernel Module.zip
  • Unzip and copy cifs.ko file to pendrive or nfs share that is mounted or will be mounted on TV
  • Plug pendrive to TV / mount nfs share containing cifs.ko
  • Copy cifs.ko to /mtd_rwarea/
cp /dtv/usb/sdXX/[path_to_cifs.ko] /mtd_rwarea/ 

TODO : Virtual USB

  • Load Kernel Modules for VUSB
dd if=/dev/zero of=/dtv/vusb bs=512 count=4

insmod $Module/dummy_hcd.ko #Get it from SamyGo_AllExtensions
sleep 3

insmod $Module/g_file_storage.ko #Get it from SamyGo_AllExtensions
sleep 3

echo -e "[sdd]
Vendor : CifsMount
Product : VUSB Stick
Serial : Q80VQLFH
Devpath : 8
Lun : 0
MountDir : /dtv/usb/smb
FileSystem : vfat
" >> /dtv/usb/log   

insmod $Module/cifs.ko 
sleep 3
<\pre>

Mounting cifs share

* Load cifs.ko module once insmod /mtd_rwarea/cifs.ko * Now You can mount cifs share: mount -o user=<username>,password=<password> -t cifs //<server>/<share> /dtv/usb/sdXX/[mount_path]

Example of mounting script

*Mounting cifs share to existing directories on connected to tv pendrive: #!/bin/sh #Load cifs.ko module insmod /mtd_rwarea/cifs.ko #Mount cifs shares (check if something is mounted already) if [ `mount | grep -c /dtv/usb/sda1/Media` == 0 ]; then mount -o user=user1,password=pw123 -t cifs //192.168.0.2/videos /dtv/usb/sda1/Media if [ `mount | grep -c /dtv/usb/sda1/Music` == 0 ]; then mount -o user=otheruser,password=somepassword -t cifs //192.168.0.5/music /dtv/usb/sda1/Music *Mounting cifs share to virtual usb drive: #!/bin/sh #Load cifs.ko module insmod /mtd_rwarea/cifs.ko #Create directory structure on virtual usb memory: mkdir -p /dtv/usb/sda4 mkdir -p /dtv/usb/sda4/Media mkdir -p /dtv/usb/sda4/Music if [ `mount | grep -c /dtv/usb/sda4/Media` == 0 ]; then mount -o user=user1,password=pw123 -t cifs //192.168.0.2/videos /dtv/usb/sda4/Media if [ `mount | grep -c /dtv/usb/sda4/Music` == 0 ]; then mount -o user=otheruser,password=somepassword -t cifs //192.168.0.5/music /dtv/usb/sda4/Music # append sda4 notification to log file: echo "[sdd] Vendor : Linux Product : [name_visible_in_source_selection] Serial : Q80VQLFL Devpath : 4 Lun : 0 MountDir : /dtv/usb/sda4 FileSystem : vfat " >> /dtv/usb/log For safety reasons it is recommended that you run these (and others) scripts with "&" at the end (this will run script at background and in case of script failure this will prevent TV system freeze). Also be sure to allow these scripts being executed: chmod 755 cifs_mount.sh

Notes

* Remember to be sure that windows user that You use to mount cifs share have permission to read shared directory * (to be checked/confirmed - my attempts to mount cifs share using windows user without password failed - there wasnt any error, mount was listed in mount list but there simply weren't any files in directory that cifs share was mounted to, but mount worked flawlessly when i mounted using user with nonblank password - can anyone confirm that this is normal? I remember i was reading somewhere that to access windows share user password is necessary but it was some time ago. So if this will be confirmed - add part below)

Cifs share requires windows user with non-blank password (i mention it because in their homes people quite often dont use passwords). If You dont have password on all of Your windows accounts and You want to keep it that way You can create new windows account with password (in control panel -> user accounts) and to keep Your login screen clean You can hide this account from login screen: ** Run Registry Editor (RegEdit.exe). ** Navigate to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList

Special Accounts User List

Note: If SpecialAccounts and UserList is not found, create new sub-key and name them accordingly. ** Select UserList, and in the right pane, right click on any blank space, and point to New -> DWORD (32-bit) Value. ** Name the new DWORD registry value name as the exact same name that match the name of the user account to be hidden.

For example, if the user ID of the user account is John, the name the registry value as John. ** Double click on DWORD registry value, and set the value data to 0 in oder to hide the account from Welcome Screen.

Tip: To display the user account on Welcome Screen again so that it’s visible again, delete the registry entry, or set the value data to 1. ** Exit Registry Editor.

Credits

*Credits go to arris69 that originaly posted cifs info on avsforum (link: http://www.avsforum.com/avs-vb/showpost.php?p=17259406&postcount=235) and virtual usb memory info (link: http://www.avsforum.com/avs-vb/showpost.php?p=17266286&postcount=247). *I also used "How to create hidden user account" article (link http://www.mydigitallife.info/2009/02/21/how-to-create-hidden-user-account-hide-user-account-from-welcome-screen-in-windows/). *Any edit propositions post on SamyGo forum (link: http://forum.samygo.tv/viewtopic.php?f=2&t=26)