7. SD Boot User Guide

7.1. SD Boot Introduction

SD boot Configurationthe corresponding content boot、rootfs、system、cfg the corresponding content data the corresponding contentPartitionthe corresponding content SD the corresponding content。SDK the corresponding content SD the corresponding content build/sd_gen_burn_image.sh generate,the corresponding content pack_sd_image。the corresponding contentcurrentthe corresponding contentConfigurationthe corresponding content STORAGE_TYPE the corresponding contentYes sd the corresponding content,pack_sd_image the corresponding contentreturn,the corresponding contentgenerate SD the corresponding content。

7.2. SD Boot the corresponding contentflow

the corresponding content cv1842hp_wevb_0014a_sd the corresponding content:

$ source build/envsetup_soc.sh
$ defconfig cv1842hp_wevb_0014a_sd
$ clean_all && build_all
$ pack_sd_image

the corresponding contentneeduse Buildroot rootfs:

$ source build/envsetup_soc.sh
$ defconfig cv1842hp_wevb_0014a_sd
$ setconfig BUILDROOT_FS=y
$ menuconfig_buildroot
$ savedefconfig_buildroot
$ clean_all && build_all
$ pack_sd_image

pack_rootfs the corresponding contentgenerate ${OUTPUT_DIR}/rawimages/rootfs.sd。the corresponding content Buildroot modethe corresponding content,SD boot use Buildroot generatethe corresponding content rootfs.ext4 the corresponding content rootfs.sd,the corresponding content pack_sd_image Write SD the corresponding content rootfs Partition。

7.3. SD the corresponding contentPartitionthe corresponding content

default SD the corresponding content MBR PartitionTable,the corresponding contentas follows:

Partition

File System

defaultSize

Content

p1

FAT32

36 MB

fip.binboot.sd,andthe corresponding content yoc.bin

p2

ext4

40 MB

rootfs。Buildroot modethe corresponding contentWrite rawimages/rootfs.sd

p3

ext4

20 MB

system,contain /system、the corresponding content、/system/ko the corresponding contentContent。

p5

ext4

12 MB

cfg。

p6

ext4

the corresponding contentspace

data。

7.4. modify SD PartitionSize

sd_gen_burn_image.sh SupportedthroughParametermodify SD the corresponding contentSizethe corresponding contentPartitionSize:

$ build/sd_gen_burn_image.sh "$OUTPUT_DIR" [SD_SIZE_MB] [VFAT_MB] [ROOTFS_MB] [SYSTEM_MB] [CFG_MB]

For examplegenerate 1024 MB the corresponding content,boot Partition 64 MB,rootfs Partition 256 MB,system Partition 128 MB,cfg Partition 32 MB:

$ build/sd_gen_burn_image.sh "$OUTPUT_DIR" 1024 64 256 128 32

ParameterDescription:

Parameter

meaning

Precautions

SD_SIZE_MB

SD the corresponding contentSize

the corresponding content SD the corresponding content。

VFAT_MB

boot PartitionSize

needthe corresponding content fip.binboot.sd the corresponding contentstartFile。

ROOTFS_MB

rootfs PartitionSize

the corresponding content rawimages/rootfs.sd the corresponding contentSize。

SYSTEM_MB

system PartitionSize

needthe corresponding content /system the corresponding content、applicationthe corresponding content ko。

CFG_MB

cfg PartitionSize

data Partitionusethe corresponding contentspace。

the corresponding content

Buildroot ext4 rootfs the corresponding contentSizethe corresponding content BR2_TARGET_ROOTFS_EXT2_SIZE Control。For examplethe corresponding content 200M the corresponding content,SD rootfs Partitionthe corresponding content 200 MB,Nothe corresponding content pack_sd_image the corresponding content rawimages/rootfs.sd is too large for rootfs partition

7.5. Buildroot the corresponding content SD Boot

Buildroot SD boot the corresponding contentkeyflowas follows:

  1. setconfig BUILDROOT_FS=y the corresponding content,pack_rootfs use Buildroot generate rootfs。

  2. br-rootfs-prepare the corresponding content SDK generatethe corresponding content /system、ko the corresponding content /etc/init.d/Sxx the corresponding content Buildroot overlay。

  3. br-rootfs-pack the corresponding content Buildroot the corresponding content output/images/rootfs.ext4 the corresponding content ${OUTPUT_DIR}/rawimages/rootfs.sd

  4. pack_sd_image the corresponding content rawimages/rootfs.sd the corresponding content ext4 rootfs rawthe corresponding contentWrite SD rootfs Partition。

the corresponding content SD the corresponding contentPartitionSize,SD boot the corresponding contentthrough flash partition XML the corresponding content rootfs.sd the corresponding content raw2cimg,Nothe corresponding content Buildroot ext4 the corresponding content XML the corresponding content ROOTFS Partitionthe corresponding content。

7.6. Burningthe corresponding contentboard sideVerification

pack_sd_image Successthe corresponding content,${OUTPUT_DIR} the corresponding contentgeneratethe corresponding content <chip>-sd-YYYYmmdd-HHMM.img the corresponding content SD the corresponding content。the corresponding contentWrite SD the corresponding content,the corresponding content SD the corresponding contentstart EVB。

board sideCheckPartitionthe corresponding content:

# cat /proc/partitions
# fdisk -l /dev/mmcblk0
# mount
# df -h

the corresponding contentstartFailure,the corresponding contentCheck:

  • SD the corresponding contentYesNothe corresponding contentSize。

  • boot Partitionthe corresponding contentYesNocontain fip.bin the corresponding content boot.sd

  • rootfs PartitionSizeYesNothe corresponding content rootfs.sd

  • Buildroot rootfs YesNocontainthe corresponding content /etc/init.d/Sxx the corresponding content。

  • /system YesNonormalthe corresponding content,/system/ko YesNocontainthe corresponding content ko。