Help needed to create a file in /sys/..... - Android Software/Hacking General [Developers Only]

I am trying to create a new file name "scaling_available_frequencies" in /sys/devices/system/cpu/cpu0/
I tried with
adb remount
adb push scaling_available_frequencies /sys/devices/system/cpu/cpu0/scaling_available_frequencies
not working say no such file
I tried too to create the file from root explorer and it sayse created but doesnt appear
What can I do?

I'm unsure, but i don't think you can create files there, as those objects there are not really files, but input/output ports for the specific devices.
To add another input/output port there called "scaling_available_frequencies" you will probably have to edit the kernel.
Someone correct me if i am wrong please.

/sys is not writable by anything but the kernel
The kernel publishes compile options and runtime values through /sys. It would be a security risk if anything else could modify /sys.
/sys is not persistant and is not really a filesystem in a traditional sense, but a read only database accessed by filesystem methods
If you don't see something you expect then look at you kernel compile options and what modules you may need to load
Different kernels support dfferent features and this is reflected in /sys.
Sent from my SMB-1002-3G using XDA Premium App

Related

Data/data and permissions accross roms

Hy !
I suffer from instability with almost each rom i tried.
So i'm arrived to think about saving my data (data/data), especially for account login and games progressions
I tried to put them on sd, and sometimes really succeeded in using them accros different roms.
However it was needed to change permission according the cp copy was done under root login. I succeeded and took into account that permissions for lib were differents for system access.
However, in the new android (2.3 in cyanogen 7), the boot process mismatches the libs (linked instead of the lib directory):
/mismatched_uid/settings_10...
even if permissions were corresponding to the packages.list.
Can somebody help me please to understand why it's mismatching?
Thanks a lot
I'm dealing with the same thing right now. I did a nandroid restore, and I've got these mismatched_id symlinks all over the place. SUCKS!
EDIT: Found this: http://niftybits.wordpress.com/2011/08/18/troubleshooting-nandroid-backuprestore/
Well a symlink is just a file pointer, just repoint them with terminal command ln -s target nickname
First just search for what it is pointing to and search where it has moved then just point them to the new place, you could automate with a small script, find missing symlink search for target if found replace. Does require a small knowledge of scripting though.
Sent from my Nexus S using Tapatalk

[Q] CIFS-Manager succesful mount but empty directory

I've got one cifs mount that works and one that shows an empty folder.
both mounts are from (seperate) ubuntu servers with near identical smb.conf files. there are no sym links in the shares. does the file system on the mount point have any effect? one is ext3 and the other is ext4
the strange thing is that when in the android terminal I can see the contents of the 'empty' mount but in the file managers i've tried (astro, adoa, ES)I just get an empty directory and instead of seeing dr- for the permissions it just show d--.
this is on an asus transformer running optimus 1.5
any help would be greatly appreciated.
never mind, file manager HD does the job, doesn't bother mounting, just points directly to the smb share.
highly recomend using file manager HD if anyone else is having my problems, it's fantastic.
only annoying thing was that I couldn't add shortcuts to smb:// root addresses, so I created symlinks within the shares.
I know, you dont need a solution anymore, but someone else might need it. I had the same problem and it was a rights issue. I changed the owner:group to root:root and and changed access rights to 0555. I dont know it is now working, because no other clients need these changes.
searchforglory said:
I know, you dont need a solution anymore, but someone else might need it. I had the same problem and it was a rights issue. I changed the owner:group to root:root and and changed access rights to 0555. I dont know it is now working, because no other clients need these changes.
Click to expand...
Click to collapse
Can you elaborate on this? When you say you changed the owner:group to root:root, is that for the directory on the server that is being shared? What about files and child directories? Also, by 0555, do you mean r-xr-x-r-x permissions on the samba share folder on the server? Which samba user did you use to access the share?
I have multiple mounts, and while cifs manager says they all mount successfully, some of them show up as empty directories, and I can not figure out why as I have made sure that the permissions on the server are the same.

[Q] EEE - how to dump everything?

