Android system Partition Size exception

Source: Internet
Author: User

Platform: Freescale/android 4.2.2

Problem Description:

With the DF command, see/system partition size 275M.

With BusyBox fdisk-l/DEV/BLOCK/MMCBLK0P5, see 536M.

Freescale's Brush machine tool is mfgtool, the partition of the action in the mksdcard-android.sh inside the completion.

System_rom_size= +DD if=/dev/zero Of=${node} bs=1024x768Count=1Sfdisk--force-um ${node} <<Eof,${boot_rom_sizeb}, the, ${recovery_rom_size}, the, ${extend_size},5, ${data_size}, the, ${system_rom_size}, the, ${cache_size}, the, ${vender_size}, the, ${misc_size}, theEOF

Note: DD command

Format: Start, size, ID

Start = Start Cylinder (the first available cylinder if not specified), size = number of cylinders (all cylinders if not specified), id number = partition type (l:linux, S:swap, E: Extended partition)

The configuration file for Mfgtool is Ucl2.xml

Among them, the command to Brush system.img is:

<state= "Updater"  type= "Push"  body= "pipe DD of=/ DEV/MMCBLK0P5 bs=512 "  file=" files/android/system.img ">Sending and writting System.img</CMD>

As you can see, the DD command is used here, BlockSize is 512byte, and the system.img is copied to the/DEV/MMCBLK0P5 partition.

However, the DD command changes the size of the partition, and the changed partition size is the actual size of the system.img file.

So, using the DF command you see 275M.

How to resolve:

Modify DEVICE/FSL/IMX6/BOARDCONFIGCOMMON.MK:

524288000

Board_systemimage_partition_size will be used in Build/core/makefile:

Define Build-systemimage-Target @echo"Target System FS Image: $ (1)"@mkdir-P $ (dir$(1)) $ (systemimage_intermediates) &&RM-RF $ (systemimage_intermediates)/System_image_info.txt $ (call generate-userimage-prop-dictionary, $ (systemimage_intermediates)/system_image_info.txt) $ (hide) PATH=$ (foreach p,$ (internal_userimages_binary_paths), $ (p):) $ $PATH./build/tools/releasetools/build_image.py $ (target_out) $ (systemimage_intermediates)/system_image_info.txt $ (1) Endef

The Generate-userimage-prop-dictionary method assigns a value to the System_image_info.txt:

Define generate-userimage-prop-dictionary$ (if$ (internal_userimages_ext_variant), $ (hide)Echo "fs_type=$ (internal_userimages_ext_variant)">> $ (1))$(if$(board_systemimage_partition_size), $ (hide)Echo "system_size=$ (board_systemimage_partition_size)">> $ (1))$(if$ (board_userdataimage_partition_size), $ (hide)Echo "userdata_size=$ (board_userdataimage_partition_size)">> $ (1))$(if$ (Board_cacheimage_file_system_type), $ (hide)Echo "cache_fs_type=$ (Board_cacheimage_file_system_type)">> $ (1))$(if$ (board_cacheimage_partition_size), $ (hide)Echo "cache_size=$ (board_cacheimage_partition_size)">> $ (1))$(if$ (Internal_userimages_sparse_ext_flag), $ (hide)Echo "extfs_sparse_flag=$ (Internal_userimages_sparse_ext_flag)">> $ (1))$(if$ (mkyaffs2_extra_flags), $ (hide)Echo "mkyaffs2_extra_flags=$ (mkyaffs2_extra_flags)">> $ (1))$(if$ (Target_mkubifs_args), $ (hide)Echo "mkfsubifs_flags=$ (Target_mkubifs_args)">> $ (1))$(if$ (Filtertrue, $ (Strip $ (have_selinux))),Echo "selinux_fc=$ (target_root_out)/file_contexts">> $ (1)) Endef

The key words are: system_size

The./build/tools/releasetools/build_image.py is then called, and the parameter passed in is System_image_info.txt:

  ifMount_point = ="system": Copy_prop ("Fs_type","Fs_type") Copy_prop ("system_size","partition_size") ...... ...... ifFs_type.startswith ("ext"): Build_command= ["mkuserimg.sh"]    if "Extfs_sparse_flag" inchProp_dict:build_command.append (prop_dict["Extfs_sparse_flag"]) run_fsck=True build_command.extend ([In_dir, Out_file, Fs_type, prop_dict["Mount_point"]])    if "partition_size" inchProp_dict:build_command.append (prop_dict["partition_size"])    if "Selinux_fc" inchProp_dict:build_command.append (prop_dict["Selinux_fc"]) Exit_code= RunCommand (Build_command)

Turning and calling the mkuserimg.sh, remember that Partition_size is passed in as a fifth argument:

output_file=$2ext_variant=$3mount_point=$4SIZE=$5  FC=$6make_ext4fs_cmd="make_ext4fs $ENABLE _sparse_image $FCOPT-L $ Size-a $MOUNT _point $OUTPUT _file $SRC _dir"

Finally see the core, using the MAKE_EXT4FS to make IMG.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.