Unpack & Repack Boot.img

Discussion in 'Android Hacks and Help' started by metiCkOne, May 27, 2010.

  1. metiCkOne
    Offline

    metiCkOne Premium Member Premium Member Developer

    Joined:
    Jan 17, 2010
    Messages:
    1,717
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Portland, OR/Boston, MA <-- Born N' Raised
    Okay so I am simply trying to be able to adb remount. To be able to do this I need to modify my default.prop file. From what I have read, I have been led to believe to do this I must unpack, edit and then repack the boot.img, since that is where it is located. I don't know if there is any truth to this or not. I can tell you that at this time all I want to do is be able to "adb remount". Can anyone help or point me to a place that has good info on it? I've been looking all day to no avail.
  2. LrdElderon
    Offline

    LrdElderon New Member

    Joined:
    Jan 10, 2010
    Messages:
    489
    Likes Received:
    0
    Trophy Points:
    0
    uhh what? where did you hear that from? Your phone has the rom installed already right? or are you trying to edit a rom not on the phone yet?

    If your adb works at all build.prop is in /system. You could something like root explorer and make the changes directly or just make a macro or copy a post that has the full mount command, then you can do whatever it is you were trying to do.

    mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
    do whatever it is ...
    sync
    reboot
    or to go back to Read only just put remount,ro instead of rw
    though I think you still need to reboot for build.prop changes so it would set that automatically back anyways.

    also how did you lose adb remount? it has nothing to do with build.prop. It's part of the sdk tools adb program. you just hook phone and type adb remount... im a little confused as to what you think or were told to do?

    unpacking repacking boot.img is for kernel changes. Like when I first started merging kernels for koush CM rom so we had others besides the default.


    but anyways sorry to answer the question directly. just plug in your phone with usb cord to computer, make sure usb debugging is turned on. make sure the sdk with adb is installed properly and adb works (is in path) then simply type adb remount that's it, it will say remount suceeded and then you can adb shell or whatever you want.
    Last edited: May 31, 2010
  3. metiCkOne
    Offline

    metiCkOne Premium Member Premium Member Developer

    Joined:
    Jan 17, 2010
    Messages:
    1,717
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Portland, OR/Boston, MA <-- Born N' Raised
    I appreciate you're help but I am trying to edit the default.prop not the build.prop. Here is one of my sources for the information I have on the matter. HOWTO: Unpack, Edit, and Re-Pack Boot Images - Android Wiki
    Last edited: May 31, 2010
  4. LrdElderon
    Offline

    LrdElderon New Member

    Joined:
    Jan 10, 2010
    Messages:
    489
    Likes Received:
    0
    Trophy Points:
    0
    woopsie, my bad. still, the question still remains how and why did you lose adb remount? did you accidentally change the config or did you use someone else's hacked kernel and got screwed?

    That was one of the pages I used to make the new kernels. what exactly are you having issue with? do exactly what it says starting from a little more then half way down at:

    you can compile mkbootimg yourself or download a pre compiled version. I believe a google search brings up an xda post with attachments?

    then follow instructions. after you seperate the kernel and have the directory setup with the ramdisk contents, default.prop is in the structure. change what you need and then keep following directions and put the two back together.

    It's actually very easy.

    sorry for being way off the mark there lol. I guess i needed some coffee still =) hope this post helped. if not just reply or whatever. I've done the whole split and merge many many times before we had other kernel options to the 2 bekit had (default and 1ghz overclock).
    Last edited: May 31, 2010
  5. metiCkOne
    Offline

    metiCkOne Premium Member Premium Member Developer

    Joined:
    Jan 17, 2010
    Messages:
    1,717
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Portland, OR/Boston, MA <-- Born N' Raised
    I really appreciate your help. I am learning how to mod roms, so I rooted and deodexed the most recent 2.1 ota. The problem is that you can not adb remount unless you edit the default.prop file and the only way I know to do that is to unpack and repack the boot.img. I read the post and everything but I can't figure out how to run the perl scripts. There weren't any clear instructions out there on how to do that. The part you need to change on the default.prop is secure=1 to secure=0. That is what allows adb remount and other commands.
  6. LrdElderon
    Offline

    LrdElderon New Member

    Joined:
    Jan 10, 2010
    Messages:
    489
    Likes Received:
    0
    Trophy Points:
    0
    are you on a linux distro or windows? if you are on a linux distro then the site shows you how to run the perl script right in the code box. just basically ./script.pl from the terminal

    windows I have no idea. I guess install perl and see if you get any options in the command prompt typing perl or pl or something?

    Here is the code box I was referring to that shows the exact commands

    the command being of course the first line with ./split_bootimg.pl boot.img(or whatever your bootimg is) the rest is just output from the command running.
  7. metiCkOne
    Offline

    metiCkOne Premium Member Premium Member Developer

    Joined:
    Jan 17, 2010
    Messages:
    1,717
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Portland, OR/Boston, MA <-- Born N' Raised
    Yeah, I'm running windows 7
  8. LrdElderon
    Offline

    LrdElderon New Member

    Joined:
    Jan 10, 2010
    Messages:
    489
    Likes Received:
    0
    Trophy Points:
    0
    yeah, not really familiar with using windows for development. better suited for c# or something.

    anyhow you can probably download cygwin for a unix on windows command prompt or install active perl i think it's called and then I think you can just edit the top part of the perl file in a text editor and delete the very first part of the program where it does the

    #!/usr/bin/perl.....etc

    other then that I don't know. I haven't used perl on windows in ages and most compiling is on linux distros, or macosx. I don't think I've seen a windows compiled kernel yet.

    or get like a vmware type program.

    maybe someone can pitch in if they know how to do this type of development in windows. I recommend ubuntu / kubuntu highly. it's just a nice easy to use system , you can use wubi so you don't mess up partitions or have to delete windows and you can use it as your development environment.

    hopefully you can figure the perl thing out.
    Last edited: May 31, 2010
  9. vijay4b7
    Offline

    vijay4b7 New Member

    Joined:
    Feb 1, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I have problem while extracting "boot.img-ramdisk.gz" file. I hope this is not getting created as zip file during the extracting process.

    I tried to read the contents in the file. But it has having binary code. Which confirms it is not a zip file. Any clues..?

    ---------- Post added at 11:53 AM ---------- Previous post was at 11:41 AM ----------

    Update:

    Is this the process it will do?

    .

    But I am getting this..

    Code:
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work3/ramdisk$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
    
    [COLOR="Red"][B]gzip: ../boot.img-ramdisk.gz: not in gzip format
    cpio: premature end of archive[/B][/COLOR]
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work3/ramdisk$ 
    
    Last edited: Feb 1, 2013
Search tags for this page
android boot.img unpack
,
boot img unpack windows
,
boot.img extract
,
boot.img tools
,
boot.img-ramdisk.gz: not in gzip format
,
cygwin .img bootavel
,
decompile boot.img
,
edit boot.img
,
extract-edit-repack-boot-img-windows
,
gzip: ../boot.img-ramdisk.gz: not in gzip format
,
gzip: boot.img-ramdisk.gz: not in gzip format
,
how to edit boot.img
,
mount boot.img
,

split bootimg.zip

,

unpack-bootimg.zip