https://github.com/industio/PurPle-Pi-R1提供了本地编译Purple Pi R1 Buildroot的教程。
但本地编译需要一台安装了Linux或在虚拟机中安装了Linux的主机,在更新Linux和安装依赖库时往往因网络原因导致依赖库安装不完整,需要更换安装源等,但即使换源安装完依赖库,在编译过程中可能还会遇到各种由换源安装导致的稀奇古怪的bug,费时费力。而利用GitHub Actions 在线编译则往往是一个比较好的替代选择。
在线编译步骤如下:
(1)https://github.com/页面点击绿色New按钮打开新建项目页面
(2)输入项目名称 Repository name,如PurPle-Pi-R1-Buildroot-GithubActions,点击绿色Creat repository按钮新建项目
(3)点击creat a new file链接打开新建文件页面
(4)文件名框中输入.github/workflows/PurPle-Pi-R1-Buildroot.yml,文本框中输入如下代码:
name: PurPle-Pi-R1-Buildroot 云编译
on:
repository_dispatch:
workflow_dispatch:
release:
types: [published]
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Checkout
uses: actions/checkout@main
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabi gcc-arm*
- name: Clone source code
run: |
cd ~
git clone https://github.com/industio/PurPle-Pi-R1.git
- name: Build Firmware
run: |
cd ~/PurPle-Pi-R1
./Release_to_customer.sh -f nand -p ssd201 -m 128 -q fastboot
cd /opt
sudo tar -czvf PurPle-Pi-R1-Buildroot-images.tar.gz ~/PurPle-Pi-R1/project/image/output/images/*
- name : Upload packages
uses: actions/upload-artifact@main
if: always()
with:
name: PurPle-Pi-R1-Buildroot-images
path: ~/PurPle-Pi-R1/project/image/output/images
(5)点击绿色Commit new file按钮提交修改
(6)点击Actions打开Actions页面
(7)单击选中PurPle-Pi-R1-Buildroot 云编译
(8)点击Run workflow展开下拉列表
(9)点击绿色Run workflow按钮开始进行在线编译
(10)大约6分钟后,在线编译完成,点击绿色对号PurPle-Pi-R1-Buildroot 云编译进入详情页
(11)点击PurPle-Pi-R1-Buildroot-images下载在线编译获得的Buildroot文件
编译结果:链接: https://pan.baidu.com/s/15ieqxDwHySh84bPGkgL7yw?pwd=q3b6 提取码: q3b6
更多回帖