init.d support


Acid

Scripting Ninja
Staff member
Aug 20, 2011
2,726
744
247
#2
You have to include run parts command to enable init.d in ramdisk - init.rc from unpacked kernel. Then repack the kernel and install the rom.
 
Nov 17, 2013
228
61
62
#8
Download any custom rom that support Init.D e.g. http://bbs.ydss.cn/forum.php?mod=viewthread&tid=459132&extra=page=1&filter=typeid&typeid=1993&typeid=1993 Extract boot.img. Create a .zip file with structure.

You can use updater script to write new kernel or ADB
My updater script
Code:
ui_print("****************************");
ui_print("*                          *");
ui_print("*      REDMI Unique      *");
ui_print("*      by REDMI Team      *");
ui_print("*        www.miui.cz      *");
ui_print("****************************");
show_progress(0.500000, 0);
ui_print("Installing update files...");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/system");
delete_recursive("/system/etc/init.d/");
package_extract_dir("system", "/system");
ui_print("Set permission...");
set_perm_recursive(0, 0, 0755, 0644, "/system/ota.prop");
set_perm_recursive(0, 0, 0755, 0644, "/system/rom.ota.prop");
set_perm(0, 0, 0755, "/system/etc/init.d/01MTKTweakCPU");
set_perm(0, 0, 0777, "/system/etc/init.d/02MTKTweakRam");
set_perm(0, 0, 0777, "/system/etc/init.d/03MTKTweakElse");
set_perm(0, 0, 0777, "/system/etc/init.d/04SDspeedfix");
set_perm(0, 0, 0777, "/system/etc/init.d/05Tweaks");
set_perm(0, 0, 0777, "/system/etc/init.d/06memery");
ui_print("Update Boot image...");
show_progress(0.200000, 0);
show_progress(0.200000, 10);
package_extract_file("boot.img", "/dev/bootimg");
unmount("/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p5", "/data");
package_extract_dir("data", "/data");
set_perm(0, 0, 0644, "/data/miui/gallery/city.db");
show_progress(0.100000, 0);
ui_print("****************************");
ui_print("*                          *");
ui_print("*      Install complete    *");
ui_print("*      Enjoy new ROM      *");
ui_print("*                          *");
ui_print("****************************");
unmount("/data");
Uni.init works. But is only for personal use. You cant make custom rom with init.d support. For this you need dsixda's Android Kitchen or use my solution
 

acn

Members
Jan 17, 2014
93
5
20
#9
Your procedure is not much simpler than extracting original boot.img and adding init.d support. Proces is already documented in detail on xda. No need to mix foreign boot.img into rom.