I need some help with unpacking/repacking a kernel zImage to add a line to the init.rc but I can't seem to get anyone to help. Is there anyone here who is familiar with this process that could help me? All I need is one line added to the init.rc so it will load the ext3 partition for apps2sd at boot. Thanks.
Related
Hi there!
I've been messing around with my Samsung Galaxy 5 (GT-I5500), Android 2.1-1 but can't for the life of me find out where the /init.rc come from!
I managed to get the contents of recovery.img ramdisk, but the init.rc that is there is ~ 1Kb, while the /init.rc from the device is ~18Kb (that I flashed with this same image that I extracted the ramdisk from).
I can remount / rw, but after reboot, the init.rc is back to what it was before. All I can think of is that it comes from some kind of ramdisk, but I can't find it.
Where does the /init.rc come from? How can I modify it?
Thanks!
Sharper-BR said:
Hi there!
I've been messing around with my Samsung Galaxy 5 (GT-I5500), Android 2.1-1 but can't for the life of me find out where the /init.rc come from!
I managed to get the contents of recovery.img ramdisk, but the init.rc that is there is ~ 1Kb, while the /init.rc from the device is ~18Kb (that I flashed with this same image that I extracted the ramdisk from).
I can remount / rw, but after reboot, the init.rc is back to what it was before. All I can think of is that it comes from some kind of ramdisk, but I can't find it.
Where does the /init.rc come from? How can I modify it?
Thanks!
Click to expand...
Click to collapse
It's in the boot.img file. You have to unpack the .img and then the ramdisk, but it's in there. dsixda's kitchen should do that for you. That's what I use to do it. If not, there used to be a site that explained all of that, but I cannot seem to get it to pull up in a browser.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
gnarlyc, do you know how to extract init.rc?
init.rc is stored inside ramdisk. you can extract it from a kernel. since it's stored inside the kernel, there's no way to modify except install a custom kernel.
Hey guys,
i have the following issue: I'm on stock KPN rom, stock kernel, etc. (only rooted and deodexed). I want to experiment al little bit with tweaking and stuff. What i am trying to do now is putting all the lines from a ramscript to my init.rc file to see what happens.
When i try this my phone saves the changes that i made, but when i reboot all the changes are gone. The same happens when i change the values in for example the lowmemorykiller file.
Does any one know something about this and how to keep all the changes?
Hope to hear from you guys.
Same problem for me. Why is this happening?
I think this is not a file permissions issue.
My English not good enough to explain. init.rc stored in initramfs (boot.img). initramfs mounted into memory at boot time, all changes to the initramfs only occur in memory rather than in boot.img. Only one way to change init.rc: unpack boot.img, change init.rc, then back repack boot.img. Learn how dsixda kitchen works to understand all this stuff
ketut.kumajaya said:
My English not good enough to explain. init.rc stored in initramfs (boot.img). initramfs mounted into memory at boot time, all changes to the initramfs only occur in memory rather than in boot.img. Only one way to change init.rc: unpack boot.img, change init.rc, then back repack boot.img. Learn how dsixda kitchen works to understand all this stuff
Click to expand...
Click to collapse
Hey Ketut,
thanks for your anwser. When i find the time i will try to understand a little more of this stuff.
Cheers
Where to find boot.img?
Sent from my GT-S5830 using Tapatalk
I was playing around with some scripts from Caulkin on some other versions of Froyo to try and improve performance. I have read up on the init.rc script and use of the init.d folder. I have set all this up and have edited the init.rc script to run the init.d scripts, but it gets overridden by the base init.rc on reboot. I had read somewhere that you cannot directly edit the init.rc and that it will be overridden on boot from the boot.img. Can someone confirm that? I thought most roms now have the ability to use init.d out of the box, but it doesn't look like it on Brilliant Corners. Can someone confirm that? Do you know of any Froyo ROMS, other than Caulkins, that has init.d capability? Thanks
markmac said:
I have set all this up and have edited the init.rc script to run the init.d scripts, but it gets overridden by the base init.rc on reboot.
Click to expand...
Click to collapse
Are you using the run-parts program?
I had read somewhere that you cannot directly edit the init.rc and that it will be overridden on boot from the boot.img. Can someone confirm that?
Click to expand...
Click to collapse
That's correct.
Thanks for the response. I was editing the init.rc directly which obviously won't work. So i need to look into building my own boot.img or another option. I was using run-parts setup as a service. I would have thought most kernels/ROMs would support this now, but it does not appear that way.
markmac said:
So i need to look into building my own boot.img or another option.
Click to expand...
Click to collapse
You don't need to build your own new image; you can just modify the existing one by flashing. Take a look at the attachements in these 2 posts where I've done just that. Just make sure the script is idempotent if other people will use it.
Post 1
Post 2
Thanks will definitely check this out.
Looked at this. So to update the init.rc file I would have to edit and package into a boot.img file, then flash the img file with adb or nvflash correct?
markmac said:
So to update the init.rc file I would have to edit and package into a boot.img file, then flash the img file with adb or nvflash correct?
Click to expand...
Click to collapse
No. That's too much work for the user. My technique is meant to be like flashing a new kernel. No external utilities are needed. Just CWM (or, possibly, even standard recovery).
Does any one know how can I unpack and repack ext4 system images using cygwin? can you give me the complete and understandable tutorials on it? I have tried all of the tutorials here in XDA, but it seems that I can't follow the right way. Please to someone, extend a helping hand on me.
Try this software it has helped me a lot
Nice Tool but i need something similar for userdata, or maybe the cygwin command to pack a folder in a sp_tool flushable img.
I have met some problem with boot.img and need some help if there's somebody know it.
I used unmkbootimg and mkbootimg, I unpacked a boot.img then got zimage and initramfs.cpio.gz, I repacked it without any edit but the new boot.img becames smaller, it changed from 13M to 7.9M, and the phone couldn't boot from new boot.img,
and there is no question if I use a boot.img extracted from an android3.x-version rom, but if the android version changes to 4.x, the unpack-repack process would lose much size...I tested on mi2s' rom......I don't know if there are some files that will be lost in unpack process, or say the process just ignore files other than zimage and initramfs...
does anybody knows why?
binghemoye said:
I have met some problem with boot.img and need some help if there's somebody know it.
I used unmkbootimg and mkbootimg, I unpacked a boot.img then got zimage and initramfs.cpio.gz, I repacked it without any edit but the new boot.img becames smaller, it changed from 13M to 7.9M, and the phone couldn't boot from new boot.img, does anybody knows why?
Click to expand...
Click to collapse
It could be because of incorrect settings for mkbootimg or there more files,than zImage and initramfs, needed for proper work. Hard to say without more information.
Sorry for my bad English.
B.B.N. said:
It could be because of incorrect settings for mkbootimg or there more files,than zImage and initramfs, needed for proper work. Hard to say without more information.
Sorry for my bad English.
Click to expand...
Click to collapse
There is no question if I use a boot.img extracted from an android3.x version rom, but if the android version changes to 4.x, the unpack-repack would lose much size...I tested on mi2s' rom......I don't know if there are some files that will be lost in unpack process, or say the process just ignore files other than zimage and initramfs...