Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,988 Members 44,981 Now Online
XDA Developers Android and Mobile Development Forum

Adding a custom init.rc script

Tip us?
psych.half Old
#1  
Guest
Thanks Meter
Posts: n/a
Default Adding a custom init.rc script

i know we can add a init rc script.. by using..

import /init.something.rc in init.rc or init.<hardware>.rc

but they have to be included in the ramdisk.. so i have to like unpack boot.img, decompress ramdisk,
modify files, compress, repack, flash.. modify files, compress, repack flash.. @_@

is there some way i can get it to load a custom rc script.. in /system or some other partition? so i can just edit the rc script there..

i will add it later to ramdisk.. i just need this for testing.. is there some workaround for this??
 
moonbutt74
Old
#2  
moonbutt74's Avatar
Senior Member
Thanks Meter 229
Posts: 500
Join Date: May 2014
Default hey

Quote:
Originally Posted by psych.half View Post
i know we can add a init rc script.. by using..

import /init.something.rc in init.rc or init.<hardware>.rc

but they have to be included in the ramdisk.. so i have to like unpack boot.img, decompress ramdisk,
modify files, compress, repack, flash.. modify files, compress, repack flash.. @_@

is there some way i can get it to load a custom rc script.. in /system or some other partition? so i can just edit the rc script there..

i will add it later to ramdisk.. i just need this for testing.. is there some workaround for this??
go here
http://forum.xda-developers.com/show....php?t=2073775
The Following User Says Thank You to moonbutt74 For This Useful Post: [ Click to Expand ]
psych.half Old
#3  
Guest
Thanks Meter
Posts: n/a
Quote:
Originally Posted by moonbutt74 View Post
and i know how to unpack/repack boot.img and edit ramdisk... done it like hundereds times..

the problem is that the device i am working on does not have fastboot.. so testing my changes in ramdisk is really difficult...

i just want to add a custom rc script.. somewhere in /system partition.. so i can just edit the rc script there. without having to pack/repack the boot.img

something like this should be added in init.rc or init.<hardware>.rc
Code:
import /system/etc/init.custom.rc
but i don't know where to add that..
 
moonbutt74
Old
#4  
moonbutt74's Avatar
Senior Member
Thanks Meter 229
Posts: 500
Join Date: May 2014
Question hey

Quote:
Originally Posted by psych.half View Post
and i know how to unpack/repack boot.img and edit ramdisk... done it like hundereds times..

the problem is that the device i am working on does not have fastboot.. so testing my changes in ramdisk is really difficult...

i just want to add a custom rc script.. somewhere in /system partition.. so i can just edit the rc script there. without having to pack/repack the boot.img

something like this should be added in init.rc or init.<hardware>.rc
Code:
import /system/etc/init.custom.rc
but i don't know where to add that..
okay so, probably not what you really want but maybe useful
http://forum.xda-developers.com/gala...nit-d-t2135610
http://forum.xda-developers.com/show....php?t=1276578

maybe enabling the boot script thing and biting the bullet for a one time dd will work out
when i'm testing something i switch my boot and recovery to save button ware [DON'T DO THAT IF YOUR SANE!!]
else you'll have to find some way to get the fastboot thing going, maybe test in emulator instead?
The Following User Says Thank You to moonbutt74 For This Useful Post: [ Click to Expand ]
psych.half Old
#5  
Guest
Thanks Meter
Posts: n/a
Quote:
Originally Posted by moonbutt74 View Post
okay so, probably not what you really want but maybe useful
http://forum.xda-developers.com/gala...nit-d-t2135610
http://forum.xda-developers.com/show....php?t=1276578

maybe enabling the boot script thing and biting the bullet for a one time dd will work out
when i'm testing something i switch my boot and recovery to save button ware [DON'T DO THAT IF YOUR SANE!!]
else you'll have to find some way to get the fastboot thing going, maybe test in emulator instead?
that requires, the root filesystem to be rw.. the initramfs is saved in mmc... :| i will have to look into implementing it..

i have done that.. OwO

hmm.. i will see..
anyways thanks for helping...
 
moonbutt74
Old
#6  
moonbutt74's Avatar
Senior Member
Thanks Meter 229
Posts: 500
Join Date: May 2014
Question confused

Quote:
Originally Posted by psych.half View Post
that requires, the root filesystem to be rw.. the initramfs is saved in mmc... :| i will have to look into implementing it..

i have done that.. OwO

hmm.. i will see..
anyways thanks for helping...
so, you're not rooted?
can you adb?
what device?
psych.half Old
#7  
Guest
Thanks Meter
Posts: n/a
Quote:
Originally Posted by moonbutt74 View Post
so, you're not rooted?
can you adb?
what device?
i am rooted.. :| i meant, changes to root filesystem are lost on reboot..
the rw kernel mentioned there saves the changes to rootfilesystem...

yeah.. adb works :v
 
moonbutt74
Old
#8  
moonbutt74's Avatar
Senior Member
Thanks Meter 229
Posts: 500
Join Date: May 2014
Question fastboot...

Quote:
Originally Posted by psych.half View Post
i am rooted.. :| i meant, changes to root filesystem are lost on reboot..
the rw kernel mentioned there saves the changes to rootfilesystem...

yeah.. adb works :v
maybe something helpful in this
http://forum.xda-developers.com/show....php?t=2317790

so what device ? what are you trying to achieve?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Calc+ is a Smart and Beautiful Android Calculator

As we’ve said inthe past, there are quite a few calculators available on Android. … more

Get Better Debug Data with Crash Report SDK

Developing an application is a hard and often times ungratifying task. It also requires quite a … more

Navigate to Your Favorite Places with LocationDetector

If you’re enjoying an active way of life, you probablytravel a lot, go fishing, … more

LifeStats Automatic Journal Keeps Tabs of Your Day

Most of us live very active lives. This is after all why we’re fans of mobile … more