Sdcard boot user guide

 

Note: For sdcard boot, the size of sdcard MUST be larger than 2GB.

1、make config

Select 12/16 item to config sdcardboot

2、make all

The correct compile log is as follows:

need mkfs.fat mke2fs and sfdisk tool to generate img file

use the “winhex” tool to check the ISP_SD_BOOOT.img partition info:

FAT32 size is 50MB , Rootfs size is 1GB.

Set the partition size in ./build/tool/sdcard_boot/sdcard_boot.sh

3、out

Final output file is:

 

ISPBOOOT.BIN: include xboot,uboot,kernel

ISP_SD_BOOOT.img: include a boot partition in fat32 format and a rootfs partition in ext32 format.

4、Write to sdcard

Use the "win32 disk image" tool to write the img file to the sdcard. After the completion, the

sdcard will be partitioned according to the partition format of ISP_SD_BOOOT.img, and the

corresponding file in ISP_SD_BOOOT.img will also be written to the Sdcard

If just to change xboot,uboot or kernel,copy ISPBOOOT.BIN to sdcard directly

If rootfs has modified, you need to re-write ISP_SD_BOOOT.img file

5.Work

After write to sdcard and first run, the system will do fdisk cmd first to set the partition info, then the platform will automatically reboot, and do resize2fs action to extend the rootfs partition size to the entire remaining space of sdcard

First run and do the fdisk cmd:

Reboot and do resize2fs cmd:

FAQ:

1、 After reboot in first use,do resize2fs cmd take an error :”ext4_resize_fs:1885: can't read last block, resize aborted”

At this point you need to manually partition the root partition

  • use fdisk cmd to reset the root partition size

The command to be used is shown in the red block diagram of the following figure: Note

that the starting sectors (104888) of the newly set mmcblk2p2 must be followed by the

ending sectors (104447) of mmcblk1p1, and need to be set smaller than the maximum

sectors when setting the ending sectors.And do reboot:

  • And do resize2fs: