diff --git a/tools/hc-gen/src/startup_cfg_gen.cpp b/tools/hc-gen/src/startup_cfg_gen.cpp index 1fe1f735..7dde0056 100644 --- a/tools/hc-gen/src/startup_cfg_gen.cpp +++ b/tools/hc-gen/src/startup_cfg_gen.cpp @@ -32,10 +32,6 @@ static constexpr const char *SERVICE_TOP = " {\n" " \"name\" : "; static constexpr const char *PATH_INFO = " \"path\" : [\"/vendor/bin/hdf_devhost\", "; -static constexpr const char *UID_INFO_ROOT = - " \"uid\" : \"root\",\n" - " \"gid\" : [\"system\"]\n" - " }"; static constexpr const char *UID_INFO = " \"uid\" : "; static constexpr const char *GID_INFO = " \"gid\" : ["; static constexpr const char *CAPS_INFO = " \"caps\" : ["; @@ -85,9 +81,6 @@ bool StartupCfgGen::Initialize() } outFileName = Util::File::StripSuffix(outFileName).append(".cfg"); outFileName_ = Util::File::FileNameBase(outFileName); - if (outFileName_.find("musl") != std::string::npos) { - useMusl = true; - } ofs_.open(outFileName, std::ofstream::out | std::ofstream::binary); if (!ofs_.is_open()) { @@ -100,7 +93,7 @@ bool StartupCfgGen::Initialize() return true; } -void StartupCfgGen::HostInfoOutputMusl(const std::string &name, bool end) +void StartupCfgGen::HostInfoOutput(const std::string &name, bool end) { ofs_ << SERVICE_TOP << "\"" << name << "\",\n"; if (hostInfoMap_[name].dynamicLoad) { @@ -120,22 +113,6 @@ void StartupCfgGen::HostInfoOutputMusl(const std::string &name, bool end) ofs_ << '\n'; } -void StartupCfgGen::HostInfoOutput(const std::string &name, bool end) -{ - std::string out = SERVICE_TOP; - out.append("\"").append(name).append("\",\n"); - if (hostInfoMap_[name].dynamicLoad) { - out.append(DYNAMIC_INFO); - } - out.append(PATH_INFO).append("\"").append(std::to_string(hostInfoMap_[name].hostId)).append("\"").append(", "); - out.append("\"").append(name).append("\"").append("],\n"); - out.append(UID_INFO_ROOT); - if (!end) { - out.append(","); - } - ofs_ << out << '\n'; -} - void StartupCfgGen::InitHostInfo(HostInfo &hostData) { hostData.dynamicLoad = true; @@ -178,11 +155,7 @@ void StartupCfgGen::HostInfosOutput() if (cnt == size) { end = true; } - if (useMusl) { - HostInfoOutputMusl(it->first, end); - } else { - HostInfoOutput(it->first, end); - } + HostInfoOutput(it->first, end); } } diff --git a/tools/hc-gen/src/startup_cfg_gen.h b/tools/hc-gen/src/startup_cfg_gen.h index 9317a005..13a2914f 100644 --- a/tools/hc-gen/src/startup_cfg_gen.h +++ b/tools/hc-gen/src/startup_cfg_gen.h @@ -51,8 +51,6 @@ private: void HostInfoOutput(const std::string &name, bool end); - void HostInfoOutputMusl(const std::string &name, bool end); - void HeaderTopOutput(); void HeaderBottomOutput(); @@ -65,7 +63,6 @@ private: std::ofstream ofs_; std::string outFileName_; - bool useMusl = false; std::map hostInfoMap_; }; } // namespace Hardware