我正在进入 Linux 内核编程,并且我已经成功地构建了自己的内核几次。但是,我已经使用从互联网上找到的分步指南完成了它,我并不真正了解构建过程中会发生什么。到目前为止,我已经找到了几种不同的构建内核的方法。一种是:
make-kpkg -j5 --initrd kernel-image kernel-headers
Run Code Online (Sandbox Code Playgroud)
据我所知,make-kpkg 是一个 Debian 程序,用于构建和打包内核相关的东西。--initrd 用于自动生成 initrd 映像。最后两个参数(kernel-image 和 kernel-headers)的用途是什么?
构建内核的另一种方法是
make deb-pkg
Run Code Online (Sandbox Code Playgroud)
与第一个命令相比,这个命令有什么作用?
此外,在本指南中,构建内核是通过以下方式完成的:
fakeroot debian/rules clean
fakeroot debian/rules binary-headers binary-generic
Run Code Online (Sandbox Code Playgroud)
在 Ubuntu 上构建内核的推荐方法是什么?当我执行上述命令之一时究竟会发生什么?如果我希望手动执行上述命令之一执行的所有操作,我必须采取哪些步骤?
我有一台运行 Debian Squeeze 的旧服务器。我正在尝试下载某个包的源代码,以便我可以手动修补它。但是,apt-get source
我尝试的每个包都失败了。一个例子:
root@xxxx:/home/myhomedir# apt-get source emacs
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Ignore unavailable target release 'stable' of package 'emacs'
E: Unable to find a source package for
Run Code Online (Sandbox Code Playgroud)
我尝试的每个其他源包都会重复相同的错误。但是,安装具有相同名称的包是可行的(例如apt-get install emacs
)。以下是我的内容sources.list
:
# the basic archive
deb ftp://ftp.fi.debian.org/debian/ squeeze-lts main non-free contrib
deb-src ftp://ftp.fi.debian.org/debian/ squeeze-lts main non-free contrib
# the security patches
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
Run Code Online (Sandbox Code Playgroud)
我最初认为这是因为我从中得到的错误apt-get …