打开主菜单

Wiki-Orange Pi β

更改

Orange Pi CM4

添加439字节, 2023年9月13日 (三) 15:41
使用x64的Ubuntu22.04电脑编译
<ol style="list-style-type: decimal;">
<li><p>Linux SDK,即'''orangepi-build''',支持在安装有'''<span style="color:#FF0000">Ubuntu 22.04</span>'''的电脑上运行,所以下载orangepi-build前,请首先确保自己电脑已安装的Ubuntu版本是Ubuntu 22.04。查看电脑已安装的Ubuntu版本的命令如下所示,如果Release字段显示的不是'''<span style="color:#FF0000">22.04</span>''',说明当前使用的Ubuntu版本不符合要求,请更换系统后再进行下面的操作。</p>{| class="wikitable" style="width:800px;" |-|
<p>test@test:~$ '''lsb_release -a'''</p>
<p>No LSB modules are available.</p>
<p>Distributor ID: Ubuntu</p>
<p>Description: Ubuntu 22.04 LTS</p>
<p>Release: '''<span style="color:#FF0000">22.04</span>'''</p><p>Codename: jammy</p>|}</li>
<li><p>如果电脑安装的是Windows系统,没有安装有Ubuntu 22.04的电脑,可以考虑使用'''VirtualBox'''或者'''VMware'''来在Windows系统中安装一个Ubuntu 22.04虚拟机。但是请注意,不要在WSL虚拟机上编译orangepi-build,因为orangepi-build没有在WSL虚拟机中测试过,所以无法确保能正常在WSL中使用orangepi-build。</p></li>
<li><p>Ubuntu 22.04 '''<span style="color:#FF0000">amd64</span>'''版本的安装镜像下载地址为:</p>{| class="wikitable" style="width:800px;" |-|
<p>[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''']</p>
<p>或者</p>
<p>'''https://repo.huaweicloud.com/ubuntu-releases/22.04/ubuntu-22.04.1-desktop-amd64.iso'''</p>|}</li>
<li><p>在电脑中或者虚拟机中安装完Ubuntu 22.04后,请先设置Ubuntu 22.04的软件源为清华源,不然后面安装软件的时候很容易由于网络原因而出错</p>
<ol style="list-style-type: lower-alpha;">
<li>替换清华源的方法参考这个网页的说明即可</li></ol></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/image390.png|576x241px]]</p></li>
<li><p>需要替换的'''/etc/apt/sources.list'''文件的内容为</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''sudo mv /etc/apt/sources.list /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 update'''</p>|}</li><li><p>'''<span style="color:#FF0000">另外,由于内核和U-boot等源码都是存放在GitHub上的,所以编译镜像的时候请确保电脑能正常从GitHub下载代码,这点是非常重要的。</span>'''</p></li></ol></li></ol>
<span id="获取linux-sdk的源码"></span>
8,460
个编辑