8,460
个编辑
更改
→编译系统需求
== 编译系统需求 ==
Linux SDK,即'''orangepi-build''',只支持在安装有'''<span style="color:#FF0000">Ubuntu 22.04</span>'''的X64电脑上运行,所以下载orangepi-build前,请首先确保自己电脑已安装的Ubuntu版本是Ubuntu 22.04。查看电脑已安装的Ubuntu版本的命令如下所示,如果Release字段显示的不是'''<span style="color:#FF0000">22.04</span>''',说明当前使用的Ubuntu版本不符合要求,请更换系统后再进行下面的操作。
{| class="wikitable" style="width:800px;"
|-
|
test@test:~$ '''lsb_release -a'''
Description: Ubuntu 22.04 LTS
Release: '''<span style="color:#FF0000">22.04</span>'''
Codename: '''jammy'''
|}
如果电脑安装的是Windows系统,没有安装有Ubuntu 22.04的电脑,可以考虑使用'''VirtualBox'''或者'''VMware'''来在Windows系统中安装一个Ubuntu 22.04虚拟机。但是请注意,不要在WSL虚拟机上编译orangepi-build,因为orangepi-build没有在WSL虚拟机中测试过,所以无法确保能正常在WSL中使用orangepi-build,另外请不要在'''开发板'''的Linux系统中使用orangepi-build。Ubuntu 22.04 '''<span style="color:#FF0000">amd64</span>'''版本的安装镜像下载地址为:
{| class="wikitable" style="width:800px;"
|-
|
[https://repo.huaweicloud.com/ubuntu-releases/21.04/ubuntu-21.04-desktop-amd64.iso '''https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04/ubuntu-22.04-desktop-amd64.iso''']
|}
在电脑中或者虚拟机中安装完Ubuntu 22.04后,请先设置Ubuntu 22.04的软件源为清华源(或者其它你觉得速度快的国内源),不然后面安装软件的时候很容易由于网络原因而出错。替换清华源的步骤如下所示:
<ol style="list-style-type: lower-alpha;">
<li>替换清华源的方法参考这个网页的说明即可。</li></ol>{| class="wikitable" style="width:800px;" |-|
[https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ '''https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/''']
|}</ol>
<ol start="2" style="list-style-type: lower-alpha;">
<li><p>注意Ubuntu版本需要切换到22.04。</p>
<p>[[File:media/image276.png]]</p></li>
<li><p>需要替换的'''/etc/apt/sources.list'''文件的内容为:</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''sudo mv /etc/apt/sources.list cat /etc/apt/sources.list.bak'''</p>
<p>test@test:~$ '''sudo vim /etc/apt/sources.list'''</p>
<p>deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse</p>
<p># 预发布软件源,不建议启用</p>
<p># deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p>
<p># deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse</p>|}</li>
<li><p>替换完后需要更新下包信息,并确保没有报错。</p>
{| class="wikitable" style="width:800px;" |-| <p>test@test:~$ '''sudo apt-get update'''</p>|}</li><li><p>'''<span style="color:#FF0000">另外,由于内核和U-boot等源码都是存放在GitHub上的,所以编译镜像的时候请确保电脑能正常从GitHub下载代码,这点是非常重要的。</span>'''</p></li></ol>
<span id="获取linux-sdk的源码"></span>
== 获取linux sdk的源码 ==