[Q] init.d startup scripts don't seem to work - Galaxy 3 General

I've flashed Dharam's Stock Performance ROM. It has Fugumod kernel (etc/init.d support) and ZiplAlign, RamHack, etc...
But when I wanted to find the ZipAlign's log file I haven't found anything. There is a line in the zipalign script:
"LOG_FILE=/data/zipalign.log"
So it supposed to be "somewhere" a "zipalign.log" file. But there is no any zipalign.log, so there is no zipaligning at startup, so you can put any script in the folder "etc/init.d", it won't do anything... Right?
Or how can I check that the init.d scripts worked or not? And if the zipalign script didn't do anything, how I can get it work?

SRQ642 said:
I've flashed Dharam's Stock Performance ROM. It has Fugumod kernel (etc/init.d support) and ZiplAlign, RamHack, etc...
But when I wanted to find the ZipAlign's log file I haven't found anything. There is a line in the zipalign script:
"LOG_FILE=/data/zipalign.log"
So it supposed to be "somewhere" a "zipalign.log" file. But there is no any zipalign.log, so there is no zipaligning at startup, so you can put any script in the folder "etc/init.d", it won't do anything... Right?
Or how can I check that the init.d scripts worked or not? And if the zipalign script didn't do anything, how I can get it work?
Click to expand...
Click to collapse
its wrkin for me with fugumod ultra & 2.4beta... I use dis for underclocking cpu at d start up & prevent freezing..
Sent from my GT-I5800 using Tapatalk

I've figured out that the scripts have to be named like S* (e.g., S01_myscript, S02_zipalign)...
"------ Note for startups scripts
- Put your script in /system/etc/init.d
- Scripts with Filename starting with E* (earlystartup scripts) are executed before script with filename starting with S* (users scripts)
- Scripts are executed before playlogo and after init.rc"
from http://forum.xda-developers.com/showthread.php?t=997367

Related

permanently change $PATH

I'm trying to change $PATH to have /system/xbin/ before /system/bin/.
I could do this manually but I'm lazy, so I'm looking for a way to have it like that on boot. But no matter whether I change it in init.rc, fota.rc, recovery.rc, they're all back in the old order after a reboot.
Anyone know which file I have to change to make my path changes stick?
XlAfbk said:
I'm trying to change $PATH to have /system/xbin/ before /system/bin/.
I could do this manually but I'm lazy, so I'm looking for a way to have it like that on boot. But no matter whether I change it in init.rc, fota.rc, recovery.rc, they're all back in the old order after a reboot.
Anyone know which file I have to change to make my path changes stick?
Click to expand...
Click to collapse
The init.rc file is a part of the initramfs which is included in the kernel image (zImage). You need to change the init.rc and recompile the kernel with the updated initramfs to make the changes stick.
There is also a way to unpack and repack an existing kernel image, but IMHO recompiling the kernel is much simpler.
hm, compiling kernels isn't really my thing.
is there another way to insert commands into boot process or change path on startup?
XlAfbk said:
hm, compiling kernels isn't really my thing.
is there another way to insert commands into boot process or change path on startup?
Click to expand...
Click to collapse
I think if you have a kernel with init.d support, you can just drop a script in the init.d directory and it will get automatically executed.
I think all the custom kernels (at least ones based on Voodoo) have init.d support -- never actually tried this so I am not totally sure about this.
I'm using the hacked voodoo kernel for gingerbread, created a /init.d/test.rc with "export PATH ... " but it didn't work. Is it supposed to be a .rc script? supposed to work in gingerbread kernel?
edit: after a closer looks it seems that the script is not only not run but /init.d is completly and without a trace gone after rebooting

init.d script wont run

I have problem runing script from init.d folder. Script maked by link2sd work, but every script i add wont run on boot.
I set same permision liki in link2sd script... any idea?
when try to open script from init.d folder with root explorer there is no txt. :/
Have you tried script manager?
sent from my gt540 mur4ik RC0 806mhz
yes, it`s work when run script manueli... but not working when set run on boot.
goto data/local and edit the userinit and put this code in it
sh /system/etc/init.d/scriptname
that should force the script to run.
i dont have userinit in data/local
just to create it, or...?
yes just create a userinit.sh file then put the command in it
not working, strange...
can you upload the script you are trying to run so i can do some tests for you?
yes, it`s simple script to enable swap on swap partition. work fine when run it with gscript, script manager... but i want to run it auto on boot.
edit the script to look like this
Code:
#!/system/bin/sh
#
# enable swap on ext partition
#
echo 30 > /proc/sys/vm/swappiness
swapon /dev/block/mmcblk0p3
noup, mmcblk0p3: no such file or directory.
have you partitioned your sdcard properly and what way did you do it?
yes, i partitioned it with recovery. swap work fine when i run script manuele, or run comand with terminal. problem is than script wont run on boot, not only this one, v6 super charger wont run eather.
--------
i forgot, i use greendroid 2.0 and 666 infernal kernel
god thats odd what rom are you using mur4iks,joes or one of the softmod GB
greendroid 2.0 and 666 infernal kernel
this kernel hava init.d suport... i think.
it should support swap ok because init.d folder belongs to busybox which the ROM has i would say for you to get the best from your phone is to upgrade to a gingerbread rom preferably CM7 as it supports swap straight fro boot and it also allow V6 SuperCharger to run properly i can help with a 2.1 rom because i only had 2.1 on my phone for 30seconds before flashing a 2.2 CM6 rom.
i use CM7 before (mur4iks M6 was last i try), but every day there was some little bug, and i have big problem with battery, gps... so i went back to 2.1.
tnx for try helping me.
no problem sorry i couldn't help more.

[HACK] Run scripts at boot-time on stock rooted 3.2 without reflashing (nfs modules)

Hi,
When you want to perform some scripts at boot-time, there is two possibilities :
- modify init.rc, but it requires to reflashing the rootfs image (modification in / does not hold after a reboot),
- using an android app like script manager, which will load your scripts at java/dalvik platform boot-time.
I've managed to find a way based on activating tf-daemon, which is a script called by the asus/ventana initrc, but disabled at boot-time. Basically, we're re-enabling this daemon by setting the property tf.enable to yes, and then creating a script called tf-daemon and put it in /system/bin. Since this script is called by init.ventana.rc as root, you can put whatever you want inside this script.
I don't know what is the original purpose of this daemon, but probably it's used by the asus team for internal and debugging purpose.
Be aware that in the next firmware update, this possibility could disappear.Let's hope the asus team does not read this post. Or at least they could allow power users to call custom scripts at boot-time.
As a case study, you will find as attachment a script for loading nfs modules at boot-time.
PS: damn, can't upload. Here is a temporary link : http://dl.free.fr/hwTZ0YBq2
Untar the archive, then su, and sh install.sh
At reboot, you should have nfs modules loaded.
Good find:
I gave this a try just to load a couple of my own modules that work with the kernel I'm using. Works fine -- Thanks, -
Another method is to make a script and just call it in the init.rc. After a firmware update you only have to add the "exec myscript.sh" line to init.rc. I personally prefer this method because it allows me to control when the script is executed, whereas the tf-daemon method is always executed at the same point(AFAIK). Good research though, always nice to know all the boot calls.
Modifying the init.rc was my first shot, but the problem is that init.rc lies in ramdisk. So when trying to modify, the modification does not hold
after reboot. So a real modification involves to reflash rootfs with nvflash, too much hassle for me. The method I'm providing is for lazy ones. ;-)
nice find, but the link is dead, could you please provide a new link for the script?
also, how do I load nfs module for there is none under /lib/modules, compile the kernel myself?

MyMind's Kernel Swap

MyMinds_Kernel_Swap
===================
Based on AnyKernel, but pretty much rebuilt in every way so that it will actually work. So, many thanks to Koush for the idea.
The Idea and What It Does...
=======================
Some but not all of this script has been snippets here and there from ArchiKitchen and DSIXDA Kitchen.
This has allowed me to formulate a zip as such without the need to technically build from scratch saving me LOADS OF HOURS.
It currently uses my static compiled mkbootimg, unmkbootimg, and mkbootfs binaries to allow editing, and rebuilding of the boot.img.
Some serious modifications were made to get this to work successfully with MUCH DEBUGGING. If you change something and it breaks another function then that is on you!
# IT IS CURRENTLY STABLE!
1. It will pull your current boot.img using dd.
2. It will search for the Android! header in the boot.img and remove the unnecessary junk before it if needed to.
3. It will split the boot.img in to the kernel and ramdisk.
4. It will unpack the contents inside the ramdisk.
5. It will modify the default.prop file giving you insecure ADB. If you already have it then this will not affect you.
6. It will modify the init.rc file to give support for init.d. If you already have it then this will not affect you.
7. It will write to sysinit and install-recovery.sh for the completion of init.d support. If already done, then this will not affect you.
8. It will make the init.d folder under /system/etc on your device with required permissions.
9. It will place an init.d script to test to see if init.d is fully working. If it works, you will find a file called, HAS_INIT, located in the /dev directory of your device.
10. It will swap out the original kernel with a new prebuilt kernel upon rebuilding the new boot.img
11. It will repack you a new ramdisk using mkbootfs to be applied to your new boot.img upon rebuilding it.
12. It will remove your old modules and push your new modules that came with your new prebuilt kernel.
13. It will write your new boot.img to your boot partition using dd.
14. Hopefully, more to come!
MAKE SURE YOU CHANGE...
=======================
"$BOOT_PARTITION" ACCORDING TO YOUR DEVICE BEFORE USING THIS SCRIPT!!!!!!
How to use it...
==============
1. Place your prebuilt kernel in the prebuilt folder and insure it is named, zImage.
2. Place kernel modules in the modules folder.
3. Zip, and flash in TWRP recovery.
If you have any suggestions then let me know. My ears are open to them.
https://github.com/ModdingMyMind/MyMinds_Kernel_Swap
Sent from my C525c using Tapatalk

How to add init.d in galaxy Y ?

I am using stock kernel and Hyperion9 rom. I want to add init.d support. I dont want to install any app like Universal Init.d for init.d support.
I have created init.d directory in /system/etc & sysinit file in /system/bin , as mentioned in other xda threads.
But When I add '/system/bin/sysinit' or 'exec /system/bin/sysinit' to init.rc and init.bcm21553.rc. Then I repack & flash the modified boot.img.
Nothing happens. Scripts present in init.d donot run on boot. I have checked the file permissions. All are OK.
Please guide me, Where should I add '/system/bin/sysinit' ?

Categories

Resources