|
|
@ -4,6 +4,7 @@ |
|
|
|
#include "spdlog/spdlog.h"
|
|
|
|
#include "version.hpp"
|
|
|
|
#include "zclipp/include/clipp.h"
|
|
|
|
#include "zlinuxcomponents/rootfs_auto_update.hpp"
|
|
|
|
#include "zservice_container/zservice_container.hpp"
|
|
|
|
#include "zwebservice/zwebservice.hpp"
|
|
|
|
//
|
|
|
@ -12,6 +13,8 @@ |
|
|
|
#include "service/light_control_service.hpp"
|
|
|
|
#include "service/main_control_service.hpp"
|
|
|
|
#include "service/report_service.hpp"
|
|
|
|
//
|
|
|
|
#include "dirent.h"
|
|
|
|
using namespace iflytop; |
|
|
|
using namespace core; |
|
|
|
using namespace std; |
|
|
@ -51,6 +54,7 @@ int main(int argc, char *argv[]) { |
|
|
|
/***********************************************************************************************************************
|
|
|
|
* =======================================================Main======================================================== * |
|
|
|
***********************************************************************************************************************/ |
|
|
|
|
|
|
|
int Main::main(int argc, char *argv[]) { |
|
|
|
string g_host_server_ip; |
|
|
|
string g_device_id; |
|
|
@ -64,6 +68,8 @@ int Main::main(int argc, char *argv[]) { |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
logger->info("system setup start."); |
|
|
|
|
|
|
|
spdlog::flush_on(spdlog::level::debug); |
|
|
|
|
|
|
|
logger->info("#"); |
|
|
@ -71,11 +77,27 @@ int Main::main(int argc, char *argv[]) { |
|
|
|
logger->info("# version:{}", VERSION); |
|
|
|
logger->info("#"); |
|
|
|
|
|
|
|
|
|
|
|
BUILD_AND_REG_SERRVICE(Config); |
|
|
|
GET_SERVICE(Config)->initialize(); |
|
|
|
if (!g_device_id.empty()) GET_SERVICE(Config)->set_deviceId(g_device_id); |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 比较rootfs目录中的文件和系统中对应路径的文件是否一致,如果不一致则替换 |
|
|
|
* |
|
|
|
* 例如 |
|
|
|
* ./rootfs/etc/asound.conf 和 /etc/asound.conf 不一致,则替换 |
|
|
|
* |
|
|
|
*/ |
|
|
|
auto rootfsAutoUpdate = make_shared<RootfsAutoUpdate>(); |
|
|
|
rootfsAutoUpdate->compareAndReplace(); |
|
|
|
logger->info("rootfs changed:{}", rootfsAutoUpdate->isChanged() ? "yes" : "no"); |
|
|
|
if (rootfsAutoUpdate->isChanged()) { |
|
|
|
logger->info("reboot system."); |
|
|
|
logger->warn("not auto reboot, please reboot manually."); |
|
|
|
// system("reboot");
|
|
|
|
} |
|
|
|
|
|
|
|
#if 0
|
|
|
|
BUILD_AND_REG_SERRVICE(DeviceIOService); |
|
|
|
#else
|
|
|
|