cubieboard编译安装kernel3.4

下载内核源码

可以下载zip包,也可以克隆git仓库到本地


$ mkdir ~/cubieboard
$ cd ~/cubieboard
$ wget https://github.com/linux-sunxi/linux-sunxi/archive/sunxi-3.4.zip
$ unzip sunxi-3.4.zip
$ cd linux-sunxi-3.4

编译内核

检查内核源码树是否纯净,不纯净则会clean


make ARCH=arm mrproper

生成默认配置


make ARCH=arm sun4i_defconfig

调出配置菜单


make ARCH=arm menuconfig

配置的选项很关键,着重注意以下几项:

  • SATA 硬盘支持
  • GPIO 支持
  • 无线网络支持
  • USB 网卡支持
  • Tun/Tap 设备支持 摄像头支持
  • 红外线支持
  • USB 串口设备支持 HDMI 输出支持

此外,选中Realtek 8188E USB WiFi 驱动(我的水星网卡驱动)

硬盘支持:Device Drivers —> Serial ATA and Parallel ATA drivers —> SoftWinner Platform AHCI SATA support
GPIO支持:Device Drivers —> GPIO Support —> GPIO Support for sunxi platform
无线网卡支持:Networking support —> Wireless —> Generic IEEE 802.11 Networking Stack (mac80211)
USB网卡支持:Device Drivers —> Network device support —> Wireless LAN —> Ralink driver support
Tun/Tap设备支持:Device Drivers —> Network device support —> Universal TUN/TAP device driver support
摄像头支持:Device Drivers —> Multimedia support —> Video capture adapters —> V4L USB devices —> USB Video Class (UVC)
红无线支持:Device Drivers —> Input device support —> Keyboards —> sunxi IR support
USB 串口设备支持:Device Drivers —> USB support —> USB Serial Converter support —> USB Prolific 2303 Single Port Serial Driver
HDMI 输出支持:Device Drivers —> Graphics support —> Support for frame buffer devices —> HDMI Driver Support(sunxi)

编译内核uImage文件


make uImage CROSS_COMPILE=arm-linux-gnueabihf- -j2 ARCH=arm modules

发掘更多的可用内存
Cubieboard 的默认内核配置文件中提供了 mali-GPU 支持,并为 X11、DRI、Framebuffer 保留了 200 多兆内 存,这些内存将无法被用户使用;如果想把 Cubieboard 作为一个无显示输出的服务器使用,那么这些保留内存应 当释放出来供用户使用,此时必须修改内核的配置,使其中包含如下选项(修改时可在 menuconfig 中按’/’ 键来搜 索相关选项),然后再重新编译内核:

CONFIG_SUN4I_G2D=n
CONFIG_FB_SUNXI_RESERVED_MEM=n
CONFIG_SUN4I_G2D_MODULE=n
CONFIG_FB_SUNXI_RESERVED_MEM=n
CONFIG_SUNXI_MALI_RESERVED_MEM=n
CONFIG_DRM_MALI=n
CONFIG_MALI=n
CONFIG_MALI400=n

<完>

遇到的问题

如果在编译时报如下错误:

HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
net/Kconfig:343: can't open file "net/mac80211/Kconfig"
make[1]: *** [sun4i_defconfig] Error 1
make: *** [sun4i_defconfig] Error 2

可以打开 net/Kconfig 文件 把343行注释掉,重试上步骤。
输出如下信息:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#

表示该步骤执行成功

这篇文章目前没有评论

Leave a Reply

(必填项)

(必填项)

(可选)