Hello,
I want to change my voodoo colors at boot, so I made a script in init.d folder:
Code:
#!/system/bin/sh
echo 2447339790 >/sys/devices/virtual/misc/voodoo_color/red_multiplier
echo 2159029280 >/sys/devices/virtual/misc/voodoo_color/green_multiplier
echo 2782492160 >/sys/devices/virtual/misc/voodoo_color/blue_multiplier
echo -14 >/sys/devices/virtual/misc/voodoo_color/red_v1_offset
echo -17 >/sys/devices/virtual/misc/voodoo_color/green_v1_offset
echo -18 >/sys/devices/virtual/misc/voodoo_color/blue_v1_offset
And here is my init.d folder : http://i.imgur.com/nhkdy.png , 99voodoo is my script.
When I paste this codes to android terminal emulator, it is working flawlessly.
But it does not work in init.d folder. Tried different roms which support init.d scripting, but no luck.
What is wrong with it? Can anyone help?
Thanks.
I had the same issue with couple of kernels not sure why im prety sure they even support (Eugene and glados)
you have to set full permissions on the script also but still didn't work for me
I gave up and just used ROM toolbox and made it run at startup works no problem
There must be a solution. What am I doing wrong!?
Do you have Busybox installed?
Hostile89 said:
Do you have Busybox installed?
Click to expand...
Click to collapse
Yes, preinstalled with the rom I've been using:
http://forum.xda-developers.com/showthread.php?t=1397358
features "root, busybox, zipalign, Bash, init.d scripts ... etc".
Any help? No solution?
What is your ROM and kernel combination?
I was using Aosp+ Rom and ICUP-Speedy-3 kernel.
Now, I have just flashed CyberGR rom. Comes with GLaDOS 2.7 kernel. Feature list says "Init.d scripts support", but no luck for me. My script doesn't work with this rom too. What is wrong with it :S
I found the solution.
I was trying to move my script to init.d folder manually via RootExplorer app.
But pushing the same file via adb just worked.
Thanks to this: http://forum.xda-developers.com/showthread.php?t=1424032
Related
Can anyone confirm that UC V9 kernel has proper support for init.d scripts? I have tried several scripts and checked the values through terminal emulator and it seems that none of the scripts are executed. I'm on stock KPQ with UC V9 kernel.
Thanks a lot!
I can't test it because I'm not currently using UC kernel, but are you sure that those scripts are executable or that there aren't other scripts that override your settings? When I used it (an older version) they worked.
Code:
ls -l /etc/init.d
This will show a list all your scripts with their permissions. They should be
Code:
rwxr-xr-r
Or try to execute one of the scripts and see if the values you want to change effectively change.
UC kernel V9 has support for init.d scripts! As they said.
And, I did test it with a older version!
Sent from my I9100 using XDA app
I've tried repeatedly and finally I've realised that it was the scripts that were not working. UC V9 kernel supports scripts seemlessly via /system/etc/init.d.
Thank you guys for your replies!
I need help figuring out why one script runs and another does and it doesn't help with the fact that I'm still quite new to Shell Scripting, let alone running them in CWM on Android devices.
Here's my problem:
This works:
Code:
#!/sbin/sh
busybox echo "#BlahBlahBlah" >> /system/build.prop
This will not:
Code:
#!/sbin/sh
busybox sed -e '/#BlahBlahBlah/d' /system/build.prop > /system/build.prop.bak
Yet, the above WILL run inside the OS. If I boot up fully and use something like Script Manager or Busybox Installer (the script running function) and run the above... it works.
But, in CWM, it doesn't.
I'm trying to use this to make an uninstaller for certain mods that write to the build.prop. So far, my only method for doing this is to copy over a new, unmodded build.prop, which is not very elegant and only works for one type of phone.
Any help would be greatly appreciated
Kryten2k35 said:
I need help figuring out why one script runs and another does and it doesn't help with the fact that I'm still quite new to Shell Scripting, let alone running them in CWM on Android devices.
Here's my problem:
This works:
Code:
#!/sbin/sh
busybox echo "#BlahBlahBlah" >> /system/build.prop
This will not:
Code:
#!/sbin/sh
busybox sed -e '/#BlahBlahBlah/d' /system/build.prop > /system/build.prop.bak
Yet, the above WILL run inside the OS. If I boot up fully and use something like Script Manager or Busybox Installer (the script running function) and run the above... it works.
But, in CWM, it doesn't.
I'm trying to use this to make an uninstaller for certain mods that write to the build.prop. So far, my only method for doing this is to copy over a new, unmodded build.prop, which is not very elegant and only works for one type of phone.
Any help would be greatly appreciated
Click to expand...
Click to collapse
Same problem here; have you found a solution?
I've been running the ElementalX kernels on HatkaXL Rom, and they run fine, but they don't seem to be applying any of the custom settings using /etc/init.d/99elementalx. If I run it manually (using adb shell), it does work (loads all the modules, can see them using lsmod, and also adds the cpu governers, which I can see in kernel tuner).
I've been trying to figure out why my init.d script isn't running, and I'm stuck. Here's what I've tried:
* Flash boot.img manually using fastboot
* Update permissions to init.d scripts manually (they're all a+rwx and owned by root:root)
* boot boot.img manually (fastboot boot boot.img)
All of these methods fail in running my init.d scripts. As far as I can tell the init.rc inside the boot image is running the init scripts correctly (using run-parts).
Why aren't my init.d scripts running?
Any pointers on how to debug this further would be greatly appreciated.
I'm using one of the first batches of One XL's (AT&T) and am still running hboot 1.09.
I don't know anything about this stuff but I know having cpu app like kernel tuner set to run at boot can cause problems.
Sent from my VenomXL using Xparent Red
ImagioX1 said:
I don't know anything about this stuff but I know having cpu app like kernel tuner set to run at boot can cause problems.
Sent from my VenomXL using Xparent Red
Click to expand...
Click to collapse
Ah, I should have added that I disabled Kernel Tuner running at boot, and merely use it to verify my cpu settings/tweaks are indeed applied.
thatdutchguy said:
I've been running the ElementalX kernels on HatkaXL Rom, and they run fine, but they don't seem to be applying any of the custom settings using /etc/init.d/99elementalx. If I run it manually (using adb shell), it does work (loads all the modules, can see them using lsmod, and also adds the cpu governers, which I can see in kernel tuner).
I've been trying to figure out why my init.d script isn't running, and I'm stuck. Here's what I've tried:
* Flash boot.img manually using fastboot
* Update permissions to init.d scripts manually (they're all a+rwx and owned by root:root)
* boot boot.img manually (fastboot boot boot.img)
All of these methods fail in running my init.d scripts. As far as I can tell the init.rc inside the boot image is running the init scripts correctly (using run-parts).
Why aren't my init.d scripts running?
Any pointers on how to debug this further would be greatly appreciated.
I'm using one of the first batches of One XL's (AT&T) and am still running hboot 1.09.
Click to expand...
Click to collapse
I haven't used that rom, does it have busybox? Does 99elementalx have execute permissions (eg: chmod 777 /etc/init.d/99elementalx)
There is an easier workaround. Edit /etc/init.qcom.post_boot.sh and add /system/etc/init.d/99elementalx at the very bottom. Ensure init.qcom.post_boot.sh has execute permission.
flar2 said:
I haven't used that rom, does it have busybox? Does 99elementalx have execute permissions (eg: chmod 777 /etc/init.d/99elementalx)
There is an easier workaround. Edit /etc/init.qcom.post_boot.sh and add /system/etc/init.d/99elementalx at the very bottom. Ensure init.qcom.post_boot.sh has execute permission.
Click to expand...
Click to collapse
I'll try that. I added busybox myself (I think it was already on there too though) and permissions seem to all be right. It even loads the wp_mod, but I can't figure out where it loads it.
Stay tuned to see if that worked
*update*
I added:
Code:
busybox run-parts /system/etc/init.d
to my /system/etc/init.qcom.post_boot.sh, and that solved my problem.
Still wonder why it was not running init.d to begin with, since I see a similar snippet in init.rc (inside the boot.img).
What is init.d ?
Init.d is a feature which allows you to run brunch of scripts at boot . Thats really useful while you want to set values which reset at boot or run/do any thing at every boot or install tweaks , engines and....
There are some ways to add this feature to you rom but always best way is to add init.d support directly by your kernel . I want to help you to do this
Requirements
1- Ability to unpack boot.img & ramdisk
2- Some basic linux shell knowloedge
3- Having Busybox located in /system/bin/busybox at your rom
Step 1: Making kernel ready
1- Unpack kernel then ramdisk
2- Open Init.rc with a text editor
3- Add this codes at the end , before the paragraph which there is "stop bootanim" command in it :
Code:
service sysinit /system/bin/sysinit
oneshot
4- Save , Exit and repack ramdisk and boot.img
Step 2 : Making Rom Ready !
1- Open /system/bin/sysinit
2- Add this codes :
Code:
#!/system/bin/sh
export PATH=${PATH}:/system/bin:/system/xbin
chmod 777 /system/etc/init.d/*
logwrapper busybox run-parts /system/etc/init.d/
3- Set permissions of sysinit to 777 or 755 ( rwxrwxr-x | rwxrwxrwx )
4- Make a directory at system/etc and name it init.d
Now you have init.d support !
Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.:victory:
Someone had to document this ^^, good job
RobyRc said:
Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.:victory:
Click to expand...
Click to collapse
Pimp uses one of the worst method to add this feature to your ROM ! it doesn't effect on kernel so : 1- running init.d is slower 2- init.d is not stable at all 3- not usable for ones want to add this feature to his/her kernel 4- not run init.d at end of boot so some script which needs some binaries that are not loaded yet doesn't work 5- Can not be used for room devs
This method is the official method which is used on most famous kernels such as brood kernel . and best for devs and users
any way that depends on users idea that this is good or not
RobyRc said:
Bull*hit. JUST INSTALL pimpmyrom and finish ..Easy.:victory:
Click to expand...
Click to collapse
Why are you so rude?
There are ways and ways to express own opinions... And alireza has just explained you why this method is better then PIMPMYROM.
Sent from my AriesVe using xda premium
alireza7991 said:
Pimp uses one of the worst method to add this feature to your ROM ! it doesn't effect on kernel so : 1- running init.d is slower 2- init.d is not stable at all 3- not usable for ones want to add this feature to his/her kernel 4- not run init.d at end of boot so some script which needs some binaries that are not loaded yet doesn't work 5- Can not be used for room devs
This method is the official method which is used on most famous kernels such as brood kernel . and best for devs and users
any way that depends on users idea that this is good or not
Click to expand...
Click to collapse
You are wrong.
RobyRc said:
You are wrong.
Click to expand...
Click to collapse
well, if he is wrong you can explain why, he explained why according to him is better this way, you could explain why not
What happens if your ROM doesn't have /system/bin/sysinit?
vMAC said:
What happens if your ROM doesn't have /system/bin/sysinit?
Click to expand...
Click to collapse
* Your rom has sysinit -> You have already init.d support and no need to this guide
* Your rom has'nt it -> You need to do my guide to get init.d support
alireza7991 said:
* Your rom has sysinit -> You have already init.d support and no need to this guide
* Your rom has'nt it -> You need to do my guide to get init.d support
Click to expand...
Click to collapse
And is it possible to create sysinit and init.d folder with an updater script?
GT-af said:
And is it possible to create sysinit and init.d folder with an updater script?
Click to expand...
Click to collapse
sure but do'nt forget :
1- your kernel must support init.d ( look at first post step 1)
2- do step 2 at fist post on sys init or you wo'nt have init.d support !
I have MTK 6577 device this will work ?
andrman1 said:
I have MTK 6577 device this will work ?
Click to expand...
Click to collapse
all android devices are supported
alireza7991 said:
all android devices are supported
Click to expand...
Click to collapse
In init.rc file I haven't code "stop bootanim" why and where I put this code ?
And I haven't in /system/bin file "sysinit" ?
andrman1 said:
In init.rc file I haven't code "stop bootanim" why and where I put this code ?
And I haven't in /system/bin file "sysinit" ?
Click to expand...
Click to collapse
Place those codes on the middle of init.rc ; the only difference is execute order . if you put it at first init.d wont execute becuase we have'nt system mounted still and if you put it at the end you will stop at your homescreen for a few secound so its better to execute it while you are seeing bootanimation
make new file name it sysinit and put codes siad in OP inside it .
Step 2 : Making Rom Ready !
1- Open /system/bin/sysinit
2- Add this codes :
Code:
#!/system/bin/sh
export PATH=${PATH}:/system/bin:/system/xbin
chmod 777 /system/etc/init.d/*
logwrapper busybox run-parts /system/etc/init.d/
Is this needed?
I've seen some ROMs not having /system/bin/sysinit but init.d kernel support, and I've tested a ROM myself not having this file, but the
99test init.d script gave some output to /data/tmp. So I guess it was executed properly.
t-ryder said:
Step 2 : Making Rom Ready !
1- Open /system/bin/sysinit
2- Add this codes :
Code:
#!/system/bin/sh
export PATH=${PATH}:/system/bin:/system/xbin
chmod 777 /system/etc/init.d/*
logwrapper busybox run-parts /system/etc/init.d/
Is this needed?
I've seen some ROMs not having /system/bin/sysinit but init.d kernel support, and I've tested a ROM myself not having this file, but the
99test init.d script gave some output to /data/tmp. So I guess it was executed properly.
Click to expand...
Click to collapse
There are many ways to get init.d working , you may include sysinit in init.rc or you may completely remove it and use a direct code in init.rc to execute init.d scripts or ....
Here in this method , I used sysinit in user-space to let init.d be dynamicly modifed or removed without repacking the kernel
alireza7991 said:
There are many ways to get init.d working , you may include sysinit in init.rc or you may completely remove it and use a direct code in init.rc to execute init.d scripts or ....
Here in this method , I used sysinit in user-space to let init.d be dynamicly modifed or removed without repacking the kernel
Click to expand...
Click to collapse
So just the file
Code:
#!/system/bin/sh
export PATH=${PATH}:/system/bin:/system/xbin
chmod 777 /system/etc/init.d/*
logwrapper busybox run-parts /system/etc/init.d/
would make it run (having busybox in /xbin) without having to mess around in the kernel using e.g. virtous ten studio?
t-ryder said:
So just the file
Code:
#!/system/bin/sh
export PATH=${PATH}:/system/bin:/system/xbin
chmod 777 /system/etc/init.d/*
logwrapper busybox run-parts /system/etc/init.d/
would make it run (having busybox in /xbin) without having to mess around in the kernel using e.g. virtous ten studio?
Click to expand...
Click to collapse
there are many strange and not suggested methods which add init.d without repacking kernel but the best method is using init.rc .
But I have some ideas on getting init.d working withouy messing around kernel . I am going to test them ;
alireza7991 said:
there are many strange and not suggested methods which add init.d without repacking kernel but the best method is using init.rc .
But I have some ideas on getting init.d working withouy messing around kernel . I am going to test them ;
Click to expand...
Click to collapse
Hi; I googled for a while to find a way to add init.d to my ROM and found your thread. Can you also explain how to adjust the source tree before compilation that I get the init.d? I am compiling AOSP with the stock kernel. I saw a few posts before that this method just works for a kernel which supports init.d. I have no clue if the stock kernel does. Thanks
Make a Nandroid backup first!!
For Stock Lollipop:
You will need to install busybox for the init.d support on your phone. Follow these instructions:
http://forum.xda-developers.com/showpost.php?p=32716412&postcount=2
The guide provides a test script that you need to flash to ensure it works properly. Once you install init.d and it is working properly push the file below
For Custom Roms:
Typically init.d and busybox are included. If it doesn’t support it then install using the method above. If it does support init.d and already has busybox push the file below. I would download the test script above just to make sure the init.d works properly.
The Viper4Android script file contains the following:
Code:
#!/system/bin/sh
/system/xbin/supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };"
Resource:
http://forum.xda-developers.com/showpost.php?p=60672119&postcount=18334
Push file to system/etc/init.d folder and set the right permissions (rwx-rwx-rwx). Remove the .txt at the end of the file.
The second file you will need to edit. Its the init.qcom.post_boot.sh. This is needed so the Viper4Android script continues to work after reboots. Open the file using ES File Explorer or something equivalent. The file is system/etc. Open init.qcom.post_boot.sh and scroll all the way to the end and add the following three lines. Make sure there is a empty line at the end.
Code:
# init.d support
run-parts /system/etc/init.d/
Download Viper4Android:
http://vipersaudio.com/blog/?page_id=48
Follow app installation instructions
Enjoy!!!
Here is a material dark one.
http://forum.xda-developers.com/showthread.php?t=3190352
Sent from my EVO using Tapatalk
Hi
The Viper4Android script doesnt work for me.
Tried to execute it manually through terminal and i get "Failure".
Can you help me out on that ? Am i missing out someting ?
PS : I had installed viper4android and even installed driver yet i see driver status abnormal and on every reboot it asks me to install driver again.
Thanks
SG
I don't get it. I followed all the instructions, I have init.d (kernel auditor confirms it), my device is rooted with busybox installed and it still says that busybox "does not work."
Suggestions?