init.d script help (please!!) - Android Q&A, Help & Troubleshooting

I'm having an issue with cm7 on my sgs2 and need some instruction. For some reason my /system (and others) folder is mounted r/w at boot everytime. I have tried everything I know to fix it. Reflashed, wiped caches, formatted /system. I even installed another ROM and still have the same problem. I thought maybe I could write a script, I assume init.d, to mount the folders as r/o on boot, but I don't really know how. Would somebody point me in the right direction to write this? If somebody knows how to fix it that'd be great too. I've got it posted in the cm7 thread but figured I'd try a script in the meantime. Thanks for any help!

Related

[Q] [SOLVED]A little help here please.

Hello all.
Well, here is my problem. I was searching for some theme to change the "colors" of the menu of my device. SInce i couldn't find one, i just started to read a lot, and try to do it myself.
Well, I followed the instructions... and finally got my framework-res. The only problem was that the size of the file was lower thatn the original one. Anyway, I just went to root explorer, took my new framework-res.apk and replaced it on framework folder in internal storage.
The problem is that now my device won't start, I mean... it's stuck on the samsung logo, doing the animation over and over and over. Well I tried to get to the original framework-res, but I don't know how since I cannot replace things because I can't use a file explorer.
I searched some themes on the forum, thinking that maybe the framework-res would be replaced for the new one, and then it would work. Well it doesnt.
I have kph rom, and tried with "Dark simplify theme" and "circle battery kph" couse it's supposed to be stock theme with the circle battery...
Now, I dont know what to do, I dont know how to make an update.zip myself (I tried searching and learning but i just don understand).
I think i would reflash my system but, My internal partition was transformed to ext4 with cf-root, and I read a lot that If i want to flash any other rom, I have to change it to rfs first, but i can't do it couse i can't get to the ext4manager application.
So any ideas? please?
Thanks in advance.
ps: okay, i was a little desesperated when I wrote this (i still am). I searched for some with ext4 compatiblity. I have just tried gingerReal now. It's working. I'm gonna change the internal storage to rfs again, and flash kph.
Bootloop is really common here
you don;t need to reflash, if you have working framework-res.apk you just need to raplace it..
copy framework-res.apk to your sdcard
connect your phone to computer when in recovery
mount system partition using CWM
then using adb follow this command
adb shell
su
cd /sdcard
cp framework-res.apk /system/framework/
reboot
done
also if you reflash your ace using odin to stock one, ext4 partition automatically reverted to rfs
seilent said:
Bootloop is really common here
you don;t need to reflash, if you have working framework-res.apk you just need to raplace it..
copy framework-res.apk to your sdcard
connect your phone to computer when in recovery
mount system partition using CWM
then using adb follow this command
adb shell
su
cd /sdcard
cp framework-res.apk /system/framework/
reboot
done
also if you reflash your ace using odin to stock one, ext4 partition automatically reverted to rfs
Click to expand...
Click to collapse
Hi thanks for the answer. About the adb, that is supossed to be used in a pc, right? (sorry I never used it, i have just used terminal emulator in the device itself). I mean, I enter cmd, write adb shell and i'm in? (i have already installed sdk and all the neccesary things)
About the ext4 to rfs, well thanks! nice to know that ahaha . I have already flashed kph again, so it's all working now. But the next time, I'll do what you say. I guess I already know about adb shell, but I dont know how to use it (i get easily confuse when it comes to apply commands). Well, that's what I love of all of this. You screw things up, you get really nervous, but then you know you can solve it and it is the best ahaha.
Thank you!.

write permission on / (not /system)

Hi all, probably mine is a noob question, since in android I'm quite a noob. I've been using gentoo for years though so I'm somehow confident with the shell and I'd love it to work on it on my rooted sgs2
So, basically, I searched but I didn't find (/me fool). When asking for write permission everyone is talking about /system, but not / in general. Is there a reason? If I need to copy&paste or just create a file directly in / how can I do?
Giving a #mount command shows me only this about "/" :
rootfs on / type rootfs (ro,relatime)
so there is no indication about a /dev/block adress or a "real fs" information (which for what I know is ext4). Also those informations looks like a "pseudo-filesystem" partition, like sysfs or fusefs for instance.
Looking at the rest of the "#mount" output (aka "cat /proc/mounts") I see the only other partition mounted in ro is /system, but it has a block device association and I can remount it in rw easily. Not the same with /
Can anyone clarify me please? Is there a way to mount / in rw?
This is because that's where we want to use. The system area is where modifications of the device (done by people who should know exactly what they are doing; e.g changing build.prop codes) is made. It can easily be made r/w but only if your device is rooted and in many cases S-OFF'ed. If you have root (and for some devices S-OFF), then you can just use a file explorer (which supports root functions e.g Root Explorer) to mount it as r/w (this is the easiest way).
Yes, my phone is rooted and S-OFF'd and everything's fine, I have no particular problem to fix, just wondering.
So what if anything goes corrupted in / (outside /system, /data or any other separate partition) and we need to restore it or just create a script or anything changing permissions or writing data on the / partition? Btw: for what I know about linux, the root partition (I mean "/" not "/root") must be a "real partition" with a proper fs and mount point, and not anything cached somewhere. Guess it must be the same in android too. So, where is it?
johnnystuff said:
Yes, my phone is rooted and S-OFF'd and everything's fine, I have no particular problem to fix, just wondering.
So what if anything goes corrupted in / (outside /system, /data or any other separate partition) and we need to restore it or just create a script or anything changing permissions or writing data on the / partition? Btw: for what I know about linux, the root partition (I mean "/" not "/root") must be a "real partition" with a proper fs and mount point, and not anything cached somewhere. Guess it must be the same in android too. So, where is it?
Click to expand...
Click to collapse
For Android (about corruption for the first question), people usually just reflash the rom since you wouldn't be able to boot the phone (at least fully) to be able to replace a missing file(s). Where is "/" you ask, if you open Root Explorer that's where you'll be.
I know where is "/" in that sense, I meant where is the partition or the mount point
anyway..... not a big issue. I must deduce in android, in any present past and future device, the /efs directory is mounted on a separate partition. All my guessing came mostly from that point, since I wanted to backup and most of all _restore_ that dir using the shell. Again, I don't need it now, I did my backup and I hopefully will never need a restore. Most of all in my sgs2 /efs is on a rw partition, so no issue at all even in case of deep trouble (/efs deletion).
And yep, I know about EFS Pro and similar tools, but wanted to try the sh way and to understand something more of android in general
why is the trouble EFS deletion? what is EFS partition for?
Sent from my Nexus S using XDA App
Speaking on this subject, I have tried but cannot remove the file "/sys/devices/virtual/sec/ts/touchkey_led" (trying to turn off lights behind capacitive buttons).
Does anyone know how to move/delete this?
No, led hack doesn't work on my device if you are wondering.
why is the trouble EFS deletion? what is EFS partition for?
Click to expand...
Click to collapse
/efs is where your IMEI and other critical (and legal) information of your device are stored. You should backup it as soon as you root your phone, before any other mod. Hence comes the troubles, since if you delete it for any reason, you are in deep troubles, expecially if you didn't backup it.
I have tried but cannot remove the file "/sys/devices/virtual/sec/ts/touchkey_led"
Click to expand...
Click to collapse
I'm not totally sure about what I'm saying on android, but on linux /sys is an in-memory filesystem, meaning it is generated by the system after (at) boot and it's where all your device are linked in for the kernel, so it basically manged by the kernel itself. That could be the reason why you cannot delete anything in there. But again, I'm somehow guessing so, wait for someone else to confirm (or deny)
johnnystuff said:
That could be the reason why you cannot delete anything in there. But again, I'm somehow guessing so, wait for someone else to confirm (or deny)
Click to expand...
Click to collapse
Actually you can delete items in there... but they will just be re-created .

Write to EFS on boot

My efs folder is wiped upon reboot each and every time. I have a T-Mobile Galaxy s II (T989). Luckily the imei is not being saved there, or if it is then Samsung has made it to where it cannot be deleted?
Anyways, I have the files that need to be included in the efs folder to give me my power menu and lock screen and other phone settings saved on my internal sd card. These are hte files that are wiped on each reboot. The efs says it cannot be mounted in CWM.
I have no problems making phone calls and such but I must pull the battery on each reboot, otherwise I also cannot get signal nor does it recognize the sdcard.
I bought this from some douchebag on Craigslist that said he was having a lockscreen issue and nothing else and now he won't respond to any emails. Of course. So I am stuck with it. At least I can make it work, with my bandaid fix of re-migrating those files after each reboot.
I would think that if I cannot get the efs fixed to where it can keep the files there, maybe a script can be initiated upon each reboot to copy the files over th the efs partition so I don't even have to worry about it? I thought this was done already with other options like overclocking and such but I don't know how to include my file migration or even where to begin to make this happen. Is there someone here that can help me?
I was thinking too that there may be a script running thats clearing the efs partition on reboot and maybe there is nothing wrong with the efs partition? I don't really know linux commands all that well and going through the .rc and .sh files on root, I do see some lines in some of the files that call for "mkdir /efs". I'm not sure if that was a one time run file or if that happens upon each reboot or if thse files are ran upon each reboot. I am specifically speaking of fota.rc and lpm.rc. The lpm.rc has " mkdir /efs 0771 system system". I do not know if these files are important or anything though.
I appreciate any replies. If files are neede for comparison, please ask.
Oh yeah, I've tried multiple roms, multiple factory restores and reinstalling CWM but it just keeps clearing out the efs upon reboot.
Anybody? I know it can be done, I just have no clue where to begin.

