https://github.com/wireless-tag-com/uboot-ssd20x提供了本地编译Purple Pi R1 uboot的教程。
但本地编译需要一台安装了Linux或在虚拟机中安装了Linux的主机,在更新Linux和安装依赖库时往往因网络原因导致依赖库安装不完整,需要更换安装源等,但即使换源安装完依赖库,在编译过程中可能还会遇到各种由换源安装导致的稀奇古怪的bug,费时费力。而利用GitHub Actions 在线编译则往往是一个比较好的替代选择。
在线编译步骤如下:
(1)https://github.com/页面点击绿色New按钮打开新建项目页面
(2)输入项目名称 Repository name,如uboot-ssd20x-GithubActions,点击绿色Creat repository按钮新建项目
(3)点击creat a new file链接打开新建文件页面
(4)文件名框中输入.github/workflows/uboot-ssd20x.yml,文本框中输入如下代码:
name: uboot-ssd20x 云编译
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 full-upgrade -y && sudo apt-get upgrade -y && sudo apt-get autoremove -y
sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc libxml-parser-perl gengetopt default-jre-headless ocaml-nox sharutils texinfo git gcc g++ make
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \
libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip libpython3-dev qemu-utils \
rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
sudo apt install build-essential ccache ecj fastjar file g++ gawk \
gettext git java-propose-classpath libelf-dev libncurses5-dev \
libncursesw5-dev libssl-dev python python2.7-dev python3 unzip wget \
python-distutils-extra python3-setuptools python3-dev rsync subversion \
swig time xsltproc zlib1g-dev
sudo apt-get install lib32ncurses5-dev lib32z1-dev
sudo apt-get install gcc-arm*
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install zlib1g:i386 libstdc++6:i386 libc6:i386 libc6-dev-i386
- name: Clone source code
run: |
cd ~
git clone https://github.com/wireless-tag-com/uboot-ssd20x.git
cd /opt
wget https://github.com/LV36/openwrt-ssd20x-toolchian/releases/download/2018.08/wt-gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf.tag.gz
tar -xvf wt-gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf.tag.gz
sudo chmod 777 ~/.profile
echo -e '\nexport PATH=/opt/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf/bin:$PATH\n' >> ~/.profile
source ~/.profile
arm-linux-gnueabihf-gcc --version
- name: Build Firmware
run: |
cd ~/uboot-ssd20x
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- qmsd_spinand_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
ls ~/uboot-ssd20x
find ~ -name u-boot_spinand.xz.img.bin -print
- name : Upload packages
uses: actions/upload-artifact@main
if: always()
with:
name: uboot-ssd20x
path: ~/uboot-ssd20x/u-boot_spinand.xz.img.bin
(5)点击绿色Commit new file按钮提交修改
(6)点击Actions打开Actions页面
(7)单击选中uboot-ssd20x 云编译
(8)点击Run workflow展开下拉列表
(9)点击绿色Run workflow按钮开始进行在线编译
(10)大约6分钟后,在线编译完成,点击绿色对号uboot-ssd20x 云编译进入详情页
(11)点击uboot-ssd20x下载在线编译获得的uboot文件
编译结果:*附件:uboot-ssd20x.zip
更多回帖