DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Results 1 to 9 of 9

Thread: Unpack & Repack Boot.img

  1. Beta Team
    metiCkOne's Avatar
    Member #
    28203
    Join Date
    Jan 2010
    Location
    Portland, OR/Boston, MA <-- Born N' Raised
    Posts
    1,717
    Phone
    Droid
    DroidForums.net Developer
    Premium Member
    #1

    Unpack & Repack Boot.img

    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. Master Droid
    LrdElderon's Avatar
    Member #
    26076
    Join Date
    Jan 2010
    Posts
    489
    Phone
    Motorola Droid - Verizon
    #2
    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 by LrdElderon; 05-31-2010 at 01:06 PM.
  3. Beta Team
    metiCkOne's Avatar
    Member #
    28203
    Join Date
    Jan 2010
    Location
    Portland, OR/Boston, MA <-- Born N' Raised
    Posts
    1,717
    Phone
    Droid
    DroidForums.net Developer
    Premium Member
    #3
    Quote Originally Posted by LrdElderon View Post
    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 succeeded and then you can adb shell or whatever you want.
    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 by metiCkOne; 05-31-2010 at 05:43 PM.
  4. Master Droid
    LrdElderon's Avatar
    Member #
    26076
    Join Date
    Jan 2010
    Posts
    489
    Phone
    Motorola Droid - Verizon
    #4
    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:

    Alternative Method
    Download split_bootimg.zip . This Zip file contains one Perl file, split_bootimg.pl, which reads the boot.img header (according to the bootimg.h of the Android source code) to extract the kernel and ramdisk. The script also outputs the kernel command line and board name (if specified).
    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 by LrdElderon; 05-31-2010 at 07:58 PM.
  5. Beta Team
    metiCkOne's Avatar
    Member #
    28203
    Join Date
    Jan 2010
    Location
    Portland, OR/Boston, MA <-- Born N' Raised
    Posts
    1,717
    Phone
    Droid
    DroidForums.net Developer
    Premium Member
    #5
    Quote Originally Posted by LrdElderon View Post
    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:

    Alternative Method
    Download split_bootimg.zip . This Zip file contains one Perl file, split_bootimg.pl, which reads the boot.img header (according to the bootimg.h of the Android source code) to extract the kernel and ramdisk. The script also outputs the kernel command line and board name (if specified).
    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).
    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. Master Droid
    LrdElderon's Avatar
    Member #
    26076
    Join Date
    Jan 2010
    Posts
    489
    Phone
    Motorola Droid - Verizon
    #6
    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

    % ./split_bootimg.pl boot.img
    Page size: 2048 (0x00000800)
    Kernel size: 1388548 (0x00153004)
    Ramdisk size: 141518 (0x000228ce)
    Second size: 0 (0x00000000)
    Board name:
    Command line: no_console_suspend=1
    Writing boot.img-kernel ... complete.
    Writing boot.img-ramdisk.gz ... complete.
    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. Beta Team
    metiCkOne's Avatar
    Member #
    28203
    Join Date
    Jan 2010
    Location
    Portland, OR/Boston, MA <-- Born N' Raised
    Posts
    1,717
    Phone
    Droid
    DroidForums.net Developer
    Premium Member
    #7
    Yeah, I'm running windows 7
  8. Master Droid
    LrdElderon's Avatar
    Member #
    26076
    Join Date
    Jan 2010
    Posts
    489
    Phone
    Motorola Droid - Verizon
    #8
    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 by LrdElderon; 05-31-2010 at 09:20 PM.
  9. Droid Newbie
    vijay4b7's Avatar
    Member #
    329548
    Join Date
    Jan 2013
    Posts
    1
    Phone
    Micromax A110 & A70
    #9

    Unhappy

    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.

    - Now extract your ramdisk to make modifications for example.

    Code:
    mkdir ramdisk
    cd ramdisk
    gzip -dc ../boot.img-ramdisk.gz | cpio -i
    cd ..
    - Make the required modifications.
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$ ./split_bootimg.pl boot.img
    Page size: 2048 (0x00000800)
    Kernel size: 3477896 (0x00351188)
    Ramdisk size: 596322 (0x00091962)
    Second size: 0 (0x00000000)
    Board name:
    Command line:
    Writing boot.img-kernel ... complete.
    Writing boot.img-ramdisk.gz ... complete.
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$ ls
    boot.img data/ LeWa_A919build.1.09.zip META-INF/ repack_bootimg.pl* split_bootimg.pl*
    Bootimgutils.zip installbusybox logo.bin mkbootimg* sdcard/ system/
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$ mkdir ramdisk
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$ ls -lrt
    total 336788
    -rwxrwxrwx 1 vramaraj sw-team 28614 Dec 24 2010 mkbootimg*
    -rwxrwxrwx 1 vramaraj sw-team 6773 Jul 17 2011 split_bootimg.pl*
    -rwxrwxrwx 1 vramaraj sw-team 569 Jul 17 2011 repack_bootimg.pl*
    drwxr-xr-x 3 vramaraj sw-team 4096 Oct 9 2011 data/
    -rw-r--r-- 1 vramaraj sw-team 70 May 16 2012 installbusybox
    drwxr-xr-x 4 vramaraj sw-team 4096 Oct 6 19:03 sdcard/
    -rw-r--r-- 1 vramaraj sw-team 333103 Jan 10 16:02 logo.bin
    drwxr-xr-x 16 vramaraj sw-team 4096 Jan 21 06:20 system/
    -rw-r--r-- 1 vramaraj sw-team 4079616 Jan 21 21:07 boot.img
    -rw-r--r-- 1 vramaraj sw-team 15413 Jan 31 21:58 Bootimgutils.zip
    -rw-r--r-- 1 vramaraj sw-team 197379000 Jan 31 21:59 LeWa_A919build.1.09.zip
    drwxr-xr-x 3 vramaraj sw-team 4096 Jan 31 21:59 META-INF/
    -rw-r--r-- 1 vramaraj sw-team 3477896 Jan 31 22:00 boot.img-kernel
    -rw-r--r-- 1 vramaraj sw-team 596322 Jan 31 22:00 boot.img-ramdisk.gz
    drwxr-xr-x 2 vramaraj sw-team 4096 Jan 31 22:00 ramdisk/
    -rw-r--r-- 1 vramaraj sw-team 138215424 Jan 31 22:14 YONIP_MP_A919_v1.zip

    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2$ cd ramdisk
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2/ramdisk$ gunzip -c ../boot.img-ramdisk.gz | cpio -i

    gunzip: ../boot.img-ramdisk.gz: not in gzip format
    cpio: premature end of archive
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2/ramdisk$ unzip ../boot.img-ramdisk.gz
    Archive: ../boot.img-ramdisk.gz
    End-of-central-directory signature not found. Either this file is not
    a zipfile, or it constitutes one disk of a multi-part archive. In the
    latter case the central directory and zipfile comment will be found on
    the last disk(s) of this archive.
    unzip: cannot find zipfile directory in one of ../boot.img-ramdisk.gz or
    ../boot.img-ramdisk.gz.zip, and cannot find ../boot.img-ramdisk.gz.ZIP, period.
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2/ramdisk$ tar zvf ../boot.img-ramdisk.gz
    tar: You must specify one of the `-Acdtrux' options
    Try `tar --help' or `tar --usage' for more information.
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2/ramdisk$ tar xvf ../boot.img-ramdisk.gz
    tar: This does not look like a tar archive
    tar: Skipping to next header
    tar: Archive contains obsolescent base-64 headers
    tar: Read 2402 bytes from ../boot.img-ramdisk.gz
    tar: Error exit delayed from previous errors
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2/ramdisk$
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work2/ramdisk$
    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?

    gzip decompresses the ramdisk archive to stdout, pipe it into cpio with the -i switch to read from stdin and it will correctly extract the data
    .

    But I am getting this..

    Code:
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work3/ramdisk$ gzip -dc ../boot.img-ramdisk.gz | cpio -i
    
    gzip: ../boot.img-ramdisk.gz: not in gzip format
    cpio: premature end of archive
    vramaraj@hq1-up-swe-09:~/VIJAY/andriod/work3/ramdisk$
    Last edited by vijay4b7; 01-31-2013 at 11:45 PM.

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. boot animations and a question about the incredible boot image
    By mr4r4n in forum Android Hacks and Help
    Replies: 2
    Last Post: 05-18-2010, 11:08 AM
  2. Help to change boot images ... not first boot animation
    By Orion223 in forum Android Hacks and Help
    Replies: 10
    Last Post: 04-24-2010, 09:54 PM
  3. boot animation down.. wdo i do anhat about boot audio..
    By bobmundo123 in forum Android Hacks and Help
    Replies: 2
    Last Post: 01-23-2010, 07:16 PM

Search tags for this page

download split bootimg.zip
,
extract-edit-repack-boot-img-windows
,
gzip: ../boot.img-ramdisk.gz: not in gzip format
,
how to split boot.img
,
mount android boot.img
,
mount boot.img
,
split bootimg.pl
,

split bootimg.zip

,
unpack boot.img android
,

unpack-bootimg.zip

Click on a term to search our site for related topics.
Find us on Google+