添加 ah 的一些注释
This commit is contained in:
@@ -575,6 +575,7 @@ int ah_GetConfig(char *pcfgName, ah_cfg *pcfg)
|
||||
|
||||
#define PACKAGE_HEADER_SIZE 96
|
||||
|
||||
// 这里添加的是img的头
|
||||
void ah_fillHeader(char* p_buf, ah_cfg *cfg, int cnt, int fileSize, int _CRC,
|
||||
unsigned char *sha)
|
||||
{
|
||||
@@ -596,6 +597,7 @@ void ah_fillHeader(char* p_buf, ah_cfg *cfg, int cnt, int fileSize, int _CRC,
|
||||
}
|
||||
|
||||
/* CFG */
|
||||
// 快速启动也是在这里配置的
|
||||
if (cfg->fastboot == 1) {
|
||||
p_buf[3] = 1;
|
||||
} else {
|
||||
@@ -626,6 +628,7 @@ void ah_fillHeader(char* p_buf, ah_cfg *cfg, int cnt, int fileSize, int _CRC,
|
||||
p_buf[11] = hdrVer_10;
|
||||
|
||||
/* IMG VER */
|
||||
// 用大端方式存储多字节
|
||||
p_buf[12] = (char)GET_BYTE4(cfg->image[cnt].version);
|
||||
p_buf[13] = (char)GET_BYTE3(cfg->image[cnt].version);
|
||||
p_buf[14] = (char)GET_BYTE2(cfg->image[cnt].version);
|
||||
@@ -1068,6 +1071,7 @@ int ah_funConstruct(char argc, char *argv[])
|
||||
cfg.crc = 0xFFFFFFFF^CRC32_Update(0xFFFFFFFF, payload , total_size);
|
||||
hdr->file_crc = htonl(cfg.crc);
|
||||
|
||||
// 这里根据加密类型对整个镜像进行加密
|
||||
if(1 == cfg.encrypt_mode)
|
||||
{
|
||||
st = payload;
|
||||
|
Reference in New Issue
Block a user