INSTALL(TARGETS ${EXECNAME} DESTINATION ${BINDIR})
-ADD_SUBDIRECTORY(upg-verifier)
+ADD_SUBDIRECTORY(img-verifier)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(SBINDIR "${PREFIX}/sbin")
-SET(VERIFIER "upg-verifier")
+SET(VERIFIER "img-verifier")
SET(VERIFIER_DIR ${CMAKE_CURRENT_SOURCE_DIR})
SET(VERIFIER_SRCS
#include <sys/types.h>
#include <unistd.h>
-#include "upg-verifier.h"
+#include "img-verifier.h"
/**
* You must install CA_FILE in the RO section
#ifdef LOG_FILE
_CLEANUP_CLOSE_ int log_fd;
- log_fd = open("/opt/var/log/last_uv.log", O_WRONLY | O_CREAT, 0644);
+ log_fd = open("/opt/var/log/last_iv.log", O_WRONLY | O_CREAT, 0644);
ASSERT_RETV(log_fd != -1, errno, "Failed to open log file fd : %m");
ret = dup2(log_fd, STDOUT_FILENO);
ASSERT_RETV(ret != -1, errno, "Failed to duplicate fd : %m");
#endif
- _I("Start to verify upg");
+ _I("Start to verify image");
ret = check_argument(argc, argv);
ASSERT_RETV(ret == SUCCEED, EINVAL, "Failed to check argument (%d)", ret);
free_data(SUCCEED);
- _I("Succeed to verify upg!");
+ _I("Succeed to verify image!");
return SUCCEED;
}
-#ifndef __UPG_VERIFIER_H__
-#define __UPG_VERIFIER_H__
+#ifndef __IMG_VERIFIER_H__
+#define __IMG_VERIFIER_H__
#include <unistd.h>
#define LOG_VERBOSE
-#define _L(lvl, fmt, arg...) printf("UV/" lvl fmt "\n", ##arg)
+#define _L(lvl, fmt, arg...) printf("IV/" lvl fmt "\n", ##arg)
#ifdef LOG_VERBOSE
#define _D(fmt, arg...) _L("DEBUG ", fmt, ##arg)
#define _CLEANUP_CLOSE_ __attribute__((__cleanup__(close_fd)))
-#define MAGIC_NUMBER "TOTA_SIGNED_V1"
+#define MAGIC_NUMBER "IMG_SIGNED_V1"
#define MAGIC_NUMBER_SIZE (sizeof(MAGIC_NUMBER) - 1)
/**
- * This structure is same with TOTA signed file.
+ * This structure is same with signed image.
* So, please sync it with signer.
*/
struct signed_file {
unsigned char magic_number[MAGIC_NUMBER_SIZE];
};
-#endif /* __UPG_VERIFIER_H__ */
+#endif /* __IMG_VERIFIER_H__ */
%{_bindir}/delta.ua
%{_bindir}/upgrade-trigger.sh
%attr(700,-,-) %{tota_ua_list_dir}/40-tota-ua.list
-%{_sbindir}/upg-verifier
+%{_sbindir}/img-verifier
%attr(755,root,root) %{tota_ca_dir}
@TOTA_UA_LIB_DIR@/libcrypto.so.1.1
@TOTA_UA_LIB_DIR@/libtota.so.1.0.0
/usr/bin/delta.ua
-/usr/sbin/upg-verifier
+/usr/sbin/img-verifier
"
VERSION_FILE="/opt/etc/version"
DOWNLOAD_DELTA=$1
DELTA_TAR="$FOTA_DIR/delta.tar"
-UPG_VERIFIER="/usr/sbin/upg-verifier"
+IMG_VERIFIER="/usr/sbin/img-verifier"
flash_pre_image() {
echo "Flash images for update..."
sync
# Verify delta.tar
-if [ -e "$UPG_VERIFIER" ]; then
+if [ -e "$IMG_VERIFIER" ]; then
echo "Package verifier is found. Verify $DELTA_TAR"
- $UPG_VERIFIER $DELTA_TAR
+ $IMG_VERIFIER $DELTA_TAR
if [ $? -ne 0 ]; then
echo "Update package verification FAILED..."
echo 5 > "$STATUS_DIR"/result