OrangePi Zero编译环境搭建

PS:别看orange pi zero这块板子便宜,但实际上相关的资料非常少,社区和论坛的讨论也少之又少,所以不推荐完全没有linux基础的新手使用这块板子上手。恰好我手中有一块树莓派3B,下面搭建编译环境光前面6步我就遇到了重重阻力,等利用树莓派上手熟悉之后再更新吧。

环境准备

编译环境 Ubuntu 16.04 64位

搭建步骤

  1. git下载git@github.com:orangepi-xunlong/OrangePi_Build.git。
  2. sudo apt-get install unzip curl,安装所需要的curl和unzip程序。
  3. 进入OrangePi_Build,运行Build_OrangePi.sh脚本,按照指示下载源码。
  4. 进入OrangePiH2/scripts目录,修改make_kernel函数的下列两处:
make -j ARCH=arm CROSS_COMPILE=${cross_comp}- uImage
修改为
make -j 4 ARCH=arm CROSS_COMPILE=${cross_comp}- uImage

make -j ARCH=arm CROSS_COMPILE=${cross_comp}- modules
修改为
make -j 4 ARCH=arm CROSS_COMPILE=${cross_comp}- modules

添加一个4限制编译最大任务数,可根据CPU核数修改,否则会在编译kernel的时候内存占用率直接占满导致电脑卡死,官方到目前还没有勘误。uboot的编译脚本没有这个问题。

  1. 同样该目录下,修改Prepare_toolchain.sh,将lib32stdc++修改为lib32stdc++6,否则在我的机器上会出现下列错误:
The following packages have unmet dependencies:
lib32stdc++6-4.8-dbg : Conflicts: lib32stdc++6-4.7-dbg but 4.7.4-3ubuntu12 is to be installed
lib32stdc++6-4.9-dbg : Conflicts: lib32stdc++6-4.7-dbg but 4.7.4-3ubuntu12 is to be installed
Conflicts: lib32stdc++6-4.8-dbg but 4.8.5-4ubuntu4 is to be installed
lib32stdc++6-5-dbg : Conflicts: lib32stdc++6-4.7-dbg but 4.7.4-3ubuntu12 is to be installed
Conflicts: lib32stdc++6-4.8-dbg but 4.8.5-4ubuntu4 is to be installed
Conflicts: lib32stdc++6-4.9-dbg but 4.9.4-2ubuntu1 is to be installed
lib32stdc++6-5-dbg-s390x-cross : Conflicts: lib32stdc++6-4.9-dbg-s390x-cross but 4.9.3-13ubuntu2cross1 is to be installed
lib32stdc++6-6-dbg : Conflicts: lib32stdc++6-4.7-dbg but 4.7.4-3ubuntu12 is to be installed
Conflicts: lib32stdc++6-4.8-dbg but 4.8.5-4ubuntu4 is to be installed
Conflicts: lib32stdc++6-4.9-dbg but 4.9.4-2ubuntu1 is to be installed
Conflicts: lib32stdc++6-5-dbg but 5.4.1-8ubuntu1 is to be installed
lib32stdc++6-6-dbg-mips64-cross : Conflicts: lib32stdc++6-5-dbg-mips64-cross but 5.4.1-2ubuntu2cross1 is to be installed
lib32stdc++6-6-dbg-mips64el-cross : Conflicts: lib32stdc++6-5-dbg-mips64el-cross but 5.4.1-2ubuntu2cross1 is to be installed
lib32stdc++6-6-dbg-ppc64-cross : Conflicts: lib32stdc++6-5-dbg-ppc64-cross but 5.4.1-2ubuntu2cross1 is to be installed
lib32stdc++6-6-dbg-s390x-cross : Conflicts: lib32stdc++6-4.9-dbg-s390x-cross but 4.9.3-13ubuntu2cross1 is to be installed
Conflicts: lib32stdc++6-5-dbg-s390x-cross but 5.4.1-8ubuntu1cross1 is to be installed
lib32stdc++6-6-dbg-sparc64-cross : Conflicts: lib32stdc++6-5-dbg-sparc64-cross but 5.4.1-2ubuntu2cross1 is to be installed
E: Unable to correct problems, you have held broken packages.

是否官方错误不确定,经验所得。这些坑挺容易浪费新手大量时间。

  1. 准备工作完毕,OrangePiH2下执行./build.sh即可编译相关模块。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值