Repacking boot images

Discussion in 'Android Hacks and Help' started by nightwo|f, Aug 13, 2010.

  1. nightwo|f

    nightwo|f Member

    Joined:
    Apr 19, 2010
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    I've been messing with trying to get a custom boot image created and thought I had finally succeeded, but something isn't working and I've either bricked my phone or the battery as just drained down so far it has to charge back up to 5% or such to power back up.

    I downloaded the AOSP repository (the entire 2.1gb of the thing, took some time), and compiled mkbootimg. I'm currently using Sapphire so I extracted the update.zip and took the boot.img from there as a start, using the unpack/repack scripts from here:

    HOWTO: Unpack, Edit, and Re-Pack Boot Images - Android Wiki

    I know it was written around the old G1, so I used /dev/block/mtdblock4 since that is the MTD boot partition on the Droid. In any case my goal was to just add a line into init.rc so that on boot a partition that I've made on my sdcard (/dev/block/mmcblkp2 or such) will be mounted as /data/dalvik-cache, freeing up 100MB from /data. So I added that line to the init.rc, and repacked the boot img and flashed it using flash_image via an adb shell in clockwork's recovery.

    Upon the first reboot I got the Motorola logo, but then after that the screen just went black like it powered off (backlight turned off). I yanked the battery and tried again and the phone just won't turn on. A few days ago it acted like this, but I know I had left some music playing and fell asleep for the night and the battery went utterly dry, and it turned back on after being plugged into the charger for awhile. I've had the phone plugged into a usb port for a bit now and it still isn't turning back on, but I'm hoping it just needs more time.

    My main question is there something special to make a droid boot.img file other than mkbootimg from AOSP as described on the linked page above? I did use the repack script and perhaps the kernel cmdline params it uses (mkbootimg --cmdline 'no_console_suspend=1 console=null') aren't right for the droid?


    ---

    ok go figure, as I was typing the last sentence or two it powered up and I have the lock screen right now (I was glancing over every sentence or two while composing the post). But now to find out why the line I added into init.rc isn't actually working:

    mount ext2 /dev/block/mmcblk0p2 /data/dalvik-cache

    I was hoping that would be correct to mount the ext2 partition on my sdcard.
     
  2. nightwo|f

    nightwo|f Member

    Joined:
    Apr 19, 2010
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    OK so I got it working, the trick was insmoding the ext2 module beforehand:

    insmod /system/lib/modules/ext2.ko
    mount ext2 /dev/block/mmcblk0p2 /data/dalvik-cache

    Thats an additional 90MB or so free on my data partition, which should tide me over until CyanogenMod 6.1 comes out with Apps2EXT or similar.
     
  3. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    Excellent idea. I was considering moving the davlik-cache to the /cache partition, but got dissuaded when I realized that if I were to gain another 100mb of space on /data, the apps I installed there would create davlik cache files that would no longer fit in the /cache partition, so I gave up before starting.

    Wouldn't using the SD card for davlik-cache be a terrible idea? I mean, the idea of caching is to have a quick-access version of apps that the system can load that are optimized. Putting those quick-access files on the slowest available filesystem is the opposite of what you want to to. Putting the original APKs on the SD card and leaving the cache files in local flash seems like a better choice. I guess that's what non-froyo-style apps2sd will do for us once it's available.
     
  4. nightwo|f

    nightwo|f Member

    Joined:
    Apr 19, 2010
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    It is possible that moving the dalvik-cache to the sd would result in slower apps, i'm not sure. I don't doubt it'll slow things down at least a little, I'm just not sure how much slower the sdcard is versus the built-in nand flash. My primary goal was space management as I was sick of being at the edge of the critical 25MB mark (where the OS gets all sorts of pissy), if things run a little slower then so be it. Though if things end up being stupid slow then I'll rethink it, and perhaps some i/o testing is in order as well to see how much slower it is.
     
  5. Se7enLC

    Se7enLC Active Member

    Joined:
    Nov 16, 2009
    Messages:
    1,262
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    I'm with you there. I find a bunch of cool apps, then turn around and erase them because they take up too much space and either don't work well when installed on the sdcard or don't put much there when they are supposed to.
     
Search tags for this page
android boot partition
,

android mount boot partition

,
android unpack boot partition
,
mount access on boot android
,
mount android boot img
,
mount boot android
,
mount boot partition android
,
power repacking messin
,
repack boot.img for nexus4
,

unpack-bootimg.pl