DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-10-22 23:55:12

sm8ps
Member
From: Switzerland
Registered: 2009-12-13
Posts: 13

FFP on a (USB) stick on DNS-320

Dear all,

I have been tinkering with the problem of USB devices with all 777-permissions which seems to be the main obstacle against FFP on a stick here. The results look promising enough to me that I dare opening a new thread here.

1. It seems that the problem is due to mounting with wrong umask value (0). I am pretty sure this happens in '/usr/sbin/usbmount' which tries mounting devices in order as VFAT, AUTO, EXT3, EXT2; the former two with umask=0. (BTW, I have never seen any piece of code that looked worse than this one!) AFAIK there does not seem to be any real solution for adapting this behavior (cf. the two threads by sinisterguy and magnusheino).

2. Playing ignorant, I tried the simple path and put the following into '/ffp/etc/fun_plug.local' (don't forget to chmod +x that file):

Code:

## Test mounting USB-stick
# status encountered
mount > /mnt/HD/HD_a2/MountTest.pre
ls -l /mnt/USB/HD_c1/Test >> /mnt/HD/HD_a2/MountTest.pre
# un-mount device
umount /dev/sdc1
# re-mount it with proper umask and identical other mount options
mount -o umask=0022,codepage=850,iocharset=iso8859-1 /dev/sdc1 /mnt/USB/HD_c1
mount > /mnt/HD/HD_a2/MountTest.post
ls -l /mnt/USB/HD_c1/Test >> /mnt/HD/HD_a2/MountTest.post

The stick is formated with VFAT and the file 'Test' has been created beforehand.

Resulting 'MountTest.pre':

Code:

/dev/sdc1 on /mnt/USB/HD_c1 type vfat (rw,umask=0,iocharset=utf8,shortname=winnt)
-rwxrwxrwx    1 root     root            0 Oct 22 01:57 /mnt/USB/HD_c1/Test

Resulting 'MountTest.post':

Code:

/dev/sdc1 on /mnt/USB/HD_c1 type vfat (rw,fmask=0022,dmask=0022,codepage=850,iocharset=iso8859-1)
-rwxr-xr-x    1 root     root            0 Oct 22 01:57 /mnt/USB/HD_c1/Test

3. AFAICT the door looks wide open for installing FFP on a stick.
a) Create some setup script in 'HD_a2/.bootstrap/setup.sh' containing the above re-mounting procedure
b) Hand over the control to FFP on the USB device
c) Follow the standard (?) procedure for FFP on a stick.
The fact that the device path will be hard-coded should not be too big of an obstacle unless one keeps changing USB devices on the DNS-320 which seems to not very likely to me.

Unfortunately I have no prior experience with FFP on a stick and am fighting an approaching dead-line. I have not tested with an EXT-formated stick. So I hope someone can step in and share their expertise on this topic. Am I overlooking something obvious?

Cheers!
Stefan Müller, Switzerland

Offline

 

#2 2011-10-23 12:55:08

Gyngy
Member
Registered: 2011-05-27
Posts: 32

Re: FFP on a (USB) stick on DNS-320

Hi Stefan,
I formatted my USB  stick as EXT3 partition. Even there are all permissions 777.
I will try your suggestion and let you know if EXT3 is remounted with proper umask after.

Best regards!
Tomas

Offline

 

#3 2011-11-14 20:02:27

sm8ps
Member
From: Switzerland
Registered: 2009-12-13
Posts: 13

Re: FFP on a (USB) stick on DNS-320

Thomas,
I just realized what your post actually says. I would guess that mounting with type AUTO takes care of EXT3 as well so that what you tried (mounting with the EXT3-option) will not happen. I am speculating, though.
At the moment I do not have the time to work on these things but it is on my list.

Cheers!
sm

Offline

 

#4 2011-11-14 21:11:43

Gyngy
Member
Registered: 2011-05-27
Posts: 32

Re: FFP on a (USB) stick on DNS-320

Hi Stefan,

till now I am using workaround - I have saved all permision/owner info into file and while booting this saved data are applied to mounted ext3 USB partition.
It is working till now but it is not very nice solution due to necessity of saving "permission" image file from time to time.

I discovered another also thing. I bought Verbatim Store'n'go 8GB flash specially for fun-plug but after some short time - week - filesystem on this stick was corrupted.
Now I am using wife's 2GB Lexar JD Lightning II and it is working like a charm ;-).

Best regards!
Tomas

Offline

 

#5 2011-11-17 21:44:08

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: FFP on a (USB) stick on DNS-320

You guys might want to check out my solution to the chmod problem: http://dns323.kood.org/forum/viewtopic. … 533#p44533

Let me know if it works for you.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB