ARM技术william hill官网
直播中

jf_84491108

2年用户 1520经验值
擅长:嵌入式技术
私信 关注

【触觉智能 Purple Pi开发板试用】 GitHub Actions 在线编译 OpenWrt 失败 by jf_84491108

以下编译的固件不可用,除内存外Purple Pi R1与WT2015还有其它差异,刷入此固件会变砖(疑似uboot损坏)。仅用于引以为鉴和学习在线编译openwrt。

Purple Pi R1双网口、64M DDR2内存、128M NAND Flash,官网显示低至49元,已开源OpenWrt 18.06,可作为软路由使用,性价比很高。

https://github.com/wireless-tag-com/openwrt-ssd20x提供了本地编译Purple Pi R1 OpenWrt的教程。

但本地编译需要一台安装了Linux或在虚拟机中安装了Linux的主机,在更新Linux和安装依赖库时往往因网络原因导致依赖库安装不完整,需要更换安装源等,但即使换源安装完依赖库,在编译过程中可能还会遇到各种由换源安装导致的稀奇古怪的bug,费时费力。而利用GitHub Actions 在线编译则往往是一个比较好的替代选择。

openwrt-ssd20x官方库中未添加Purple Pi R1基础款配置文件(WT2015默认支持64M DDR2内存、256M NAND Flash),需在fork库(如LV36/openwrt-ssd20x)后修改LV36/openwrt-ssd20x/18.06/wtconfig/WT2015文件L11 CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256 为 CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=128

在线编译步骤如下:

1.png

(1)https://github.com/页面点击绿色New按钮打开新建项目页面

2.png

(2)输入项目名称 Repository name,如PurPle-Pi-R1-OpenWrt-GithubActions,点击绿色Creat repository按钮新建项目

3.png

(3)点击creat a new file链接打开新建文件页面

4.png

(4)文件名框中输入.github/workflows/Purple-Pi-R1-OpenWrt.yml,文本框中输入如下代码:

name: Purple-Pi-R1-OpenWrt 云编译

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
        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 /opt
        sudo git clone https://github.com/LV36/openwrt-ssd20x.git
        sudo 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
        sudo 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
    - name: Build Firmware
      run: |
        cd /opt/openwrt-ssd20x/18.06
        ./scripts/feeds update -a
        ./scripts/feeds install -a -f
        make WT2015_wt
        make V=s -j4
        cd /opt
        sudo tar -czvf Purple-Pi-R1-OpenWrt.tar.gz /opt/openwrt-ssd20x/18.06/bin/targets/sstar/ssd20x/WT2015/*
    - name : Upload packages
      uses: actions/upload-artifact@main
      if: always()
      with:
        name: Purple-Pi-R1-OpenWrt 
        path: /opt/openwrt-ssd20x/18.06/bin/targets/sstar/ssd20x/WT2015

5.png

(5)点击绿色Commit new file按钮提交修改

6.png

(6)点击Actions打开Actions页面

7.png

(7)单击选中Purple-Pi-R1-OpenWrt 云编译

8.png

(8)点击Run workflow展开下拉列表

8.png

(9)点击绿色Run workflow按钮开始进行在线编译

10.png

(10)大约30分钟后,在线编译完成,点击绿色对号Purple-Pi-R1-OpenWrt 云编译进入详情页

11.png

(11)点击Purple-Pi-R1-OpenWrt下载在线编译获得的OpenWrt固件

编译结果:*附件:Purple-Pi-R1-OpenWrt.zip

更多回帖

发帖
×
20
完善资料,
赚取积分