Sysupgrade: Add support for devcfg version check

This change adds support to check devcfg version and
allows sysupgrade only if the version is higher.

Change-Id: I7192f428c50c1b1b9eeddd1aac0d57d341d32436
Signed-off-by: Pavithra Palanisamy <pavip@codeaurora.org>
This commit is contained in:
Pavithra Palanisamy 2017-10-26 14:43:10 +05:30 committed by Gerrit - the friendly Code Review server
parent 9bf4639e22
commit a392418a4f
2 changed files with 11 additions and 1 deletions

View file

@ -18,6 +18,7 @@
#define HLOS_VERSION_FILE "hlos_version"
#define APPSBL_VERSION_FILE "appsbl_version"
#define RPM_VERSION_FILE "rpm_version"
#define DEVCFG_VERSION_FILE "devcfg_version"
#define VERSION_FILE_BASENAME "/sys/devices/system/qfprom/qfprom0/"
#define AUTHENTICATE_FILE "/sys/devices/system/qfprom/qfprom0/authenticate"
#define TEMP_KERNEL_PATH "/tmp/tmp_kernel.bin"
@ -26,6 +27,7 @@
#define MAX_TZ_VERSION 14
#define MAX_APPSBL_VERSION 14
#define MAX_RPM_VERSION 8
#define MAX_DEVCFG_VERSION 11
#define HASH_P_FLAG 0x02200000
#define TMP_FILE_DIR "/tmp/"
#define CERT_SIZE 2048
@ -109,6 +111,14 @@ struct image_section sections[] = {
.version_file = RPM_VERSION_FILE,
.is_present = NOT_PRESENT,
},
{
.section_type = DEVCFG_TYPE,
.type = "devcfg",
.max_version = MAX_DEVCFG_VERSION,
.file = TMP_FILE_DIR,
.version_file = DEVCFG_VERSION_FILE,
.is_present = NOT_PRESENT,
},
};
#define NO_OF_SECTIONS ARRAY_SIZE(sections)

View file

@ -20,7 +20,7 @@
#include <linux/string.h>
#include <linux/types.h>
typedef enum {HLOS_TYPE, UBOOT_TYPE, SBL_TYPE, TZ_TYPE, RPM_TYPE}type;
typedef enum {HLOS_TYPE, UBOOT_TYPE, SBL_TYPE, TZ_TYPE, RPM_TYPE, DEVCFG_TYPE}type;
struct image_section {
type section_type;