So I think I've correctly enabled init.d support on my phone... I've added a few scripts that I pulled from another ROM, but I don't know how to verify whether or not they are working correctly. Does anybody know of a quick and easy way to test whether init.d scripts are loading? Is there a test script I can insert and run that will make it obvious if it works, but doesn't do anything destructive... just to test?
OK, so I want to create a script that will set a new background image on boot to test this. that way, if init.d is working, I know because I reboot and get a different bg than the one I was just on... is that possible?
To test if it's working, drop a line like this in your script.
echo "It's working" > /sdcard/initd.log
Related
Sorry for the incredibly newbish question. (Feel free to refer me to other places this may have been answered.)
There seem to be a lot of "Speedy"/Performance scripts listed in the Sticky on the X2 Dev forum, and I was just wondering if someone would be kind enough to provide a line or two to describe each.
It seems to me like there is a lot of overlap between some of these scripts, especially when considering the tweaks added by various ROMs. So I am most interested in finding out basically which are compatible, and which are most likely to conflict with the available custom ROMs.
Here are a couple, but feel free to add more.
Speedy V6
Init.d Re-hack (required for some scripts)
Init.d Hack v0.6 (required for some scripts)
Speedy Gonzales v1.0 (thread closed)
Power Boost v2.0
-=V6 SuperCharger=-
SetCPU (an app that may/may not work in conjunction with some of the above scripts)
Again, sorry for my nativity here. I know this information can be found in the individual threads, but I'm sure a basic overview would be a really big help for those of us who are just now trying to get into the installation of some good speed scripts. It's also really unclear to a beginner which scripts/apps/ROMs will conflict with each other or which combinations might actually reduce effectiveness & stability.
Thanks!
ya i agree...too many of these overlap with each other.....which work with what kernal???....which works the best....benefits of each??....etc....
init.d hack is a way to allow you to store scripts in a directory called /etc/init.d that will fire up when the phone reboots. Without it, you could create the directory but your phone won't run the scripts.
It's best to flash the init.d hack first which "hijacks" the boot process and will execute any scripts located in the /etc/init.d directory.
Once that is flashed, I find the V6 Supercharger Scripts to be the best for making the phone speedy. I use options 9 and 12. 9 sets the optimal memory settings that seem to prevent music from skipping. Option 12 makes the launcher not get killed in memory which can cause skipping and hi cupping in the X2 as it unloads and reloads from what I understand.
I really haven't used anything else except the V6 Supercharger Scripts. They seem to be the most popular, but what it all boils down to is, experiment with each one and see which gives you the best performance you are seeking.
I also know many ROMS, such as Eclipse, have incorporated the init.d hack and have their own versions of many of these performance scripts in them, so mileage will vary.
Also, the kernel doesn't mean anything. It works with all kernels. But, many of them require Busybox installed since they use various UNIX commands that are not available in the stock image.
question: can't you just save the 99 v6 script as run as root, run at boot after you create the init.d directory instead of having to run the init.d hack? i've never run the init.d hack but have used the run as root run at boot save and it always loads fine on boots.
I really hope I posted this in the right place...
I loaded Eclipse v1.3 yesterday on 2.3.4 and I love it! It works really well. I had the issue about the gps but it went away after 2 battery pulls. I don't have any problems with iheartradio skipping or any other music for that matter. I have even noticed my X2 runs way faster. But, my internet is slower. No matter downloading or browsing, I can tell it is slower than before. Since Eclipse has the init.d already inside, can I download the Speedy V6 zip and flash it when I go into recovery mode? From what I have read in the forum, that should increase the overall speed of the phone. Or, being a noob, am I going about that the wrong way?
---------- Post added at 01:58 PM ---------- Previous post was at 01:37 PM ----------
tallyforeman said:
I really hope I posted this in the right place...
I loaded Eclipse v1.3 yesterday on 2.3.4 and I love it! It works really well. I had the issue about the gps but it went away after 2 battery pulls. I don't have any problems with iheartradio skipping or any other music for that matter. I have even noticed my X2 runs way faster. But, my internet is slower. No matter downloading or browsing, I can tell it is slower than before. Since Eclipse has the init.d already inside, can I download the Speedy V6 zip and flash it when I go into recovery mode? From what I have read in the forum, that should increase the overall speed of the phone. Or, being a noob, am I going about that the wrong way?
Click to expand...
Click to collapse
I'd also like to note: On my CPU tuner app, it always says the Active CPU's are 1/2 and does not pass the test under the "check capabilities" portion of the app. I also had the same result before rooting and loading Eclipse. Will the new script cure that?
h_10 said:
question: can't you just save the 99 v6 script as run as root, run at boot after you create the init.d directory instead of having to run the init.d hack? i've never run the init.d hack but have used the run as root run at boot save and it always loads fine on boots.
Click to expand...
Click to collapse
The main reason for the init.d hack is so u don't NEED script manager to run init.d scripts at boot. One less thing for ur phone to have to start up. One less application running on startup.
What I used to do(when not running a rom w/init.d support...eclipse HAS init.d hack built in along w/liberty (others too I believe)
Is I would flash the hack. Delete all init.d scripts and just run supercharger scripts from there.
that way there was no need to run the supercharger scripts at boot etc...
I'm wanting to see what the V6 Scripts will do for CM7 but I cannot for the life of me get them to stick upon reboot.
I have them setup via Script Manger to run as root. I've gone in, did option 6 (0,4,10,12,14,15) and option 20.
Upon reboot, the settings in /sys/module/lowmemorykiller/parameters/adj are set back to the default CM7 settings
I've tried setting the properties in both local.prop and build.prop, but nothing seems to stick.
I've tried integrating the settings of the init.rc into the ROM and not doing that.
None of these options seems to make the low memory killer settings I set in V6 stick and it ALWAYS reverts back to the stock CM7 settings.
I know I can just rerun the script after it's done booting, but I never had to do this with other ROMs as it would integrate fine in /etc/init.d and run.
I see in the /etc/init.d a S99SuperCharger script with the correct permissions set. I can run it via sh and it sets the properties correctly.
It just seems that CM7 is overwriting the low memory settings somewhere and I don't know where. I don't see it occurring in any of the supplied scripts from CM7 in the /etc/init.d and I don't see it in the build.prop file.
Any ideas? I know I could just tell Script Manager to run the script on boot, but that's usually not recommended except as a last resort.
I guess the real reason I would like to get this working the way it normally does (via the init.d scripts) is just to understand what CM7 is really doing.
Thanks!
Perhaps CM7 has some sort of memory management of it's own that sets things back to the defaults on boot????????
I know, not much of an answer but it's the best I can come up with.
robocuff said:
Perhaps CM7 has some sort of memory management of it's own that sets things back to the defaults on boot????????
I know, not much of an answer but it's the best I can come up with.
Click to expand...
Click to collapse
That's what I figured is happening. I just have to determine where it's happening at.
I see that the V6 scripts are running, but something is setting it AFTER the init.d process is done.
I also checked the /data/SuperChargerRan log file and this is what I saw:
02-16-2012 09:20:53: Applied Settings from /system/etc/init.d/S99SuperCharger!
02-16-2012 09:20:54: DIDN'T Apply Settings from /data/99SuperCharger.sh!
Not sure why the second one isn't working.
Looking at the /sys/module/lowmemorykiller/parameters/adj file, it's back to the original settings that CM7 has: 0,1,2,4,7,15
iBolski said:
I'm wanting to see what the V6 Scripts will do for CM7 but I cannot for the life of me get them to stick upon reboot.
I have them setup via Script Manger to run as root. I've gone in, did option 6 (0,4,10,12,14,15) and option 20.
Upon reboot, the settings in /sys/module/lowmemorykiller/parameters/adj are set back to the default CM7 settings
I've tried setting the properties in both local.prop and build.prop, but nothing seems to stick.
I've tried integrating the settings of the init.rc into the ROM and not doing that.
None of these options seems to make the low memory killer settings I set in V6 stick and it ALWAYS reverts back to the stock CM7 settings.
I know I can just rerun the script after it's done booting, but I never had to do this with other ROMs as it would integrate fine in /etc/init.d and run.
I see in the /etc/init.d a S99SuperCharger script with the correct permissions set. I can run it via sh and it sets the properties correctly.
It just seems that CM7 is overwriting the low memory settings somewhere and I don't know where. I don't see it occurring in any of the supplied scripts from CM7 in the /etc/init.d and I don't see it in the build.prop file.
Any ideas? I know I could just tell Script Manager to run the script on boot, but that's usually not recommended except as a last resort.
I guess the real reason I would like to get this working the way it normally does (via the init.d scripts) is just to understand what CM7 is really doing.
Thanks!
Click to expand...
Click to collapse
Hehehehe... Me thinks you should search the forums a little bit. When I was testing cm7 for DZK, I tried EVERYTHING I used on previous ROMs, to include V6_SuperCharger. V6_SuperCharger DOES NOT WORK with CM7! The BIGGEST reason is the mapping for the memory slots are different with CM7, so fudging with them tends to cause massive issues and slowdowns. The reason it does not stick is most likely (speculation here) due to CM7 settings things back to it's optimized default settings.
Keep in mind that CM7 is an "optimized" AOSP based ROM... That means NO BLOATWARE! I am running with roughly 315 apps, most of which I use on a WEEKLY basis. Some, only monthly.
There are a few issues that I have noticed, root/su issues, sometimes system crashes on boot, sometime bluetooth crashes on boot, sometimes the dialer crashes... But with non-root apps, this thing SCREAMS!
Also, CM7 incorporates it's own memory management system that works better than the Moto Blur based ROMs. Just my two cents.
Ciao!
Moonshadow, thanks for the explanation. I did do a search and for some reason, your post didn't come up. Now that I search, I find it. I'll attribute it to an ID-10T or PEBKAC error.
iBolski said:
I'll attribute it to an ID-10T or PEBKAC error.
Click to expand...
Click to collapse
Are you REALLY sure about that??? It could be that Google just hiccuped during that nanosecond that your search on XDA was running... And didn't affect anyone elses searches...
You can be like Apple and blame/sue everyone else... (Just joking!)
Ciao!
Besides cm 7 does not need any script runs good as it is.
So all I want to be able to do is run some linux commands from startup....can this be added to the stock kernel with minimal effort?
My real goal is just to set the TTL value to 65 (to avoid tethering detection).....as far as I know the only way to do that right now is to change it on boot up with a startup type command. Any way to either run a command via init.d or rc.local or something similar or permanently change the TTL value?
Already done, check mine in development, unless you want 100% bone stock no other tweaks to init, ifthats the case let me know I'll make a new boot.img when I can
I will check it out. Thanks!
I put the following script in my /system/etc/init.d/ folder
Code:
#!/system/bin/sh
iptables -P OUTPUT DROP
On my Samsung GalaxyS - CM10 - Semaphore Kernel, it is applied at boot time as it should.
On my Galaxy Tab 2 7 CM9 (CM Kernel) on the other hand, it is not getting applied.
WHY ?
I've already checked: The scripts in the init.d-folder indeed do get executed.
And there wasn't also anything useful in the logcat either (nor did I find evidence that something flushed/overwrote iptables).
My next guess would be that the netfilter/iptables isn't loaded yet while init.d is still being processed.
Is there a way to load iptables manually upfront?
Thanks for your thoughts.
init.d iptables drop
The same problem. Sony Xperia stock, rooted.
I've made "iptables drop" script for init.d to prevent data leak BEFORE firewall loads.
It works. But sometimes script doesn't affect iptables, or something overwrites it.
Don't know what to do :/
Hi
I would like to reopen the topic.
I have written an init service which is executed by the init.rc script. This service set a new iptables configuration. I have checked all the outputs and it seems to work, but a later service overwrites my settings.
Does anyone know which service this and if it also has been executed by the init.rc script or later?
Otherwise I have to write a wrapper over iptables which only accepts my commands.
Regards,
cloooned
It seems like lucky random.
Your init script can be executed before or after tool-that-overwrites. The only way is to make delays and re-execute.
Anyway, phone wont be protected for some small period during boot.
Hello. I have a question about rules in afwall. I want to lock qq and wechat. It works very well. However, I used this app on mobile phones of a company. I need to uninstall afwall again. Is it possible to copy the created rules into init.d in order to keep them running without the app? Where can I find the file with the rules?
thanks...
micky1067 said:
Hello. I have a question about rules in afwall. I want to lock qq and wechat. It works very well. However, I used this app on mobile phones of a company. I need to uninstall afwall again. Is it possible to copy the created rules into init.d in order to keep them running without the app? Where can I find the file with the rules?
thanks...
Click to expand...
Click to collapse
This should be in the AFWALL+ thread however it can export the rules and with that you can turn it into a script and load it at boot. To lock qq and webchat you need to know the GUID and block that but be warned that turning on or off network interfaces deletes IPTables
I'm trying to get a script to execute via init.d or even in the terminal ... sh ./script but am running into issues that I'm not sure why or what is happening. I can't get the script to even execute via command line with the terminal app...so I need to figure that out first then maybe init.d will work. I can however execute the command in the script just fine, so I am not sure what is going on. It should be a simple script that I've seen posted on XDA. I started a thread over on the blaze dev section buy have been told it would fit here better so I'm posting a link to what I've already done.
http://forum.xda-developers.com/showthread.php?p=45042841#post45042841
As you can see from that link and the screenshot the execution of the script fails but I can echo that string in just fine. I'd like to get this scripted to it will work on boot and hopefully find a way to make it run before apps start starting so the sd card will prepare faster and the files I have apps linked to will be present when there requested...which is a problem.
Thanks!