View Single Post
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#6
Originally Posted by Philippe View Post
usb_moded does support that It uses /etc/modprobe.d/meego.conf for module loading parameters (standard linux module loading behaviour).

So find in there the options line for g_file_storage and add ro=1
Hey Philippe,

big Thank You.
That works!

This is really "standard linux behaviour"? (seems I need to lear a lot more coming/staying from/on maemo)

So I tested to add ro=1 just behind g_file_storage,
and I needed to
killall usb_moded
and then after selecting mass storage mode my device was connected in read-only mode. Nice!

So only thing to do (as root):
Code:
sed -i s/g_file_storage/'g_file_storage ro=1'/ /etc/modprobe.d/meego.conf
to get write protection and
Code:
sed -i s/'g_file_storage ro=1'/g_file_storage/ /etc/modprobe.d/meego.conf
to get back write possibilty (at home or save PC).

Disclaimer:
I have tested with open mode (so no problem), but this meego.conf file is not in refhashlist and I have booted with stock kernel and it did not malf. So it will work. But I cannot take responsiblity.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-07-05 at 19:29. Reason: added full sed command
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post: