diff --git a/BUILD.gn b/BUILD.gn
index bdd7c7819175caf401d2f9f000be2213cdaad0fe..fe8fe2649b2622bbaaa2eb785d9e723a6b6f8edb 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -14,10 +14,7 @@
import("//build/lite/ndk/ndk.gni")
group("utils") {
- deps = [
- "os_dump:utils_os_dump",
- "//foundation/distributeddatamgr/appdatamgr/frameworks/native/kv_store:kv_store",
- ]
+ deps = [ "//foundation/distributeddatamgr/appdatamgr/frameworks/native/kv_store:kv_store" ]
if (ohos_kernel_type == "liteos_m") {
deps += [ "file:file" ]
diff --git a/README.md b/README.md
index 561b0ed8bf3a39bca0534bffa1e3b6351c531cda..54a449b6fad455e83ac292e361cb2e314f09a0f3 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,6 @@ utils/native/lite/ # Root directory
│ └── src # KV store source file
├── memory
│ └── include # Memory pool management APIs
-├── os_dump # System attribute dumping
└── timer_task # Timer implementation
```
@@ -140,20 +139,6 @@ utils/native/lite/ # Root directory
```
-- **System attribute dumping**
-
- LiteOS Cortex-M kernel: Run the following command over the serial port to dump the current system parameters:
-
- ```
- AT+SYSPARA
- ```
-
- LiteOS Cortex-A kernel: Run the **os\_dump** command in the **bin** directory to dump the current system parameters:
-
- ```
- ./bin/os_dump syspara
- ```
-
## Repositories Involved
diff --git a/README_zh.md b/README_zh.md
index 371470e8b54dbdd32a1bca8f5dfc09b481c761e7..331af9b17c679cd0b7b89ca2be68ac5ce9e059bf 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -84,7 +84,6 @@ utils/native/lite/ # 公共基础库根目录
│ └── src # KV存储源文件
├── memory
│ └── include # 内存池管理接口
-├── os_dump # Dump系统属性
└── timer_task # Timer实现
```
@@ -140,20 +139,6 @@ utils/native/lite/ # 公共基础库根目录
```
-- **dump系统属性**
-
- LiteOS-M内核:在串口执行如下命令,即可打印当前系统参数
-
- ```
- AT+SYSPARA
- ```
-
- LiteOS-A内核:在bin路径下执行os\_dump,即可打印当前系统参数
-
- ```
- ./bin/os_dump syspara
- ```
-
## 涉及仓
diff --git a/memory/bundle.json b/memory/bundle.json
index bdb272f800537357dab80162df0ae7209850172a..41c06cd31af7c96e2cf9ac4ce6e7a8acaf808cbc 100644
--- a/memory/bundle.json
+++ b/memory/bundle.json
@@ -30,7 +30,7 @@
]
},
"build": {
- "sub_component": [ "//utils/native/lite/os_dump:utils_os_dump" ],
+ "sub_component": [],
"inner_kits": [],
"test": []
}
diff --git a/os_dump/BUILD.gn b/os_dump/BUILD.gn
deleted file mode 100644
index 2a8d0f6b31538359a9e6c86e393abf1d21b0e075..0000000000000000000000000000000000000000
--- a/os_dump/BUILD.gn
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright (c) 2020 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//build/lite/config/component/lite_component.gni")
-
-lite_component("utils_os_dump") {
- features = []
- if (ohos_kernel_type == "liteos_a") {
- features += [ ":os_dump" ]
- }
- if (ohos_kernel_type == "liteos_m") {
- features += [ ":dump_static" ]
- }
-}
-
-if (ohos_kernel_type == "liteos_a") {
- executable("os_dump") {
- sources = [
- "dump_syspara.c",
- "os_dump.c",
- ]
- include_dirs = [
- "./",
- "//base/startup/syspara_lite/interfaces/kits",
- ]
- deps = [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ]
- }
-}
-
-if (ohos_kernel_type == "liteos_m") {
- static_library("dump_static") {
- sources = [ "dump_syspara.c" ]
- include_dirs = [
- "//base/startup/syspara_lite/interfaces/kits",
- "//base/iot_hardware/interfaces/kits/wifiiot_lite",
- ]
- deps = [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ]
- }
-}
diff --git a/os_dump/bundle.json b/os_dump/bundle.json
deleted file mode 100644
index 361eae8d904f687cf0531d81e114f2099b812cdd..0000000000000000000000000000000000000000
--- a/os_dump/bundle.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "name": "@openharmony/os_dump",
- "version": "3.1.0",
- "license": "Apache License 2.0",
- "description": "Providing commands for dumping system property.",
- "publishAs": "code-segment",
- "segment": {
- "destPath": "utils/native/lite/os_dump"
- },
- "dirs": {},
- "scripts": {},
- "author": {},
- "repository": "",
- "component": {
- "name": "os_dump",
- "subsystem": "utils",
- "features": [],
- "adapted_system_type": [
- "mini",
- "small"
- ],
- "rom": "3.7KB",
- "ram": "~4.75KB",
- "deps": {
- "thrid_party": [
- "bounds_checking_function"
- ],
- "kernel_special": {},
- "board_special": {},
- "components": [
- "syspara_lite",
- "iot_controller"
- ]
- },
- "build": {
- "sub_component": [],
- "inner_kits": [],
- "test": []
- }
- }
-}
diff --git a/os_dump/dump_syspara.c b/os_dump/dump_syspara.c
deleted file mode 100644
index 539b1b2bce26ab4512bb081be89b5a213cb3f29e..0000000000000000000000000000000000000000
--- a/os_dump/dump_syspara.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2020 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "dump_syspara.h"
-#include
-#include
-#include "securec.h"
-#include "parameter.h"
-#if defined(__LITEOS_RISCV__)
-#include "wifiiot_at.h"
-#endif
-
-#define API_VERSION_LEN 10
-
-static const char* GetSdkApiLevel(void)
-{
- static char sdkApiVersion[API_VERSION_LEN] = {0};
- int sdkApi = GetSdkApiVersion();
- sprintf_s(sdkApiVersion, API_VERSION_LEN, "%d", sdkApi);
- return (const char*)sdkApiVersion;
-}
-
-static const char* GetFirstApiLevel(void)
-{
- static char firstApiVersion[API_VERSION_LEN] = {0};
- int firstApi = GetFirstApiVersion();
- sprintf_s(firstApiVersion, API_VERSION_LEN, "%d", firstApi);
- return (const char*)firstApiVersion;
-}
-
-static const SysParaInfoItem SYSPARA_LIST[] = {
- {"DeviceType", GetDeviceType},
- {"Manufacture", GetManufacture},
- {"Brand", GetBrand},
- {"MarketName", GetMarketName},
- {"ProductSeries", GetProductSeries},
- {"ProductModel", GetProductModel},
- {"SoftwareModel", GetSoftwareModel},
- {"HardwareModel", GetHardwareModel},
- {"Serial", GetSerial},
- {"OSFullName", GetOSFullName},
- {"DisplayVersion", GetDisplayVersion},
- {"BootloaderVersion", GetBootloaderVersion},
- {"GetSecurityPatchTag", GetSecurityPatchTag},
- {"AbiList", GetAbiList},
- {"SdkApiVersion", GetSdkApiLevel},
- {"FirstApiVersion", GetFirstApiLevel},
- {"IncrementalVersion", GetIncrementalVersion},
- {"VersionId", GetVersionId},
- {"BuildType", GetBuildType},
- {"BuildUser", GetBuildUser},
- {"BuildHost", GetBuildHost},
- {"BuildTime", GetBuildTime},
- {"BuildRootHash", GetBuildRootHash},
-};
-
-int QuerySysparaCmd(void)
-{
- int index = 0;
- int dumpInfoItemNum = (sizeof(SYSPARA_LIST) / sizeof(SysParaInfoItem));
- const char *temp = NULL;
- int (*pfnPrintf)(const char *format, ...) = NULL;
-#if defined(__LITEOS_RISCV__)
- pfnPrintf = &AtPrintf;
-#else
- pfnPrintf = &printf;
-#endif
-
- pfnPrintf("Begin dump syspara\r\n");
- pfnPrintf("=======================\r\n");
- while (index < dumpInfoItemNum) {
- temp = SYSPARA_LIST[index].getInfoValue();
- pfnPrintf("%s:%s\r\n", SYSPARA_LIST[index].infoName, temp);
- index++;
- }
- pfnPrintf("=======================\r\n");
- pfnPrintf("End dump syspara\r\n");
- pfnPrintf = NULL;
- return 0;
-}
diff --git a/os_dump/dump_syspara.h b/os_dump/dump_syspara.h
deleted file mode 100644
index 528d49a974f668e6938146d6e736f4657974e15d..0000000000000000000000000000000000000000
--- a/os_dump/dump_syspara.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2020 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef DUMP_SYSPARA_H
-#define DUMP_SYSPARA_H
-
-typedef struct {
- char *infoName;
- const char *(*getInfoValue)(void);
-} SysParaInfoItem;
-
-int QuerySysparaCmd(void);
-
-#endif
diff --git a/os_dump/os_dump.c b/os_dump/os_dump.c
deleted file mode 100644
index f2a40da08292f650d817582d3aaeedfe456d4384..0000000000000000000000000000000000000000
--- a/os_dump/os_dump.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2020 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include "dump_syspara.h"
-
-typedef struct {
- char *serviceName;
- int (*serviceHandler)();
-} ServiceItem;
-
-static const ServiceItem SERVICE_LIST[] = {
- {"syspara", QuerySysparaCmd},
-};
-
-static void Usage()
-{
- printf("Usage:os_dump [--help | -l | SERVICE]\n"
- " --help: shows this help\n"
- " -l: only list services, do not dump them\n"
- " SERVICE: dumps only service SERVICE\n");
-};
-
-int main(int argc, char **argv)
-{
- static struct option longOptions[] = {
- {"help", no_argument, 0, 0},
- {0, 0, 0, 0}
- };
- int serviceNum = (sizeof(SERVICE_LIST) / sizeof(ServiceItem));
- int c;
- int optionIndex = 0;
- if (optind == argc) {
- Usage();
- return 0;
- }
-
- optind = 1;
- while (1) {
- c = getopt_long(argc, argv, "l", longOptions, &optionIndex);
- if (c == -1) {
- break;
- }
- switch (c) {
- case 0:
- if (!strcmp(longOptions[optionIndex].name, "help")) {
- Usage();
- }
- break;
- case 'l':
- printf("OptionList:\n");
- for (int i = 0; i < serviceNum; i = i + 1) {
- printf("%s\n", SERVICE_LIST[i].serviceName);
- }
- break;
- default:
- Usage();
- break;
- }
- }
-
- for (int i = optind; i < argc; i++) {
- for (int j = 0; j < serviceNum; j++) {
- if (!strcmp(argv[i], SERVICE_LIST[j].serviceName)) {
- int ret = SERVICE_LIST[j].serviceHandler();
- return ret;
- }
- }
- printf("Service %s not registered! Try os_dump --help\n", argv[i]);
- break;
- }
- return 0;
-}