ubuntu环境下使用make config nconfig menuconfig xconfig gconfig的方法及效果图

本文介绍了U-boot中的多种配置方法,包括纯文本配置(config)、基于菜单的配置(menuconfig)、基于GTK+的图形配置(gconfig)等,并提供了每种配置方式的使用步骤及特点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

看U-boot的make文件,在帮助页面发现一片config方法,逐一尝试,看看有什么区别

注意,下面使用的make命令中都带有 O=/tmp/build 表示所有的输出文件都放到/tmp/build目录中,而这个目录是临时目录,关机时将被清空,如果不需要可以删去或者更换目录

Configuration targets:
  config          - Update current config utilising a line-oriented program
  nconfig         - Update current config utilising a ncurses menu based program
  menuconfig      - Update current config utilising a menu based program
  xconfig         - Update current config utilising a Qt based front-end
  gconfig         - Update current config utilising a GTK+ based front-end
  oldconfig       - Update current config utilising a provided .config as base
  localmodconfig  - Update current config disabling modules not loaded
  localyesconfig  - Update current config converting local mods to core
  defconfig       - New config with default from ARCH supplied defconfig
  savedefconfig   - Save current config as ./defconfig (minimal config)
  allnoconfig     - New config where all options are answered with no
  allyesconfig    - New config where all options are accepted with yes
  allmodconfig    - New config selecting modules when possible
  alldefconfig    - New config with all symbols set to default
  randconfig      - New config with random answer to all options
  listnewconfig   - List new options
  olddefconfig    - Same as oldconfig but sets new symbols to their default value without prompting

config

使用命令

make O=/tmp/build config

效果如下图

终端会列出所有配置项,需要依次选择,上百甚至几百个配置项选择非常耗时,不建议使用。

 

 

nconfig

 

使用命令

make O=/tmp/build nconfig

效果如下图

比单纯的config界面要友好些,使用方向键操作。好像不需要什么特殊的支持库,我电脑上是直接使用的。

 

 

menuconfig

使用最多的一种配置方法

可能提示缺的支持库

sudo apt-get install libncurses5-dev

使用命令

make O=/tmp/build menuconfig

效果如下图

越来越好看了,虽然还是文本的,但是多了一些背景,看起来像是视窗的。

 

 

xconfig

带QT界面的配置软件

需要先安装qt库

sudo apt-get install libqt4-dev

后使用

make O=/tmp/build xconfig

效果如下图

使用鼠标点一点就可以配置好,和windows环境非常类似。

 

 

gconfig

带GTK+界面的配置软件

需要先安装GTK+库

sudo apt-get install gtk+-2.0 glib-2.0 libglade2-dev

后使用

make O=/tmp/build gconfig

效果如下图

Build directory for the kernel ------------------------------ When compiling the kernel, all output files will per default be stored together with the kernel source code. Using the option ``make O=output/dir`` allows you to specify an alternate place for the output files (including .config). Example:: kernel source code: /usr/src/linux-4.X build directory: /home/name/build/kernel To configure and build the kernel, use:: cd /usr/src/linux-4.X make O=/home/name/build/kernel menuconfig make O=/home/name/build/kernel sudo make O=/home/name/build/kernel modules_install install Please note: If the ``O=output/dir`` option is used, then it must be used for all invocations of make. Configuring the kernel ---------------------- Do not skip this step even if you are only upgrading one minor version. New configuration options are added in each release, and odd problems will turn up if the configuration files are not set up as expected. If you want to carry your existing configuration to a new version with minimal work, use ``make oldconfig``, which will only ask you for the answers to new questions. - Alternative configuration commands are:: "make config" Plain text interface. "make menuconfig" Text based color menus, radiolists & dialogs. "make nconfig" Enhanced text based color menus. "make xconfig" Qt based configuration tool. "make gconfig" GTK+ based configuration tool. "make oldconfig" Default all questions based on the contents of your existing ./.config file and asking about new config symbols. "make silentoldconfig" Like above, but avoids cluttering the screen with questions already answered. Additionally updates the dependencies. "make olddefconfig" Like above, but sets new symbols to their default values without prompting. "make defconfig" Create a ./.config file by using the default symbol values from either arch/$ARCH/defconfig or arch/$ARCH/configs/${PLATFORM}_defconfig, depending on the architecture. "make ${PLATFORM}_defconfig" Create a ./.config file by using the default symbol values from arch/$ARCH/configs/${PLATFORM}_defconfig. Use "make help" to get a list of all available platforms of your architecture. "make allyesconfig" Create a ./.config file by setting symbol values to 'y' as much as possible. "make allmodconfig" Create a ./.config file by setting symbol values to 'm' as much as possible. "make allnoconfig" Create a ./.config file by setting symbol values to 'n' as much as possible. "make randconfig" Create a ./.config file by setting symbol values to random values. "make localmodconfig" Create a config based on current config and loaded modules (lsmod). Disables any module option that is not needed for the loaded modules. To create a localmodconfig for another machine, store the lsmod of that machine into a file and pass it in as a LSMOD parameter. target$ lsmod > /tmp/mylsmod target$ scp /tmp/mylsmod host:/tmp host$ make LSMOD=/tmp/mylsmod localmodconfig The above also works when cross compiling. "make localyesconfig" Similar to localmodconfig, except it will convert all module options to built in (=y) options. You can find more information on using the Linux kernel config tools in Documentation/kbuild/kconfig.txt. - NOTES on ``make config``: - Having unnecessary drivers will make the kernel bigger, and can under some circumstances lead to problems: probing for a nonexistent controller card may confuse your other controllers. - A kernel with math-emulation compiled in will still use the coprocessor if one is present: the math emulation will just never get used in that case. The kernel will be slightly larger, but will work on different machines regardless of whether they have a math coprocessor or not. - The "kernel hacking" configuration details usually result in a bigger or slower kernel (or both), and can even make the kernel less stable by configuring some routines to actively try to break bad code to find kernel problems (kmalloc()). Thus you should probably answer 'n' to the questions for "development", "experimental", or "debugging" features. ——详述一下这段话的步骤
最新发布
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值