!1 Add package kconfigDetector v1.0.0
From: @sunying2022 Reviewed-by: @xiexiuqi Signed-off-by: @xiexiuqi
This commit is contained in:
commit
eb47aac55e
68
README.en.md
68
README.en.md
@ -1,22 +1,63 @@
|
||||
# kconfigDetector
|
||||
|
||||
#### Description
|
||||
Tools for detection kernel configuration error values.
|
||||
|
||||
kconfigDetector is a series of detection tools provided for kernel configuration, which include:
|
||||
* kconfigDepDetector
|
||||
kernel configuration error value detection tool.
|
||||
Based on the Kconfig definition of each configuration item in the kernel source code, it detects the error values in the kernel configuration file that do not satisfy the constraints of dependencies and fetches, and provides a query function for parent and child configuration items.
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
* Basic logic for error value detection
|
||||
+ Preprocessing: Read all the Kconfig content to be parsed to generate the ".Kconfig" file
|
||||
+ Parse: Grammar analysis, read the .Kconfig file and generate the data structure of the node tree
|
||||
+ Checker: Based on the syntax analysis results, check whether the profile takes values that satisfy the constraint logical expressions
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
1. Installing dependencies
|
||||
> yum install -y python3 python3-devel python3-setuptools python-ply
|
||||
> pip3 install ply
|
||||
2. Get Code
|
||||
> git clone https://gitee.com/openeuler/kconfigDetector.git
|
||||
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
* kconfigDepDetector
|
||||
1. Run command
|
||||
check_kconfig_dep <OPTIONS>
|
||||
|
||||
Parameter Description
|
||||
- OPTIONS
|
||||
|
||||
| Parameter | Description |
|
||||
| ---- | ---- |
|
||||
| --checkfile, -c | Required, profile to be checked |
|
||||
| --kernelversion, -v | Required, kernel version |
|
||||
| --kernelpath, -s | Optional, kernel source path (required for the first check of this version)|
|
||||
| --output, -o | Optional, the output path of the detect result, default current directory|
|
||||
| --arch, -a | Optional, target architecture, local architecture of the default check environment |
|
||||
|
||||
|
||||
2. Output
|
||||
After running, the check result file version_architecture_error.json is output, and the error message is printed in the terminal category as follows
|
||||
> ---------error type: num-------------
|
||||
> [Configuration item name]
|
||||
> value = Configuration item value
|
||||
> path = Configuration item definition file path
|
||||
> type = Configuration item type (printed only on type error)
|
||||
> rev_select = Expression and value of the parent configuration item for forced selection (printed only when unmet dependence)
|
||||
> depends = Expressions and values of parent configuration items for dependencies (printed only when depends error and unmet dependence)
|
||||
> restrict = Expression and value of the value constraint (printed only in case of range error and restrict warning)
|
||||
|
||||
|
||||
Error types include:
|
||||
- type error: The value of the configuration item does not match the type.
|
||||
- depends error: The configuration item is not started by select and the dependency is not satisfied.
|
||||
- lack config: The specified configuration item is not found in the kernel Kconfig file.
|
||||
- range error: Does not meet the range of values specified by range.
|
||||
- restrict warning: The value of the configuration item does not meet the requirements, usually for the default or simply keyword.
|
||||
- unmet dependences: The configuration item is forced to start by select, but the dependency is not satisfied.
|
||||
|
||||
#### Contribution
|
||||
|
||||
@ -25,12 +66,3 @@ Software architecture description
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
|
||||
65
README.md
65
README.md
@ -1,23 +1,63 @@
|
||||
# kconfigDetector
|
||||
|
||||
#### 介绍
|
||||
Tools for detection kernel configuration error values.
|
||||
kconfigDetector是为内核配置提供的一系列检测工具. 包括:
|
||||
* kconfigDepDetector 内核配置项错误值检测工具
|
||||
依据内核源码中各配置项的Kconfig定义,检测出内核配置文件中不满足依赖、取值等约束条件的错误值,并提供父类和子类配置项查询功能。
|
||||
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
* 错误值检测基本逻辑
|
||||
+ 预处理(Preprocessing),读取所有需要解析的Kconfig内容生成".Kconfig"文件
|
||||
+ 语法分析(Parse),读取.Kconfig文件,生成节点树的数据结构
|
||||
+ 检查配置文件(Checker),根据语法分析结果,检查配置文件取值是否满足约束条件的逻辑表达式
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
1. 安装依赖
|
||||
> yum install -y python3 python3-devel python3-setuptools python-ply
|
||||
> pip3 install ply
|
||||
2. 获取代码
|
||||
> git clone https://gitee.com/openeuler/kconfigDetector.git
|
||||
|
||||
#### 使用说明
|
||||
* kconfigDepDetector
|
||||
1. 运行命令
|
||||
check_kconfig_dep <OPTIONS>
|
||||
|
||||
参数说明
|
||||
- OPTIONS
|
||||
|
||||
| 参数 | 描述 |
|
||||
| ---- | ---- |
|
||||
| --checkfile, -c | 必填,待检查配置文件 |
|
||||
| --kernelversion, -v | 必填,内核版本 |
|
||||
| --kernelpath, -s | 可选,内核源码路径(该版本首次检查必填)|
|
||||
| --output, -o | 可选,检查结果输出路径,默认当前目录 |
|
||||
| --arch, -a | 可选,目标体系架构,默认检查环境的本地架构 |
|
||||
|
||||
|
||||
2. 输出说明
|
||||
运行完成后,输出检查结果文件 版本号_架构_error.json,并在终端分类打印错误信息如下
|
||||
> ---------错误类型: 个数-------------
|
||||
> [配置项名称]
|
||||
> value = 取值
|
||||
> path = 配置项定义文件路径
|
||||
> type = 配置项类型 (仅在type error时打印)
|
||||
> rev_select = 强制选择的父类配置项表达式及取值 (仅在unmet dependence时打印)
|
||||
> depends = 依赖关系的父类配置项表达式及取值 (仅在depends error和unmet dependence时打印)
|
||||
> restrict = 取值约束的表达式及取值 (仅在range error和restrict warning时打印)
|
||||
|
||||
|
||||
错误类型包括:
|
||||
- 类型错误: type error, 配置项取值与类型不符
|
||||
- 依赖不满足: depends error, 配置项未通过select启动且依赖不满足
|
||||
- 未找到配置项: lack config, 未在内核Kconfig文件中找到指定配置项
|
||||
- range未满足: range error,不满足range规定的取值范围
|
||||
- 取值告警: restrict warning, 配置项取值未满足要求, 通常为default或imply关键字
|
||||
- 依赖风险: unmet dependences, 配置项通过select强制启动, 但是依赖未满足
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
@ -26,12 +66,3 @@ Tools for detection kernel configuration error values.
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
|
||||
BIN
kconfigDetector-v1.0.0.tar.gz
Normal file
BIN
kconfigDetector-v1.0.0.tar.gz
Normal file
Binary file not shown.
41
kconfigDetector.spec
Normal file
41
kconfigDetector.spec
Normal file
@ -0,0 +1,41 @@
|
||||
Name: kconfigDetector
|
||||
Version: v1.0.0
|
||||
Release: 1
|
||||
Summary: A series of detection tools provided for kernel configuration, include kconfig dependence check.
|
||||
License: MulanPSL2
|
||||
URL: https://gitee.com/openeuler/%{name}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
Requires: python3 python-ply
|
||||
Requires: bash
|
||||
|
||||
|
||||
%description
|
||||
A series of detection tools provided for kernel configuration.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
|
||||
|
||||
%files
|
||||
%{_bindir}/check_kconfig_dep
|
||||
%{python3_sitelib}/kconfigDetector*.egg-info
|
||||
%{python3_sitelib}/kconfigDepDetector/*
|
||||
%attr(0777,root,root) %{python3_sitelib}/kconfigDepDetector/tools
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Dec 21 2022 sunying2022<sunying@nj.iscas.ac.cn> - v1.0.0-1
|
||||
- Package init
|
||||
Loading…
x
Reference in New Issue
Block a user