This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Blaze - Flashing update.zip in recovery mode

Hi All,

I am using Blaze OMAP4430 and running ICS downloaded from http://omappedia.org/wiki/4AI.1.7_OMAP4_Icecream_Sandwich_Release_Notes

I am trying Android recovery. I followed the steps mentioned in the link: http://www.omappedia.com/wiki/Android_Recovery

I am getting the UI to choose the update.zip file from sdcard.

* I created custom update.zip by referring(http://fokke.org/site/content/howto-create-android-updatezip-package) & signed with the testkey available as part of the android source downloaded.

* If I update, I am getting the following error :

E:Signature verification failed.

* I tried creating my own test key to sign the update.zip file, still I am getting the same error.

* I removed the verification part in the recovery.c file & tried, yet I am getting "Installation aborted" error.

How do I proceed?

Any inputs..

Regards,

Ramya.M

  • Hi All,

    I resolved the installation aborted by changing the update-binary with "updater" binary built as part of the android build under system/bin/.

    Now I am facing another problem:

    * In recovery mode, using a script(updater-script) in the update.zip file, we will update the contents of the zip files to the eMMC partition.

    * In the script, there is a command "write_raw_image" to write the *.img file to the desired partition.From UI it displays "Installation complete".. But the *.img is not updated.
    * Then from the source code of recovery, I tracked it down to a position where "write_raw_image" looks for a mtd_find_partition_by_name function which actually searches for the list of partition using the "cat /proc/mtd" & writes the *.img file to the corresponding "/dev/mtd/mtd[x]" block.
    * On Blaze board, we have only eMMC, which is not a MTD device.
    so the cat /proc/mtd lists nothing.. Hence it is unable to write the *.img file to the partition...
    Any suggestions?
    * Herein I have attached the script, log & MTDUTILS file for your reference.
    Thanks in advance.
    Regards,
    Ramya.
  • Hi,

    The attachments are missing...

    So uploading it again..6862.mtdutils.c

    Log :

    Install /sdcard ...
    Finding update package...
    I:Update location: /tmp/sideload/package.zip
    Opening update package...
    I:1 key(s) loaded from /res/keys
    Verifying update package...
    Installing update...
    Zip 0xbed468c8 , binary_entry 0x74848Firmware upgrade for Android 4.0.3 armpackage_extract_file: no /tmp/boot.img in package
    about to run program [/sbin/busybox] with 2 args
    su: unknown id: root
    run_program: child exited with status 1

    write_raw_image: no mtd partition named "boot"
    script result was [Installation complete!]
    Assert File ...
    Extract to /tmp & then use Raw write ...
    Asserted the extracted file...
    Flashing Kernel ...
    Installation complete!


    And Script:

    ui_print("Firmware upgrade for Android 4.0.3 arm");
    ui_print("Assert File ...");
    assert("boot.img");
    ui_print(" Extract to /tmp & then use Raw write ...");
    assert(package_extract_file("boot.img", "/tmp/boot.img"));
    ui_print("Asserted the extracted file...");
    run_program("/sbin/busybox","su");
    ui_print("Flashing Kernel ...");
    write_raw_image("/tmp/boot.img","boot");
    assert(delete("/tmp/boot.img"));
    show_progress(10.000000, 1);
    ui_print("Installation complete!");

    Regards,

    Ramya.


  • There seems is a path to enable eMMC in Recovery code.

    1. Adding TARGET_USERIMAGES_USE_EXT4 := true to BuildConfig.mk in device configuration, this is enabling EXT4 code.

    2. /mydroid/bootable/recovery/updater/install.c they have this comment
    // mount(fs_type, partition_type, location, mount_point)
    //
    //    fs_type="yaffs2" partition_type="MTD"     location=partition
    //    fs_type="ext4"   partition_type="EMMC"    location=device

    and the value for fs_type is read from ReadArgs(..)

    3. and some parts of code are selecting between MDT and EMMC.

    I still need to find how to set fs_type to "ext4", but this must help, probably formating patch partition to ext4 and setting the values in configuration.

  • Hi,

    Thanks for the reply.

    Already the TARGET_USERIMAGES_USE_EXT4 := true configuration is set to true..

    I will also further debug from my side.

    Regards,

    Ramya.


  • Try to check how the FS image is made it must be ext4.

  • Hi Ramya, Manuel,

    I am trying to get Android update over the air working with an OMAP4 Blaze board and had the same issues.  

    write_raw_image cannot be used to program a raw image to an eMMC device.  Instead, use the package_extract_dir function to program the raw image to a partition on the eMMC.

    Hence, if you wish to program X-Loader, U-Boot and boot.img to partitions name xloader, bootloader and boot on a target platform with eMMC using the update.zip and Android's recovery mechanism, the udpate-script under META-INF/com/google/android would resemble the following:

    ui_print("Firmware upgrade for Platform Name");

    ui_print("Installing .X-Loader ..");
    assert(package_extract_file("MLO", "/dev/block/platform/omap/omap_hsmmc.0/by-name/xloader"));

    ui_print("Installing U-Boot ...");
    assert(package_extract_file("u-boot.bin", "/dev/block/platform/omap/omap_hsmmc.0/by-name/bootloader"));

    ui_print("Installing Boot...");
    assert(package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot"));

    ui_print("Installation complete!");
    show_progress(10.000000, 1);

    However, this works only with images to be programmed to raw partitions (without a file system) - xloader, bootloader, boot and recovery)  

    I have still not been able to successfully program system.img (an EXT4 file system image) to the eMMC device of the Blaze.

    Thanks and regards,

    Kanagesh

  • Hello Ramya, Manuel,

    My apologies - there was a typo in my previous mail.

    You should be using package_extract_file (and not package_extract_dir) to program a binary image to the eMMC device

    The commands in the update-script are correct and they have been tested on an OMAP4 Blaze board

    Thanks and regards,

    Kanagesh

  • Hello,
    Concerning writing system.img and other filesystem images to eMMC partitions...
    By default android build system generates sparse filesystem images: system.img, userdata.img, and so on. These sparse images can not be written to eMMC partitions 'as-is', they have to be 'un-sparsed' before writing them to disk. However Android recovery system does not support 'un-sparsing' images on the fly. That is why filesystem images for update packages should be generated separately. For instance, the following command generates 'non-sparse' system image:

    $ out/host/linux-x86/bin/make_ext4fs -l <size> -a system non_sparse_system.img out/target/product/blaze_tablet/system

    Note: fastboot can write both raw and filesystem images properly because it does support 'un-sparsing'.