How to generate userdata.img and flashing into eMMC?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to generate userdata.img and flashing into eMMC?

Jump to solution
12,091 Views
tftu
Contributor III

Hi All,

    Our project is based on i.MX6 Sololite EVK with  IMX6_JB43_110_ANDROID_SOURCE_BSP, as we all know,

system.img, recovery.img, boot.img and u-boot.bin are the 4 image files that will be generated for SD card/eMMC flashing. In this project, we need to integrate some customized APKs which should be pre-installed but should be able removed/updated by end user after product delivery. Which means they cannot be installed as system APPs in /system/app folder but User APPs in /data/app folder. However, we don't know how to generate the userdata.img neither the way to flash it into eMMC together with other 4 files, although we have the APKs put in myandroid/out/target/product/evk_6sl/data/app folder. Appreciate any suggestion/comment. Thanks in advance!


-tftu

Labels (3)
0 Kudos
1 Solution
4,543 Views
tftu
Contributor III

We finally found the way by tracing the Makefile, BOARD_USERDATAIMAGE_PARTITION_SIZE should be set in BoardConfigCommon.mk and then userdata.img will be generated with other image files.

However, after we enable the userdata.img section in MfgTool's ucl2.xml and change to below:

<CMD state="Updater" type="push" onError="ignore" body="pipe dd of=/dev/mmcblk0p4" file="file/android/userdata.img"> Sending userdata.img(optional) </CMD>

When we tried to run MfgTool2.exe, we got below error:


DLL version: 2.2.3

Wednesday, January 28, 2015 17:20:41   Start new logging

ModuleID[2] LevelID[1]: Push command--file Z:\Mfgtool_Sololite\Profiles\MX6SL Linux Update\OS Firmware\file\android\userdata.img failed to open.errcode is 3

ModuleID[2] LevelID[1]: Parse ucl script failed, error code: 4

We use 4G eMMC, and have tried  "BOARD_USERDATAIMAGE_PARTITION_SIZE := 2684354560" and "BOARD_USERDATAIMAGE_PARTITION_SIZE := 293601280" (the APK file size is less than 20MB), but both got the same error. And we have double checked the file name and location, nothing wrong.

Any suggestion?

View solution in original post

0 Kudos
5 Replies
4,544 Views
tftu
Contributor III

We finally found the way by tracing the Makefile, BOARD_USERDATAIMAGE_PARTITION_SIZE should be set in BoardConfigCommon.mk and then userdata.img will be generated with other image files.

However, after we enable the userdata.img section in MfgTool's ucl2.xml and change to below:

<CMD state="Updater" type="push" onError="ignore" body="pipe dd of=/dev/mmcblk0p4" file="file/android/userdata.img"> Sending userdata.img(optional) </CMD>

When we tried to run MfgTool2.exe, we got below error:


DLL version: 2.2.3

Wednesday, January 28, 2015 17:20:41   Start new logging

ModuleID[2] LevelID[1]: Push command--file Z:\Mfgtool_Sololite\Profiles\MX6SL Linux Update\OS Firmware\file\android\userdata.img failed to open.errcode is 3

ModuleID[2] LevelID[1]: Parse ucl script failed, error code: 4

We use 4G eMMC, and have tried  "BOARD_USERDATAIMAGE_PARTITION_SIZE := 2684354560" and "BOARD_USERDATAIMAGE_PARTITION_SIZE := 293601280" (the APK file size is less than 20MB), but both got the same error. And we have double checked the file name and location, nothing wrong.

Any suggestion?

0 Kudos
4,543 Views
tftu
Contributor III

Ha! There are so many default mistakes in freescale's MfgTool ucl2.xml, we fixed the "userdate.img"(should be userdata.img) and "mmcblk0p7"(should be mmcblk0p4), but was forgetting to check the path name : "FILE/android/..." (should be "files").


Now it works like a charm!

-tftu

4,544 Views
SergioSolis
NXP Employee
NXP Employee

Thank you very much for your feedback Tsung-Fang!, and for posting the solution for it!

0 Kudos
4,544 Views
sanshanzhang
NXP Employee
NXP Employee

Hi tftu;

The below is my patch enable userdate.img cache.img.

The builded out image is sparse image. So The mfgtool can't burn in sparse image.

You need simg2img to convert sparse image to raw image.  userdata_raw.img is the what mfgtool need.

~/lp5.1_sabresd_7d_4_20/out/target/product/sabresd_7d# ../../../host/linux-x86/bin/simg2img userdata.img ./userdata_raw.img

diff --git a/imx7/BoardConfigCommon.mk b/imx7/BoardConfigCommon.mk

index 14e4881..c207727 100644

--- a/imx7/BoardConfigCommon.mk

+++ b/imx7/BoardConfigCommon.mk

@@ -61,7 +61,11 @@ BOARD_BOOTIMAGE_PARTITION_SIZE :=  16777216

BOARD_RECOVERYIMAGE_PARTITION_SIZE := 16777216

BOARD_SYSTEMIMAGE_PARTITION_SIZE := 377487360

+BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800

+TARGET_USERIMAGES_USE_EXT4 := true

+BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016

+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4

BOARD_FLASH_BLOCK_SIZE := 4096

TARGET_RECOVERY_UI_LIB := librecovery_ui_imx

-

+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true

-include device/google/gapps/gapps_config.mk

0 Kudos
4,544 Views
david5icp
Contributor III

Hi All,

 I follow above steps to reload userdata.img to eMMC,  but after that, my size of /data partition will also less or equal "BOARD_USERDATAIMAGE_PARTITION_SIZE";  if the value is 256MB or 1GB, the /data partition will also 256Mb or 1GB. I can't use remaining or whole size of eMMC. Anyone have same issue ?

BR.

David Wu

0 Kudos