Tested on:
- UE40D6750
- UE32C6000
Now available for D-series and C-series TVs
FOR ARM PROCESSORS ONLY!
It took me months to figure out that you may create more than one SamyGO virtual drive. However every one of them has the same name and handling them wasn't "user friendly". So, I decided to change it and I hacked a little bit g_file_storage driver.
How to install hack (adjust paths to your environment):
- Download and unpack attached file
- backup /mtd_rwcommon/widgets/user/SamyGO/SamyGO/lib/modules/2.6.30.9/kernel/drivers/usb/gadget/g_file_storage.ko
- overwrite g_file_storage.ko with unpacked version
- go into /mtd_rwcommon/widgets/user/SamyGO/SamyGO/etc/init.d/
- find 02_04_vusb.init and rename it to 02_04_vusb.init.dis
- Edit 02_04_vusb.init from unpacked file and set your drives (separated by semicolon), eg
DRIVES="Movies;Laptop;Phone;QNAP"
You may create max 8 drives, and drive name may contain max 16 characters (driver restrictions)
- copy 02_04_vusb.init to your TV to /mtd_rwcommon/widgets/user/SamyGO/SamyGO/etc/init.d/
DONE! Patch has been applied. Reboot your TV. You should see 4 SamyGo virtual drives (if you haven't change 02_04_vusb.init).
What next?
Check your /dtv/SGO.env file. You should see MOUNTH_PATH* variables:
MOUNT_PATH1="/dtv/usb/sda"
MOUNT_PATH2="/dtv/usb/sdb"
MOUNT_PATH3="/dtv/usb/sdc"
MOUNT_PATH4="/dtv/usb/sdd"
This are root folders of your virtual drives. You may mount there whatever you want. In my case I have mounted movies from my PC, few folders from laptop (few shared folder mounted to one virtual drive - in subfolders), phone's SD card (to watch photos directly on tv without DLNA) and my network storage (QNAP).
You may check it on photo:
All 4 USB drives are SamyGO virtual drives.
To developers:
Right now additional parameter is required during insmod of g_file_storage.ko: "model". It should contain array of models of drives separated by comma. It should contain at least one model.
Example
insmod $MOD_DIR/kernel/drivers/usb/gadget/g_file_storage.ko file="/dtv/vusb1,/dtv/vusb2,/dtv/vusb3" model="Movies,Laptop" <= third model is omited so default will be used (SamyGo Virt)
Take look on my mount file:
Code: Select all
#!/bin/sh
#04_04_samba.init
. /dtv/SGO.env
do_mount()
{
M_PATH=$MOUNT_PATH1
echo "Mounting $M_PATH" >>$LOGFILE
mkdir -p $M_PATH
mount -o user=my_user,password=my_pass "//10.0.0.72/Movies" $M_PATH 2>>$LOGFILE
M_PATH=$MOUNT_PATH2/Mediacenter
mkdir -p $M_PATH
echo "Mounting $M_PATH" >>$LOGFILE
mount -o user=my_user,password=my_pass -t cifs "//10.0.0.2/Mediacenter" $M_PATH 2>>$LOGFILE
M_PATH=$MOUNT_PATH2/Movies
echo "Mounting $M_PATH" >>$LOGFILE
mkdir -p $M_PATH
#use prefixpath if you want to mount just subdirectory from your shared drive
mount -o user=my_user,password=my_pass,prefixpath=download/movies -t cifs "//10.0.0.2/E" $M_PATH 2>>$LOGFILE
M_PATH=$MOUNT_PATH3/Photos
echo "Mounting $M_PATH" >>$LOGFILE
mkdir -p $M_PATH
#use prefixpath if you want to mount just subdirectory from your shared drive
mount -o user=my_user,password=my_pass,prefixpath=DCIM/Camera -t cifs "//10.0.0.5/sdcard" $M_PATH 2>>$LOGFILE
M_PATH=$MOUNT_PATH4
mkdir -p $M_PATH
echo "Mounting $M_PATH" >>$LOGFILE
mount -o user=my_user,password=my_pass -t cifs "//10.0.0.1/Mediacenter" $M_PATH 2>>$LOGFILE
}
case $1 in
start)
#TODO: lsmod - check if already loaded
insmod $MOD_DIR/kernel/fs/cifs/cifs.ko
do_mount
;;
stop)
;;
status)
;;
*)
echo "Usage: $0 {start|stop}" 1>&2
exit 0
;;
esac
I've noticed that oryginal g_file_storage.ko has ~35Kb and the one compiled by me ~200Kb. Could you please write how can I make this file smaller? I dont have experience with "Make" files and C compilers - I am Java developer and I've started learning C because of SamyGo MODS