打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
内核编译之一:前奏
主机环境:
Kubuntu 8.04
gcc-4.2.3
--------------------------------------------------------------
在ubuntu系统中,要编译内核,还需要安装一系列相应的工具才行。这篇文章,正是针对这一过程的一次记录,目标是可以通过 make menuconfig 或 make xconfig 配置内核参数
--------------------------------------------------------------
参考
apt用法参考 《
UbuntuHelp:AptGet/Howto

内核编译参考 《
配置并编译内核[更新到linux-2.6.26.2]


Master Kernel Thread

--------------------------------------------------------------
我的做法是从make menuconfig开始
$make menuconfig
错误信息:
*** Unable to find the ncurses libraries or the *** required header files. *** 'make menuconfig' requires the ncurses libraries. *** *** Install ncurses (ncurses-devel) and try again. ***make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1make: *** [menuconfig] 错误2
可以看出,是因为找不到 ncurses 导致的错误。那么尝试安装 ncurses
$sudo apt-get install ncurses
提示信息:
正在读取软件包列表... 完成正在分析软件包的依赖关系树读取状态信息... 完成现在没有可用的软件包 ncurses , 但是它被其他的软件包引用了。这可能意味着这个缺失的软件包可能已被废弃,或者只能在其他发布源中找到E: 软件包 ncurses 还没有可供安装的候选者
根据《
Compiling the Kernel - errors in make menuconfig ARCH=um
》再试:
$sudo apt-get install libncurses*
提示信息:
正在读取软件包列表... 完成正在分析软件包的依赖关系树读取状态信息... 完成注意,根据正则表达式“libncurses*” 选中了 libncurses4注意,根据正则表达式“libncurses*” 选中了 libncurses5注意,根据正则表达式“libncurses*” 选中了 libncurses-ruby1.8注意,根据正则表达式“libncurses*” 选中了 libncurses-ryby1.9注意,根据正则表达式“libncurses*” 选中了 libncurses-dev注意,根据正则表达式“libncurses*” 选中了 libncursesw5-dbg注意,根据正则表达式“libncurses*” 选中了 libncursesw5-dev注意,根据正则表达式“libncurses*” 选中了 libncurses-ruby注意,根据正则表达式“libncurses*” 选中了 libncurses5-dbg注意,根据正则表达式“libncurses*” 选中了 libncurses5-dev注意,根据正则表达式“libncurses*” 选中了 libncursesw5已经不需要下列自动安装的软件包: libchewing3-data ttf-wqy-zenhei scim-chewing thunderbird-locale-zh-tw language-support-translations-zh libchewing3 xfonts-wqy openoffice.org-l10n-zh-cn openoffice.org-l10n-zh-tw openoffice.org-help-zh-cn openoffice.org-help-zh-tw language-support-fonts-zh使用‘apt-get autoremove’ 来删除它们。将会安装下列额外的软件包: libncurses-ruby libncurses-ruby1.8 libncurses-ruby1.9 libncurses4 libncurses5-dbg libncurses5-dev libncursesw5-dbg libncursesw5-dev libruby1.8 libruby1.9 ruby1.8 ruby1.9建议安装的软件包: rdoc1.8 ri1.8 ruby1.8-examples rdoc1.9 ri1.9 ruby1.9-examples下列【新】软件包将被安装: libncurses-ruby libncurses-ruby1.8 libncurses-ruby1.9 libncurses4 libncurses5-dbg libncurses5-dev libncursesw5-dbg libncursesw5-dev libruby1.8 libruby1.9 ruby1.8 ruby1.9共升级了0个软件包,新安装了12个软件包,要卸载0个软件包,有60个软件未被升级。需要下载8868kB的软件包。操作完成后,会消耗掉33.9MB的额外磁盘空间。您希望继续执行吗?[Y/n]
选择Y继续执行,完成后,执行$sudo make menuconfig,OK!!!
进行到这,已经可以通过make menuconfig看到内核参数配置了。不过,如果要用X11模式的make xconfig,却还是不行的
$ sudo make xconfig
错误信息:
HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/docproc CHECK qt** Unable to find the QT3 installation. Please make sure that* the QT3 development package is correctly installed and* either install pkg-config or set the QTDIR environment* variable to the correct location.* HOSTCC scripts/kconfig/conf.osed scripts/kconfig/lkc_defs.h 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' HOSTCC scripts/kconfig/kconfig_load.o HOSTCC scripts/kconfig/kxgettext.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/lex.zconf.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.omake[1]: *** 没有规则可以创建“scripts/kconfig/qconf.o” 需要的目标“scripts/kconfig/.tmp_qtcheck” 。 停止。make: ***[xconfig] 错误2
根据《
配置并编译内核[更新到linux-2.6.26.2]
》知道在正常步骤下,除了安装ncurses外,还要安装build-essential 和 kernel-package
好吧,先开始查询一下,从kernel-package开始吧,毕竟带着kernel,估计比较重要
查询kernel-package信息
$ apt-cache show kernel-package
Package: kernel-packagePriority: optionalSection: miscInstalled-Size: 2192Maintainer: Ubuntu Core Developers Original-Maintainer: Manoj Srivastava Architecture: allVersion: 11.001Depends: perl, dpkg (>= 1.4), dpkg-dev (>= 1.4.0.9), gcc | c-compiler, make (>= 3.80-10), po-debconf, gettext, fileRecommends: libc6-dev | libc-dev, bzip2Suggests: linux-source | kernel-source, libdb3-dev, libncurses-dev, docbook-utilsFilename: pool/main/k/kernel-package/kernel-package_11.001_all.debSize: 510452MD5sum: fd820c2e3970fc8d300aef4a2b9e15caSHA1: 34924f84fe4cd604869bf4717d4c0230b3117291SHA256: 3ff71a3e2e69d5073310e8e83fc982baefec983af7139ed7cc7a4ce6cf42c38aDescription: A utility for building Linux kernel related Debian packages. This package provides the capability to create a debian kernel-image package by just running make-kpkg kernel_image in a kernel source directory tree. It can also package the relevant kernel headers into a kernel-headers package. In general, this package is very useful if you need to create a custom kernel, if, for example, the default kernel does not support some of your hardware, or you wish a leaner, meaner kernel. It also scripts the steps that need be taken to compile the kernel, which is quite convenient (forgetting a crucial step once was the initial motivation for this package). Please look at /usr/share/doc/kernel-package/Rationale.gz for a full list of advantages of this package.Bugs: mailto:ubuntu-users@lists.ubuntu.comOrigin: Ubuntu
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
嵌入式ARM移植之一:前奏
'make menuconfig' requires the ncurses libraries.
Libncurses5-dev下载、安装libncurses5-dev.deb教程
修复mac 下 make menuconfig 的bug以及自定义make menuconfig界面
Ubuntu 12.04 下安装Xen 以及使用Xen 安装winXP虚拟机
kernel定制,编译内核
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服