@@ -13,6 +13,7 @@ obj-y += swupdate.o \
notifier.o \
handler.o \
bootloader.o \
+ hw-compatibility.o \
install_from_file.o \
util.o \
parser.o \
@@ -23,6 +23,7 @@
#include "parselib.h"
#include "swupdate_settings.h"
#include "semver.h"
+#include "versions.h"
/*
* Read versions of components from a file, if provided
@@ -20,6 +20,7 @@
#include "generated/autoconf.h"
#include "cpiohdr.h"
+#include "swupdate.h"
#include "util.h"
#include "sslapi.h"
#include "progress.h"
new file mode 100644
@@ -0,0 +1,114 @@
+/*
+ * (C) Copyright 2023
+ * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ *
+ * SPDX-License-Identifier: GPL-2.0-only
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include "util.h"
+#include "swupdate.h"
+#include "hw-compatibility.h"
+
+/*
+ * The HW revision of the board *MUST* be inserted
+ * in the sw-description file
+ */
+#ifdef CONFIG_HW_COMPATIBILITY
+int check_hw_compatibility(struct swupdate_cfg *cfg)
+{
+ struct hw_type *hw;
+ int ret;
+
+ ret = get_hw_revision(&cfg->hw);
+ if (ret < 0)
+ return -1;
+
+ TRACE("Hardware %s Revision: %s", cfg->hw.boardname, cfg->hw.revision);
+ LIST_FOREACH(hw, &cfg->hardware, next) {
+ if (hw &&
+ (!hwid_match(hw->revision, cfg->hw.revision))) {
+ TRACE("Hardware compatibility verified");
+ return 0;
+ }
+ }
+
+ return -1;
+}
+#else
+int check_hw_compatibility(struct swupdate_cfg
+ __attribute__ ((__unused__)) *cfg)
+{
+ return 0;
+}
+#endif
+
+/*
+ * This function is strict bounded with the hardware
+ * It reads some GPIOs to get the hardware revision
+ */
+int get_hw_revision(struct hw_type *hw)
+{
+ FILE *fp;
+ int ret;
+ char *b1, *b2;
+#ifdef CONFIG_HW_COMPATIBILITY_FILE
+#define HW_FILE CONFIG_HW_COMPATIBILITY_FILE
+#else
+#define HW_FILE "/etc/hwrevision"
+#endif
+
+ if (!hw)
+ return -EINVAL;
+
+ /*
+ * do not overwrite if it is already set
+ * (maybe from command line)
+ */
+ if (strlen(hw->boardname))
+ return 0;
+
+ memset(hw->boardname, 0, sizeof(hw->boardname));
+ memset(hw->revision, 0, sizeof(hw->revision));
+
+ /*
+ * Not all boards have pins for revision number
+ * check if there is a file containing theHW revision number
+ */
+ fp = fopen(HW_FILE, "r");
+ if (!fp)
+ return -1;
+
+ ret = fscanf(fp, "%ms %ms", &b1, &b2);
+ fclose(fp);
+
+ if (ret != 2) {
+ TRACE("Cannot find Board Revision");
+ if(ret == 1)
+ free(b1);
+ return -1;
+ }
+
+ if ((strlen(b1) > (SWUPDATE_GENERAL_STRING_SIZE) - 1) ||
+ (strlen(b2) > (SWUPDATE_GENERAL_STRING_SIZE - 1))) {
+ ERROR("Board name or revision too long");
+ ret = -1;
+ goto out;
+ }
+
+ strlcpy(hw->boardname, b1, sizeof(hw->boardname));
+ strlcpy(hw->revision, b2, sizeof(hw->revision));
+
+ ret = 0;
+
+out:
+ free(b1);
+ free(b2);
+
+ return ret;
+}
+
+
@@ -30,6 +30,7 @@
#include "installer.h"
#include "installer_priv.h"
#include "swupdate.h"
+#include "hw-compatibility.h"
#include "pctl.h"
#include "generated/autoconf.h"
#include "state.h"
@@ -45,6 +45,7 @@
#include "pctl.h"
#include "state.h"
#include "bootloader.h"
+#include "hw-compatibility.h"
#define BUFF_SIZE 4096
#define PERCENT_LB_INDEX 4
@@ -48,6 +48,8 @@
#include "pctl.h"
#include "state.h"
#include "bootloader.h"
+#include "versions.h"
+#include "hw-compatibility.h"
#ifdef CONFIG_SYSTEMD
#include <systemd/sd-daemon.h>
@@ -26,12 +26,13 @@
#include <regex.h>
#include <string.h>
#include <dirent.h>
+#include "swupdate_dict.h"
+#include "swupdate_image.h"
#if defined(__linux__)
#include <sys/statvfs.h>
#endif
-#include "swupdate.h"
#include "util.h"
#include "generated/autoconf.h"
@@ -322,71 +323,6 @@ int mkpath(char *dir, mode_t mode)
return 0;
}
-/*
- * This function is strict bounded with the hardware
- * It reads some GPIOs to get the hardware revision
- */
-int get_hw_revision(struct hw_type *hw)
-{
- FILE *fp;
- int ret;
- char *b1, *b2;
-#ifdef CONFIG_HW_COMPATIBILITY_FILE
-#define HW_FILE CONFIG_HW_COMPATIBILITY_FILE
-#else
-#define HW_FILE "/etc/hwrevision"
-#endif
-
- if (!hw)
- return -EINVAL;
-
- /*
- * do not overwrite if it is already set
- * (maybe from command line)
- */
- if (strlen(hw->boardname))
- return 0;
-
- memset(hw->boardname, 0, sizeof(hw->boardname));
- memset(hw->revision, 0, sizeof(hw->revision));
-
- /*
- * Not all boards have pins for revision number
- * check if there is a file containing theHW revision number
- */
- fp = fopen(HW_FILE, "r");
- if (!fp)
- return -1;
-
- ret = fscanf(fp, "%ms %ms", &b1, &b2);
- fclose(fp);
-
- if (ret != 2) {
- TRACE("Cannot find Board Revision");
- if(ret == 1)
- free(b1);
- return -1;
- }
-
- if ((strlen(b1) > (SWUPDATE_GENERAL_STRING_SIZE) - 1) ||
- (strlen(b2) > (SWUPDATE_GENERAL_STRING_SIZE - 1))) {
- ERROR("Board name or revision too long");
- ret = -1;
- goto out;
- }
-
- strlcpy(hw->boardname, b1, sizeof(hw->boardname));
- strlcpy(hw->revision, b2, sizeof(hw->revision));
-
- ret = 0;
-
-out:
- free(b1);
- free(b2);
-
- return ret;
-}
-
/**
* hwid_match - try to match a literal or RE hwid
* @rev: literal or RE specification
@@ -428,39 +364,6 @@ out:
return ret;
}
-/*
- * The HW revision of the board *MUST* be inserted
- * in the sw-description file
- */
-#ifdef CONFIG_HW_COMPATIBILITY
-int check_hw_compatibility(struct swupdate_cfg *cfg)
-{
- struct hw_type *hw;
- int ret;
-
- ret = get_hw_revision(&cfg->hw);
- if (ret < 0)
- return -1;
-
- TRACE("Hardware %s Revision: %s", cfg->hw.boardname, cfg->hw.revision);
- LIST_FOREACH(hw, &cfg->hardware, next) {
- if (hw &&
- (!hwid_match(hw->revision, cfg->hw.revision))) {
- TRACE("Hardware compatibility verified");
- return 0;
- }
- }
-
- return -1;
-}
-#else
-int check_hw_compatibility(struct swupdate_cfg
- __attribute__ ((__unused__)) *cfg)
-{
- return 0;
-}
-#endif
-
uintmax_t
from_ascii (char const *where, size_t digs, unsigned logbase)
{
@@ -23,6 +23,8 @@
#include "handler.h"
#include "bootloader.h"
#include "progress.h"
+#include "swupdate_image.h"
+#include "hw-compatibility.h"
#define LUA_TYPE_PEMBSCR 1
#define LUA_TYPE_HANDLER 2
@@ -8,6 +8,7 @@
#include "sslapi.h"
#include "util.h"
+#include "swupdate.h"
static char *algo_upper(const char *algo)
{
@@ -20,7 +20,7 @@
#include <archive.h>
#include <archive_entry.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
@@ -14,8 +14,7 @@
#include <errno.h>
#include "generated/autoconf.h"
-#include "swupdate.h"
-#include "swupdate_dict.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
#include "bootloader.h"
@@ -26,7 +26,7 @@
#endif
#include <pctl.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "progress.h"
#include "handler.h"
#include "util.h"
@@ -31,6 +31,7 @@
#include <zlib.h>
#include <channel.h>
#include <channel_curl.h>
+#include "swupdate_dict.h"
#include "delta_handler.h"
#include "delta_process.h"
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include <swupdate.h>
#include <handler.h>
#include <signal.h>
#include <zck.h>
@@ -43,6 +42,7 @@
#include "installer.h"
#include "zchunk_range.h"
#include "chained_handler.h"
+#include "swupdate_image.h"
#define DEFAULT_MAX_RANGES 150 /* Apache has default = 200 */
@@ -12,6 +12,7 @@
#include <blkid/blkid.h>
#include <fs_interface.h>
#include "progress.h"
+#include "swupdate_image.h"
void diskformat_handler(void);
@@ -22,7 +22,7 @@
#include <uuid/uuid.h>
#include <dirent.h>
#include <libgen.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
#include "progress.h"
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <errno.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
@@ -25,7 +25,7 @@
#include <sys/ioctl.h>
#include <mtd/mtd-user.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
#include "flash.h"
@@ -25,8 +25,8 @@
#include <sys/ioctl.h>
#include <mtd/mtd-user.h>
-#include "swupdate.h"
#include "handler.h"
+#include "swupdate_image.h"
#include "util.h"
#include "flash.h"
#include "progress.h"
@@ -24,7 +24,7 @@
#include <errno.h>
#include <libgen.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
@@ -19,7 +19,7 @@
#if defined(__FreeBSD__)
#include <sys/param.h>
#endif
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
@@ -18,8 +18,8 @@
#include <linux/fs.h>
#endif
-#include "swupdate.h"
#include "handler.h"
+#include "swupdate_image.h"
#include "sslapi.h"
#include "util.h"
@@ -15,9 +15,9 @@
#include <string.h>
#include <zmq.h>
-#include <swupdate.h>
-#include <handler.h>
-#include <util.h>
+#include "handler.h"
+#include "util.h"
+#include "swupdate_image.h"
#define MSG_FRAMES 2
#define FRAME_CMD 0
@@ -16,8 +16,8 @@
#include <errno.h>
#include <string.h>
-#include "swupdate.h"
#include "handler.h"
+#include "swupdate_image.h"
#include "util.h"
#include "pctl.h"
@@ -16,7 +16,7 @@
#include <stddef.h>
#include <mtd/mtd-user.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
#include "flash.h"
@@ -29,12 +29,12 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include <swupdate.h>
#include <handler.h>
#include <pthread.h>
#include <util.h>
#include <json-c/json.h>
#include "parselib.h"
+#include "swupdate_image.h"
#include "swuforward_handler.h"
void swuforward_handler(void);
@@ -15,7 +15,7 @@
#include <string.h>
#include <mtd/mtd-user.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "flash.h"
#include "util.h"
@@ -69,7 +69,7 @@
#include <termios.h>
#include <gpiod.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
@@ -21,7 +21,7 @@
#include <ctype.h>
#include <blkid/blkid.h>
#include <sys/types.h>
-#include "swupdate.h"
+#include "swupdate_image.h"
#include "handler.h"
#include "util.h"
@@ -5,7 +5,7 @@
* SPDX-License-Identifier: GPL-2.0-only
*/
-#include "swupdate.h"
+#include "swupdate_image.h"
struct chain_handler_data {
struct img_type img;
};
@@ -22,6 +22,11 @@
#define MAX_BOOT_SCRIPT_LINE_LENGTH 1024
#define MAX_SEEK_STRING_SIZE 32
+/*
+ * swupdate uses SHA256 hashes
+ */
+#define SHA256_HASH_LENGTH 32
+
/* These are fixed path to temporary files */
#define SCRIPTS_DIR_SUFFIX "scripts/"
#define DATADST_DIR_SUFFIX "datadst/"
@@ -10,6 +10,7 @@
#ifndef _HANDLER_H
#define _HANDLER_H
+struct img_type;
typedef enum {
NONE,
PREINSTALL,
new file mode 100644
@@ -0,0 +1,17 @@
+/*
+ * (C) Copyright 2023
+ * Stefano Babic, sbabic@denx.de.
+ *
+ * SPDX-License-Identifier: GPL-2.0-only
+ */
+
+#ifndef _SWUPDATE_HW_COMPATIBILITY_H
+#define _SWUPDATE_HW_COMPATIBILITY_H
+
+#include "swupdate.h"
+
+int check_hw_compatibility(struct swupdate_cfg *cfg);
+int get_hw_revision(struct hw_type *hw);
+
+#endif
+
@@ -14,21 +14,7 @@
#include "globals.h"
#include "mongoose_interface.h"
#include "swupdate_dict.h"
-
-#define BOOTVAR_TRANSACTION "recovery_status"
-
-/*
- * swupdate uses SHA256 hashes
- */
-#define SHA256_HASH_LENGTH 32
-
-typedef enum {
- FLASH,
- UBI,
- FILEDEV,
- PARTITION,
- SCRIPT
-} imagetype_t;
+#include "swupdate_image.h"
/*
* this is used to indicate if a file
@@ -41,64 +27,6 @@ typedef enum {
INSTALL_FROM_STREAM
} swupdate_file_t;
-typedef enum {
- SKIP_NONE=0,
- SKIP_SAME,
- SKIP_HIGHER,
- SKIP_SCRIPT
-} skip_t;
-
-enum {
- COMPRESSED_FALSE,
- COMPRESSED_TRUE,
- COMPRESSED_ZLIB,
- COMPRESSED_ZSTD,
-};
-
-struct sw_version {
- char name[SWUPDATE_GENERAL_STRING_SIZE];
- char version[SWUPDATE_GENERAL_STRING_SIZE];
- int install_if_different;
- int install_if_higher;
- LIST_ENTRY(sw_version) next;
-};
-
-LIST_HEAD(swver, sw_version);
-
-struct img_type {
- struct sw_version id; /* This is used to compare versions */
- char type[SWUPDATE_GENERAL_STRING_SIZE]; /* Handler name */
- char fname[MAX_IMAGE_FNAME]; /* Filename in CPIO archive */
- char volname[MAX_VOLNAME]; /* Useful for UBI */
- char device[MAX_VOLNAME]; /* device associated with image if any */
- char path[MAX_IMAGE_FNAME]; /* Path where image must be installed */
- char mtdname[MAX_IMAGE_FNAME]; /* MTD device where image must be installed */
- char type_data[SWUPDATE_GENERAL_STRING_SIZE]; /* Data for handler */
- char extract_file[MAX_IMAGE_FNAME];
- char filesystem[MAX_IMAGE_FNAME];
- unsigned long long seek;
- skip_t skip;
- int provided;
- int compressed;
- int preserve_attributes; /* whether to preserve attributes in archives */
- bool is_encrypted;
- char ivt_ascii[33];
- int install_directly;
- int is_script;
- int is_partitioner;
- struct dict properties;
- struct dict *bootloader; /* pointer to swupdate_cfg's bootloader dict for handlers to modify */
- long long partsize;
- int fdin; /* Used for streaming file */
- off_t offset; /* offset in cpio file */
- long long size;
- unsigned int checksum;
- unsigned char sha256[SHA256_HASH_LENGTH]; /* SHA-256 is 32 byte */
- LIST_ENTRY(img_type) next;
-};
-
-LIST_HEAD(imglist, img_type);
-
struct hw_type {
char boardname[SWUPDATE_GENERAL_STRING_SIZE];
char revision[SWUPDATE_GENERAL_STRING_SIZE];
new file mode 100644
@@ -0,0 +1,77 @@
+/*
+ * (C) Copyright 2023
+ * Stefano Babic, sbabic@denx.de.
+ *
+ * SPDX-License-Identifier: GPL-2.0-only
+ */
+
+#ifndef _SWUPDATE_IMAGE_H
+#define _SWUPDATE_IMAGE_H
+
+#include <sys/types.h>
+#include <stdbool.h>
+#include "bsdqueue.h"
+#include "globals.h"
+#include "swupdate_dict.h"
+
+typedef enum {
+ FLASH,
+ UBI,
+ FILEDEV,
+ PARTITION,
+ SCRIPT
+} imagetype_t;
+
+typedef enum {
+ SKIP_NONE=0,
+ SKIP_SAME,
+ SKIP_HIGHER,
+ SKIP_SCRIPT
+} skip_t;
+
+struct sw_version {
+ char name[SWUPDATE_GENERAL_STRING_SIZE];
+ char version[SWUPDATE_GENERAL_STRING_SIZE];
+ int install_if_different;
+ int install_if_higher;
+ LIST_ENTRY(sw_version) next;
+};
+
+LIST_HEAD(swver, sw_version);
+
+struct img_type {
+ struct sw_version id; /* This is used to compare versions */
+ char type[SWUPDATE_GENERAL_STRING_SIZE]; /* Handler name */
+ char fname[MAX_IMAGE_FNAME]; /* Filename in CPIO archive */
+ char volname[MAX_VOLNAME]; /* Useful for UBI */
+ char device[MAX_VOLNAME]; /* device associated with image if any */
+ char path[MAX_IMAGE_FNAME]; /* Path where image must be installed */
+ char mtdname[MAX_IMAGE_FNAME]; /* MTD device where image must be installed */
+ char type_data[SWUPDATE_GENERAL_STRING_SIZE]; /* Data for handler */
+ char extract_file[MAX_IMAGE_FNAME];
+ char filesystem[MAX_IMAGE_FNAME];
+ unsigned long long seek;
+ skip_t skip;
+ int provided;
+ int compressed;
+ int preserve_attributes; /* whether to preserve attributes in archives */
+ bool is_encrypted;
+ char ivt_ascii[33];
+ int install_directly;
+ int is_script;
+ int is_partitioner;
+ struct dict properties;
+ struct dict *bootloader; /* pointer to swupdate_cfg's bootloader dict for handlers to modify */
+ long long partsize;
+ int fdin; /* Used for streaming file */
+ off_t offset; /* offset in cpio file */
+ long long size;
+ unsigned int checksum;
+ unsigned char sha256[SHA256_HASH_LENGTH]; /* SHA-256 is 32 byte */
+ LIST_ENTRY(img_type) next;
+};
+
+LIST_HEAD(imglist, img_type);
+
+#endif
+
@@ -12,12 +12,13 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <stdbool.h>
#if defined(__linux__)
#include <linux/types.h>
#endif
-#include "swupdate.h"
+#include "globals.h"
#include "swupdate_status.h"
-#include "swupdate_settings.h"
+#include "swupdate_dict.h"
#include "compat.h"
#define NOTIFY_BUF_SIZE 2048
@@ -32,6 +33,12 @@
#define HWID_REGEXP_PREFIX "#RE:"
#define SWUPDATE_ALIGN(A,S) (((A) + (S) - 1) & ~((S) - 1))
+#define BOOTVAR_TRANSACTION "recovery_status"
+
+struct img_type;
+struct imglist;
+struct hw_type;
+
extern int loglevel;
extern int exit_code;
@@ -48,6 +55,13 @@ typedef enum {
SERVER_ID_REQUESTED,
} server_op_res_t;
+enum {
+ COMPRESSED_FALSE,
+ COMPRESSED_TRUE,
+ COMPRESSED_ZLIB,
+ COMPRESSED_ZSTD,
+};
+
/*
* loglevel is used into TRACE / ERROR
* for values > LASTLOGLEVEL, it is an encoded field
@@ -206,11 +220,8 @@ char *substring(const char *src, int first, int len);
char *string_tolower(char *s);
size_t snescape(char *dst, size_t n, const char *src);
void freeargs (char **argv);
-int get_hw_revision(struct hw_type *hw);
-void get_sw_versions(swupdate_cfg_handle *handle, struct swupdate_cfg *sw);
int compare_versions(const char* left_version, const char* right_version);
int hwid_match(const char* rev, const char* hwrev);
-int check_hw_compatibility(struct swupdate_cfg *cfg);
int count_elem_list(struct imglist *list);
unsigned int count_string_array(const char **nodes);
void free_string_array(char **nodes);
new file mode 100644
@@ -0,0 +1,15 @@
+/*
+ * (C) Copyright 2023
+ * Stefano Babic, sbabic@denx.de.
+ *
+ * SPDX-License-Identifier: GPL-2.0-only
+ */
+
+#ifndef _SWUPDATE_VERSION_H
+#define _SWUPDATE_VERSION_H
+
+#include "swupdate_settings.h"
+void get_sw_versions(swupdate_cfg_handle *handle, struct swupdate_cfg *sw);
+
+#endif
+
@@ -15,6 +15,7 @@
#include "generated/autoconf.h"
#include "swupdate.h"
#include "parsers.h"
+#include "hw-compatibility.h"
#ifdef CONFIG_LUAEXTERNAL
#include "lua.h"
@@ -20,6 +20,7 @@
#include "bsdqueue.h"
#include "util.h"
#include "swupdate.h"
+#include "hw-compatibility.h"
#include "parselib.h"
#include "parsers.h"
#include "swupdate_dict.h"
Some header file like util.h is definetly grown, and this can generate dependencies between file. Try to cleanup this and move some definitions to specific file. While all modules require util.h, just a few of them require specific definitions. Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/Makefile | 1 + core/artifacts_versions.c | 1 + core/cpio_utils.c | 1 + core/hw-compatibility.c | 114 +++++++++++++++++++++++++++++ core/network_thread.c | 1 + core/stream_interface.c | 1 + core/swupdate.c | 2 + core/util.c | 101 +------------------------ corelib/lua_interface.c | 2 + corelib/verify_signature_mbedtls.c | 1 + handlers/archive_handler.c | 2 +- handlers/boot_handler.c | 3 +- handlers/copy_handler.c | 2 +- handlers/delta_downloader.c | 1 + handlers/delta_handler.c | 2 +- handlers/diskformat_handler.c | 1 + handlers/diskpart_handler.c | 2 +- handlers/dummy_handler.c | 2 +- handlers/flash_hamming1_handler.c | 2 +- handlers/flash_handler.c | 2 +- handlers/raw_handler.c | 2 +- handlers/rdiff_handler.c | 2 +- handlers/readback_handler.c | 2 +- handlers/remote_handler.c | 6 +- handlers/shell_scripthandler.c | 2 +- handlers/ssbl_handler.c | 2 +- handlers/swuforward_handler.c | 2 +- handlers/ubivol_handler.c | 2 +- handlers/ucfw_handler.c | 2 +- handlers/uniqueuuid_handler.c | 2 +- include/chained_handler.h | 2 +- include/globals.h | 5 ++ include/handler.h | 1 + include/hw-compatibility.h | 17 +++++ include/swupdate.h | 74 +------------------ include/swupdate_image.h | 77 +++++++++++++++++++ include/util.h | 21 ++++-- include/versions.h | 15 ++++ parser/parse_external.c | 1 + parser/parser.c | 1 + 40 files changed, 283 insertions(+), 199 deletions(-) create mode 100644 core/hw-compatibility.c create mode 100644 include/hw-compatibility.h create mode 100644 include/swupdate_image.h create mode 100644 include/versions.h