kconfig_对自己的项目使用kconfig

KConfig是一种强大的Linux配置工具,能解决脚本配置文件的问题。它提供自动配置生成,设定默认值,保存历史配置等功能。通过解释器mconf、gconf等,用户可以选择所需选项并保存。本文介绍了KConfig的工作原理,展示了如何在示例项目中应用,并提供了通过文本和图形界面运行的解释器示例。
摘要由CSDN通过智能技术生成

kconfig

介绍 (Intro)

Every Linux professional write scripts. Someеimes light, linear. Sometimes complex script with functions and libs(yes, you can write your bash-library for use in other scripts).

每个Linux专业人士都编写脚本。 淡淡的,线性的。 有时带有功能和库的复杂脚本(是的,您可以编写bash库以供其他脚本使用)。

But some of the scripts need a configuration file to work. For instance, I wrote a script that builds the ubuntu image for pxe, and I need to change the build process without build-script changes. The best way to resolve this task is to add configuration files.

但是某些脚本需要配置文件才能起作用。 例如,我编写了一个脚本来为pxe构建ubuntu图像,我需要更改构建过程而无需更改构建脚本。 解决此任务的最佳方法是添加配置文件。

Writing this config by hands is not a great idea:

手动编写此配置不是一个好主意:

  • every user should know all available options

    每个用户都应该知道所有可用选项
  • hight risk of incorrect data entry

    错误输入数据的高风险
  • uncomfortable

    不舒服
  • maybe something else

    也许别的

Linux kernel gave us a great solution — KConfig. This system resolves all these troubles:

Linux内核为我们提供了一个很好的解决方案-KConfig。 该系统解决了所有这些问题:

  • New config generated automatically

    自动生成新配置
  • You can set the default value

    您可以设置默认值
  • The previous version of config saved automatically

    以前版本的config自动保存
  • text/graphical interface available

    提供文字/图形界面

These are not all the benefits. You can see more here.

这些并不是全部好处。 你可以在这里看到更多。

这个怎么运作 (How it works)

<
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值