I don't know if ADB is even the best tool to do this, but I want to be able to copy the entire file system off the EEE pad onto a pc. I want everything, starting from the "/" root directory. I want the entire file system and all files copied over so I can work with them on the pc.
I have root (verified by # when entering adb shell and various root apps successfully running.)
My thought was to do "adb pull /" from a dos shell (running windows 7), but not everything copies over. I get lots of messages about "skipping special file", I dont get the /data/data directory, etc etc.
Is there a tool or some way to copy over the entire file system starting from "/" ?
Thank you.
Nvflash will let you download the APP partition which is the system folder. It's an ext4 filesystem that you can mount and poke around.
USP is the data partition.
Be careful not to format your TF!
Clockwork mod will backup the system.img and you can either mount or unyaffs this. I forget which one. Same for data.img
sent from my cyanogen(mod) vision
Is the data.img same as the USP partition? Is the system.img same as the APP partition?
which I can then mount and explore?
I don't want to edit anything, I only want to examine.
In particular, I want to take a snapshot of all the files and filesystem (directory structures, files, etc) before an app is run. After the app is run and exited, I want to take another snapshot and look at what has changed. If there are new files created, existing files edited, etc. I want to search for strings (grep), etc.
I was hoping I could copy all the files to do this, but perhaps there is another way like one of those you suggested (nvlash, clockwordmod, ??)
Thank you.
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
sent from my cyanogen(mod) vision
gee one said:
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
Click to expand...
Click to collapse
Expert or not, I really appreciate your advice.
I took your initial suggestion to be to use NVflash and/or clockworkmod to make backups of the device. It seems from some other threads I've read that the tablet drive consists of up to 15 or 16 partitions, two of which are USP and APP.
So conceivably I could back those up "before", and mount the backup images somewhere to look at, preferably on a pc.
Then, I could install and run the app in question, and use NvFlash and/or CWM again to make backup images, and look at them for comparison.
On another note, I tried installing busybox and running cp to move, for example, /data to the external SD card, but I think I need a bigger SD card.
I wonder if
busybox cp / /Removable/MicroSD/targetdirectory
would work to copy everything?
The danger with that is that some directories and files are virtual- /proc and I think /var are virtual directories. Files like dev/null dev/zero would be problematic!
You might want to do specific parts, such as /data, or even /data/data/your.app's.java.name.here
You could use "find ." and write a script to pull everything with adb, but it would take forever, so it might not be a true snapshot.
Have you looked at the ddms or some of the other tools in the android SDK?
Sorry to confuse. By snapshot I did not mean screenshot. I meant just a record of the state of the device at that point in time. Meaning, all the files before the app was run. Then all the files (any new ones, changes to existing ones, any deleted) AFTER the app was run. I want to look at what has changed.
Still, thanks for the ddms idea. I have to look at any other tools in the adb environment that could be useful.

[Q] Cant write to /sys directory

Could someone find how to make this directory writable???
using root explorer or root enabled file browser can do it
Sent from my Xperia Neo V using xda app-developers app
Why'd you need it? Think it's a part of kernel... even if you write it, next time you reboot.. it'll be gone
◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆​If my post is empty,?Click нεяε?
CM10 HTC A310E ?>? & ??
▶LâTêS†↭ⓛⓘⓝⓚⓢ™◀
◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆​
ri123 said:
Could someone find how to make this directory writable???
Click to expand...
Click to collapse
I know this question is over a year old but I noticed it showing up as a top google search for modifying permissions and file systems in Android, so let me update this with the correct information.
The /sys directory is a virtual file system and is controlled by the kernel. You can modify contents of existing files to directly make changes to the kernel but you cannot create new directories or files unless you get the source to the kernel you're using and recompile with the changes made there.
Think of /sys as where all the settings and information for your kernel is stored. You simply can't create new features without gritting into the existing source code but you CAN modify existing settings by modifying the correct file.
Hope that answers anyone else stumbling across this thread in search of the Holy Grail of Android knowledge.

How to create custom build.prop file to custom directory in aosp?

Hi all,
I am working on aosp and have two questions about build.prop.
1) Normally, build.prop file is located to /system directory. I'd like to create custom build.prop file and save it to different directory. For example, I have tvconfig directory and want to create it in here. Could I read properties from /tvconfing/build.prop via SystemProperties?
2) Could I use different name for prop file except build.prop for example mycustom.prop
thanks in advance
batuhanavl said:
Hi all,
I am working on aosp and have two questions about build.prop.
1) Normally, build.prop file is located to /system directory. I'd like to create custom build.prop file and save it to different directory. For example, I have tvconfig directory and want to create it in here. Could I read properties from /tvconfing/build.prop via SystemProperties?
2) Could I use different name for prop file except build.prop for example mycustom.prop
thanks in advance
Click to expand...
Click to collapse
Not sure if it would work, but one idea to try is creating a symlink from the file you want, to the build.prop file. If it works, you could also rename the file. Just an idea? I use this technique for the hosts file myself. see the code in https://forum.xda-developers.com/an...osts-diamondjohn-host-builder-script-t3872728
The next choice would be a magisk module.
I need help with a Custom recovery for Fero Royale LTE
MICHAEL(SMHOS.ORG) said:
You can't really do that but you can make custom Changes or specs to the build.prop,like improve Speed or So, increased or reduced screen size fake android version etc
Click to expand...
Click to collapse
I understand that I can't move build.prop file to different directory except /system directory. Well! Can I do that create mycustom.prop file in different directory and read any property from it via SystemProperties?

Categories

Resources