温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎样为pcduino编译内核

发布时间:2021-12-01 17:56:25 来源:亿速云 阅读:113 作者:柒染 栏目:互联网科技

今天就跟大家聊聊有关怎样为pcduino编译内核,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

软件环境

  • lubuntu 13.10 amd64版 / Ubuntu Server 13.10 amd64版

  • 虚拟机20G硬盘,1G内存

为这篇教程,我全新安装多次lubuntu/ubuntu,验证过每个命令,保证能编译出一个能用的内核

安装依赖的库/工具

打开控制台,执行

sudo apt-get install -y g++-arm-linux-gnueabihf vim make u-boot-tools libusb-1.0-0-dev openssh-server pkg-config
sudo apt-get install -y texinfo ccache zlib1g-dev gawk bison flex gettext uuid-dev lib32stdc++6 curl wget ncurses-dev

注:INTEL 32位ubuntu无需安装

 lib32stdc++6


下载内核源码

推荐从百度网盘下载 pcduino内核源码打包下载

里面的均为github官网代码库的打包, 非git版删掉了.git目录,源码内容完全一样

从github下载(建议网速可以的才使用)

git clone https://github.com/pcduino/kernel.gitcd kernel
git submodule init
git submodule update       #会下载全志的sun4i内核源码, 慢慢等吧

安装交叉编译工具

根据http://linux-sunxi.org/Toolchain

ubuntu下安装交叉编译工具为

apt-get install gcc-arm-linux-gnueabihf

开始编译

打开shell,开始耗cpu吧!!

tar xf pcduino_kernel_20131127_nogit.gz   #如果是百度网盘下载的,就需要先解压咯,git下载的就无视这句了cd kernel
make clean

cd sunxi-tools
make clean
cd .../configure pcduino
make hwpack

最后输出的信息类似

  INSTALL output/lib/firmware/mts_gsm.fw
  INSTALL output/lib/firmware/mts_edge.fw
  INSTALL output/lib/firmware/edgeport/boot.fw
  INSTALL output/lib/firmware/edgeport/boot2.fw
  INSTALL output/lib/firmware/edgeport/down.fw
  INSTALL output/lib/firmware/edgeport/down2.fw
  INSTALL output/lib/firmware/edgeport/down3.bin
  INSTALL output/lib/firmware/whiteheat_loader.fw
  INSTALL output/lib/firmware/whiteheat.fw
  INSTALL output/lib/firmware/keyspan_pda/keyspan_pda.fw
  INSTALL output/lib/firmware/keyspan_pda/xircom_pgs.fw
  DEPMOD  3.4.29+make[1]: Leaving directory `/home/wendal/kernel/linux-sunxi'
cd /home/wendal/kernel/build/sun4i_defconfig-linux && arm-linux-gnueabihf-objcopy -R .note.gnu.build-id -S -O binary vmlinux bImage
#git submodule init
#git submodule update cedarx-libs
scripts/mk_hwpack.sh /home/wendal/kernel/output/pcduino_a10_hwpack_20131215.tar.xz
Debian/Ubuntu hwpack
Done.

编译好的压缩包在output目录中,有日期标记,例如pcduino_a10_hwpack_20131215.tar.xz

自定义内核

跟大多数A10的板子一样,你可以修改2个配置文件(ps: android的话还有个分区文件)

第一个是内核配置文件,也就是编译内核时常见的.config文件

#编译成功后可以找到,但编译之前是没有的,可见这不是真正的配置文件find -name .config>> ./build/sun4i_defconfig-linux/.config#真正的配置文件在find -name sun4i_defconfig>> ./patch/linux-sunxi/arch/arm/configs/sun4i_defconfig

所以,需要先在build/sun4i_defconfig-linux/进行配置,然后覆盖回去

cd build/sun4i_defconfig-linux/make menuconfig# ... ... 配置你需要的选项#..........#然后把配置直接覆盖回去,不然下一次build的时候依然是老的cp .config ../../patch/linux-sunxi/arch/arm/configs/sun4i_defconfig

另外一个是uboot的配置,这个文件有很多很多好东西,看文档吧Fex指南

./sunxi-boards/sys_config/a10/pcduino.fex

看完上述内容,你们对怎样为pcduino编译内核有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注亿速云行业资讯频道,感谢大家的支持。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI