On 09/23/2011 09:29 AM, Pratik Prajapati wrote:
> 
> I have checked that when init runs chmod the sysfs entry is present.
> logwrapper says chmod finished with return value 0.
> 
> Further I created a oneshot service which does the chmod, but no luck
> Also I created a oneshot service which call a script and the script does
> the chmod, but no luck.
> If I run the same chmod command from console, It works fine.
> 
> Any further inputs?

First, are you sure it's not getting reset some time later
in the initialization?  How are you examining it after the fact?
(Sorry to come in late, but did you verify you can do this on
the command line?)

One thing to try would be to wrap the execution of chmod with
strace and get a log of the syscalls directly.

Try something like this in /init.rc:
service mychmod /system/xbin/strace -f -tt -o /cache/debug/chmod.strace 
/system/bin/chmod 777 <file>

(make sure that /cache/debug exists, and is writeable)

------
Or run strace on the entire init program.

This will be a pain to set up, however. You'd have to modify
the kernel command line (or do a custom wrapper and replace
/init with something that invoked strace on a saved 'init'.

------

Or, directly instrument the chmod syscalls in the kernel.

-----
Or, make a custom 'init' program with debug information in the chmod path,
run that, and see what's going on.

Those are a few ideas.
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Workgroup of the Linux Foundation
Senior Staff Engineer, Sony Network Entertainment
=============================

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to