Added support for 69057 #138
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: updaterootfs | |
on: | |
push: | |
# branches: | |
# - main | |
tags: | |
- v* | |
workflow_dispatch: | |
inputs: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Bring over config files from redpill-load | |
run: | | |
mkdir /opt/config-files | |
cd /opt/config-files | |
git clone -b develop https://github.com/pocopico/redpill-load.git | |
ls -ltr /opt/config-files/redpill-load/config | |
- name: Clone source code | |
id: updaterootfs | |
run: | | |
mkdir /opt/updaterootfs | |
cd /opt/updaterootfs | |
#URLS=`curl -s https://api.github.com/repos/pocopico/tcrpfriend/releases/tags/v0.0.0| jq -r ".assets[] | select(.name | contains(\"${initrd-friend}\")) | .browser_download_url"` | |
#URLS="https://github.com/pocopico/tcrpfriend/releases/download/v0.0.0/initrd-friend https://github.com/pocopico/tcrpfriend/releases/download/v0.0.0/bzImage-friend" | |
URLS="`curl -s https://api.github.com/repos/pocopico/tcrpfriend/releases/tags/v0.0.0 | jq -r -e .assets[].browser_download_url`" | |
for file in $URLS; do curl --insecure --silent --location "$file" -O ; done | |
ls -ltr | |
mkdir /opt/updaterootfs/temprd && cd /opt/updaterootfs/temprd | |
xz -dc ../initrd-friend | sudo cpio -idm 2>&1 > /dev/null | |
echo "BEFORE UPDATE ..." | |
ls -ltr | |
rm -f ../initrd-friend | |
ls -ltr /home/runner/work/tcrpfriend/tcrpfriend/buildroot/board/tcrpfriend/rootfs-overlay/root | |
sudo cp -rf /home/runner/work/tcrpfriend/tcrpfriend/buildroot/board/tcrpfriend/rootfs-overlay/root/* /opt/updaterootfs/temprd/root/ | |
sudo cp -rf /home/runner/work/tcrpfriend/tcrpfriend/buildroot/board/tcrpfriend/rootfs-overlay/root/.bashrc /opt/updaterootfs/temprd/root/ | |
sudo cp -rf /opt/config-files/redpill-load/config /opt/updaterootfs/temprd/root/ | |
sudo cp -rf /home/runner/work/tcrpfriend/tcrpfriend/buildroot/board/tcrpfriend/rootfs-overlay/etc/* /opt/updaterootfs/temprd/etc/ | |
sudo cp -rf /home/runner/work/tcrpfriend/tcrpfriend/buildroot/board/tcrpfriend/rootfs-overlay/usr/* /opt/updaterootfs/temprd/usr/ | |
sudo chmod +x /opt/updaterootfs/temprd/usr/bin/jq | |
for script in $(sudo find /opt/updaterootfs/temprd/root/ -name "*.sh" ); do echo "Setting +x on $script" ; sudo chmod +x $script; done | |
for patch in $(sudo find /opt/updaterootfs/temprd/root/tools ); do echo "Setting +x on $patch" ; sudo chmod +x $patch; done | |
echo "Fix DHCPCD client id" | |
sudo sed -i 's|#clientid|clientid|' "/opt/updaterootfs/temprd/etc/dhcpcd.conf" | |
sudo sed -i 's|duid|#duid|' "/opt/updaterootfs/temprd/etc/dhcpcd.conf" | |
echo "AFTER UPDATE ..." | |
sudo ls -ltr /opt/updaterootfs/temprd/root | |
sudo ls -ltr /opt/updaterootfs/temprd/etc | |
sudo ls -ltr /opt/updaterootfs/temprd/usr | |
sudo df -h / | |
VERSION="`cat /home/runner/work/tcrpfriend/tcrpfriend/buildroot/board/tcrpfriend/rootfs-overlay/root/VERSION`" | |
echo "Version: ${VERSION}" | |
echo "::set-output name=VERSION::${VERSION}" | |
- name: Recreate Ramdisk | |
run: | | |
mkdir /opt/output | |
echo "Recreating ramdisk " && cd /opt/updaterootfs/temprd && sudo find . 2>/dev/null | sudo cpio -o -H newc -R root:root | xz -9 --format=lzma >/opt/output/initrd-friend | |
cp /opt/updaterootfs/bzImage-friend /opt/output | |
ls -ltr /opt/output | |
touch /opt/output/chksum | |
echo "VERSION=`cat /home/runner/work/tcrpfriend/tcrpfriend/buildroot/board/tcrpfriend/rootfs-overlay/root/VERSION`" >> /opt/output/chksum | |
sha256sum /opt/output/bzImage-friend >> /opt/output/chksum | |
sha256sum /opt/output/initrd-friend >> /opt/output/chksum | |
- name: Upload FriendFiles-${{ steps.updaterootfs.outputs.VERSION }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FriendFiles-${{ steps.updaterootfs.outputs.VERSION }} | |
path: /opt/output | |
# Publish a release if is a tag | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
/opt/output/bzImage-friend | |
/opt/output/initrd-friend | |
/opt/output/chksum | |