Raspbian的默认3.1.9+内核的内核源代码在哪里?


13

Raspbian的默认内核版本是3.1.9+。当我尝试编译一个额外的内核模块时,由于缺少内核头文件,因此我收到很多错误消息。我已经检查了Raspbian存储库,但是找不到3.1.9+内核头文件和内核源代码。

如果我搜索3.2.0,则可以安装新内核(linux-image-3.2.0-3-rpi),标头(linux-headers-3.2.0-3-rpi)和源(linux-source) -3.2),我可以编译额外的模块。不幸的是,内核3.2对我来说非常不稳定,因此无法进行此升级。

Answers:


9

在我看来,Raspbian仓库中没有内核3.1.9+的deb软件包。根据 Alex Bradbury(asb)的介绍,他们基于https://github.com/raspberrypi/linux构建了Raspbian内核。基于内核编译文档,我(以root用户身份)执行了以下操作:

cd /usr/src
git clone --depth 1 https://github.com/raspberrypi/linux.git
ln -s linux linux-3.1.9+
cd linux
zcat /proc/config.gz > .config
ln -s /usr/src/linux /lib/modules/3.1.9+/build

之后,我能够重新编译外部模块。

一些注意事项:

  • 我已经克隆了最新版本的内核源代码,它比Raspbian内核映像更新。如果您确实需要完全相同的内核版本,则此旧版本可能会更好。

  • 为了确定,我也重新编译了整个内核。如果只需要编译一个外部模块,则不要这样做,因为它要花费数小时。

  • 我不得不修改外部模块的Makefile(8192cu)(将ARCH设置为arm而不是armv6l)。

3
+1做得好。他们应该真正将标头放入存储库中。
吉文斯


1

Stange这是多么困难...我只能在源列表中找到这个包:

Package: linux-libc-dev
Source: linux
Version: 3.2.21-1+rpi1
Architecture: armhf
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Installed-Size: 2790
Conflicts: linux-kernel-headers
Replaces: linux-kernel-headers
Provides: linux-kernel-headers
Multi-Arch: same
Priority: optional
Section: devel
Filename: pool/main/l/linux/linux-libc-dev_3.2.21-1+rpi1_armhf.deb
Size: 764146
SHA256: b75b35ccf8e7fbac582ad08af9579a23095f9dbbc9e7369430e43d584afc48fd
SHA1: e8c3bb2a30483c51ee39b525becd6e213ae9c2c7
MD5sum: 840e28237198aa137dfcdb558ef1cbf5
Description: Linux support headers for userspace development
 This package provides userspaces headers from the Linux kernel.  These
 headers are used by the installed headers for GNU glibc and other system
 libraries.

它似乎提供了您需要的工具,但是我不知道为什么没有名为的软件包linux-kernel-headers

但是,如果您查看软件包存档,则可以找到以下内容:

http://archive.raspbian.org/raspbian/pool/main/l/linux-latest/

该目录中的头文件包之一可能是您需要的内核的文件。

不幸的是,这就是我目前可以提供的全部信息,尽管我自己还没有安装Raspbian,尽管它在我的TODO列表中。


再次考虑,这仍然是您想要的版本错误的版本,不是吗?
吉文斯

这也适用于内核3.2。我在问题中提到的软件包的版本号(3.2.21-1 + rpi1)是相同的(例如linux-headers-3.2.0-3-all_3.2.21-1 + rpi1_armhf.deb)
asalamon74

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.