tools: osu: Rename fota with osu comamnd name 35/308335/1 accepted/tizen/8.0/unified/20240322.170326
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 21 Mar 2024 00:42:40 +0000 (09:42 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 21 Mar 2024 10:39:21 +0000 (19:39 +0900)
In order to use 'osu' command for more overall purpose related to OS
Upgrade, rename fota with osu comamnd name.

Change-Id: Ie86642865b31d2ff2c7d0a8dfa5590a0f8e3a0a3
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
packaging/update-control.spec
tools/CMakeLists.txt
tools/fota/CMakeLists.txt [deleted file]
tools/fota/main.c [deleted file]
tools/osu/CMakeLists.txt [new file with mode: 0644]
tools/osu/osu.c [new file with mode: 0644]

index 93a0693996f425f54460de07dad7dcb65308a5bb..2f12338392c4277195c30375b6cfe059cc519021 100644 (file)
@@ -98,7 +98,7 @@ ln -s ../%{service_file} %{buildroot}/%{_unitdir}/multi-user.target.wants/%{serv
 %manifest %{name}.manifest
 %license LICENSE
 %{_libdir}/libupdate-control.so.*
-%{_bindir}/fota
+%{_bindir}/osu
 
 %files daemon
 %{_bindir}/update-manager
index 6ad7d0a9c10a9f57c9f663d44148db2767331dbc..7e2272d9b9f45443ed1eac4e6df6733d8a4f27ba 100644 (file)
@@ -1,4 +1,4 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(update-control-tools C)
 
-ADD_SUBDIRECTORY(fota)
+ADD_SUBDIRECTORY(osu)
diff --git a/tools/fota/CMakeLists.txt b/tools/fota/CMakeLists.txt
deleted file mode 100644 (file)
index 83984c7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-SET(OUTPUT_BIN_NAME fota)
-PROJECT(update-control-tools-${OUTPUT_BIN_NAME} C)
-
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-
-FILE(GLOB_RECURSE SRCS main.c)
-ADD_EXECUTABLE(${OUTPUT_BIN_NAME} ${SRCS})
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
-TARGET_LINK_LIBRARIES(${OUTPUT_BIN_NAME} ${REQUIRED_PKGS_LDFLAGS} update-control)
-INSTALL(TARGETS ${OUTPUT_BIN_NAME} DESTINATION ${BINARY_PATH})
diff --git a/tools/fota/main.c b/tools/fota/main.c
deleted file mode 100644 (file)
index d4158db..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <stdio.h>
-
-#include "update_control.h"
-
-int main(int argc, char **argv)
-{
-       int ret = 0;
-
-       ret = update_control_initialize();
-       if (ret != UPDATE_CONTROL_ERROR_NONE) {
-               printf("Failed to initialize: %d\n", ret);
-               return ret;
-       }
-       printf("Succeed to initialize\n");
-
-       ret = update_control_check_new_version();
-       if (ret != UPDATE_CONTROL_ERROR_NONE) {
-               printf("Failed to check new version: %d\n", ret);
-               goto cleanup;
-       }
-
-       ret = update_control_download_package();
-       if (ret != UPDATE_CONTROL_ERROR_NONE) {
-               printf("Failed to download delta: %d\n", ret);
-               goto cleanup;
-       }
-       printf("Succeed to download delta\n");
-
-       ret = update_control_do_update();
-       if (ret != UPDATE_CONTROL_ERROR_NONE) {
-               printf("Failed to trigger update: %d\n", ret);
-               goto cleanup;
-       }
-
-       printf("Succeed to trigger update: %d\n", ret);
-
-cleanup:
-       ret = update_control_deinitialize();
-       if (ret != UPDATE_CONTROL_ERROR_NONE)
-               printf("Failed to deinitialize: %d\n", ret);
-
-       return ret;
-}
diff --git a/tools/osu/CMakeLists.txt b/tools/osu/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b9a8360
--- /dev/null
@@ -0,0 +1,11 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+SET(OUTPUT_BIN_NAME osu)
+PROJECT(update-control-tools-${OUTPUT_BIN_NAME} C)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
+FILE(GLOB_RECURSE SRCS osu.c)
+ADD_EXECUTABLE(${OUTPUT_BIN_NAME} ${SRCS})
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+TARGET_LINK_LIBRARIES(${OUTPUT_BIN_NAME} ${REQUIRED_PKGS_LDFLAGS} update-control)
+INSTALL(TARGETS ${OUTPUT_BIN_NAME} DESTINATION ${BINARY_PATH})
diff --git a/tools/osu/osu.c b/tools/osu/osu.c
new file mode 100644 (file)
index 0000000..d4158db
--- /dev/null
@@ -0,0 +1,43 @@
+#include <stdio.h>
+
+#include "update_control.h"
+
+int main(int argc, char **argv)
+{
+       int ret = 0;
+
+       ret = update_control_initialize();
+       if (ret != UPDATE_CONTROL_ERROR_NONE) {
+               printf("Failed to initialize: %d\n", ret);
+               return ret;
+       }
+       printf("Succeed to initialize\n");
+
+       ret = update_control_check_new_version();
+       if (ret != UPDATE_CONTROL_ERROR_NONE) {
+               printf("Failed to check new version: %d\n", ret);
+               goto cleanup;
+       }
+
+       ret = update_control_download_package();
+       if (ret != UPDATE_CONTROL_ERROR_NONE) {
+               printf("Failed to download delta: %d\n", ret);
+               goto cleanup;
+       }
+       printf("Succeed to download delta\n");
+
+       ret = update_control_do_update();
+       if (ret != UPDATE_CONTROL_ERROR_NONE) {
+               printf("Failed to trigger update: %d\n", ret);
+               goto cleanup;
+       }
+
+       printf("Succeed to trigger update: %d\n", ret);
+
+cleanup:
+       ret = update_control_deinitialize();
+       if (ret != UPDATE_CONTROL_ERROR_NONE)
+               printf("Failed to deinitialize: %d\n", ret);
+
+       return ret;
+}