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 |
|---|---|---|---|
|
FAT32 |
36 MB |
|
|
ext4 |
40 MB |
rootfs。Buildroot modethe corresponding contentWrite |
|
ext4 |
20 MB |
system,contain |
|
ext4 |
12 MB |
cfg。 |
|
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 the corresponding contentSize |
the corresponding content SD the corresponding content。 |
|
boot PartitionSize |
needthe corresponding content |
|
rootfs PartitionSize |
the corresponding content |
|
system PartitionSize |
needthe corresponding content |
|
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:
setconfig BUILDROOT_FS=ythe corresponding content,pack_rootfsuse Buildroot generate rootfs。br-rootfs-preparethe corresponding content SDK generatethe corresponding content/system、ko the corresponding content/etc/init.d/Sxxthe corresponding content Buildroot overlay。br-rootfs-packthe corresponding content Buildroot the corresponding contentoutput/images/rootfs.ext4the corresponding content${OUTPUT_DIR}/rawimages/rootfs.sd。pack_sd_imagethe corresponding contentrawimages/rootfs.sdthe 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.binthe corresponding contentboot.sd。rootfs PartitionSizeYesNothe corresponding content
rootfs.sd。Buildroot rootfs YesNocontainthe corresponding content
/etc/init.d/Sxxthe corresponding content。/systemYesNonormalthe corresponding content,/system/koYesNocontainthe corresponding content ko。