Help needed - System wipe/reinstall ROM et al.

So a quick catch up is needed: I accidentally wiped my system in TWRP recovery. I have now been able to push the ROM back to TFP via ADB. All seems to be ok.
Issues:
1) When flashing the rom zip I got a failed message after TWRP checked partitions, anyone know what to do with this?
2) TWRP only will allow me to install from /data directory, is this normal and will this hinder rom flash?
Any insights or knowledge of existing threads with answers would be really appreciated. Thanks for reading this too btw, I'm new so anything will be helpful.
Thanks again.
tstern0112 said:
So a quick catch up is needed: I accidentally wiped my system in TWRP recovery. I have now been able to push the ROM back to TFP via ADB. All seems to be ok.
Issues:
1) When flashing the rom zip I got a failed message after TWRP checked partitions, anyone know what to do with this?
2) TWRP only will allow me to install from /data directory, is this normal and will this hinder rom flash?
Any insights or knowledge of existing threads with answers would be really appreciated. Thanks for reading this too btw, I'm new so anything will be helpful.
Thanks again.
Click to expand...
Click to collapse
I haven't personally used TWRP but I've seen in the buglist that sometimes it could mess up with particularly large ROM files. However, I have not tested this firsthand because I know my prime is sort of like a moribund insect; you touch it, it dies.
Sent from my tf9001 with XDA XD.
tstern0112 said:
So a quick catch up is needed: I accidentally wiped my system in TWRP recovery. I have now been able to push the ROM back to TFP via ADB. All seems to be ok.
Issues:
1) When flashing the rom zip I got a failed message after TWRP checked partitions, anyone know what to do with this?
2) TWRP only will allow me to install from /data directory, is this normal and will this hinder rom flash?
Any insights or knowledge of existing threads with answers would be really appreciated. Thanks for reading this too btw, I'm new so anything will be helpful.
Thanks again.
Click to expand...
Click to collapse
The /data directory is the only partition I have ever flashed a ROM from. /data is just internal memory Where does ADB push put the file by default, at the root?
It sounds like you may need to re-partition your device. I guess when you wipe /system in twrp, it doesn't create a new /system partition? Or maybe it wiped everything? The TWRP thread can probably answer these questions, but my guess is that you just need to create a new partition(s) or if the partitions are okay just adb push the file to the right spot. I've never done that before in ADB, hopefully it isn't complicated? Good luck man, ask the Team Win thread if you have questions, I bet they can help!
Komodo Rogue said:
The /data directory is the only partition I have ever flashed a ROM from. /data is just internal memory Where does ADB push put the file by default, at the root?
It sounds like you may need to re-partition your device. I guess when you wipe /system in twrp, it doesn't create a new /system partition? Or maybe it wiped everything? The TWRP thread can probably answer these questions, but my guess is that you just need to create a new partition(s) or if the partitions are okay just adb push the file to the right spot. I've never done that before in ADB, hopefully it isn't complicated? Good luck man, ask the Team Win thread if you have questions, I bet they can help!
Click to expand...
Click to collapse
Thanks so much.. Yeah I've been reading up on this and of course there's always more to the story haha I talked to an old linux engineer and he agrees with you that there is probably something going on with partitions. I'll head over to TWRP and see if they have any ideas. Thanks for your help.

[Q] Major I/O problem, need help

So I flashed this ROM a bit earlier, and now, like a few other users in that thread, I cannot seem to be able to write anything to /sdcard. Installing and updating apps still works ok, but downloading anything with the browser, deleting any files in /sdcard, copying anything with wifi file explorer to /sdcard, or any I/O related thing to /sdcard fails.
Now here's the crazy thing. I've factory reset + wiped system and installed another ROM, as well as factory reset + wiped system and restored a backup, and still no go. Seems like something got borked pretty good...
Please advise.
Update...
Have tried a few more things, here's what works:
I can write to SDcard when connected to the computer via USB using the computer to send the files.
I can write to the SDcard when using TWRP's file manager.
I have tried fixing permissions, but that did not solve the problem.
TweakerL said:
Have tried a few more things, here's what works:
I can write to SDcard when connected to the computer via USB using the computer to send the files.
I can write to the SDcard when using TWRP's file manager.
I have tried fixing permissions, but that did not solve the problem.
Click to expand...
Click to collapse
have you tried this?
http://forum.xda-developers.com/showthread.php?t=1670824
then use ADB to push the ROM you want.. hope you know about pushing ADB... i just did it last night...

Categories

Resources