Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
undoubted committed Feb 19, 2024
1 parent 41b26de commit c65eb2f
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 21 deletions.
49 changes: 28 additions & 21 deletions .github/workflows/k2p_nano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,51 @@ jobs:
permissions:
contents: write
env:
TNAMES: K2P_nano
IMAGE_DIR: /opt/images
runs-on: ubuntu-20.04
if: ${{ contains(github.ref, '-k3') }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout rt-n56u
run: |
git clone --depth=1 https://github.com/undoubted/Padavan-KVR.git rt-n56u
cd ./rt-n56u
sed -i 's/CONFIG_FIRMWARE_INCLUDE_CURL=y/CONFIG_FIRMWARE_INCLUDE_CURL=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NAPT66=y/CONFIG_FIRMWARE_INCLUDE_NAPT66=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_VLMCSD=y/CONFIG_FIRMWARE_INCLUDE_VLMCSD=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_TTYD=y/CONFIG_FIRMWARE_INCLUDE_TTYD=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_HTOP=y/CONFIG_FIRMWARE_INCLUDE_HTOP=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NANO=y/CONFIG_FIRMWARE_INCLUDE_NANO=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_IPERF3=y/CONFIG_FIRMWARE_INCLUDE_IPERF3=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MTR=y/CONFIG_FIRMWARE_INCLUDE_MTR=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SOCAT=y/CONFIG_FIRMWARE_INCLUDE_SOCAT=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SRELAY=y/CONFIG_FIRMWARE_INCLUDE_SRELAY=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=y/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=n/' trunk/configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=n/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=y/' trunk/build_firmware_modify
- name: Prepare environment
run: |
mkdir -p ${IMAGE_DIR}
sudo apt update
sudo apt install libtool-bin gperf python-docutils autopoint gettext
- name: Checkout rt-n56u
run: |
git clone --depth=1 https://github.com/undoubted/Padavan-KVR.git rt-n56u
- name: Prepare toolchain
run: |
cd ./rt-n56u/toolchain-mipsel
sh dl_toolchain.sh
- name: Build images
run: |
cd ./rt-n56u/trunk
for TNAME in $(echo $TNAMES | tr "," "\n"); do
fakeroot ./build_firmware_modify $TNAME
cp -f images/*.trx ${IMAGE_DIR}/
./clear_tree
sed -i 's/CONFIG_FIRMWARE_INCLUDE_CURL=y/CONFIG_FIRMWARE_INCLUDE_CURL=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NAPT66=y/CONFIG_FIRMWARE_INCLUDE_NAPT66=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_VLMCSD=y/CONFIG_FIRMWARE_INCLUDE_VLMCSD=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_TTYD=y/CONFIG_FIRMWARE_INCLUDE_TTYD=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_HTOP=y/CONFIG_FIRMWARE_INCLUDE_HTOP=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NANO=y/CONFIG_FIRMWARE_INCLUDE_NANO=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_IPERF3=y/CONFIG_FIRMWARE_INCLUDE_IPERF3=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MTR=y/CONFIG_FIRMWARE_INCLUDE_MTR=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SOCAT=y/CONFIG_FIRMWARE_INCLUDE_SOCAT=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SRELAY=y/CONFIG_FIRMWARE_INCLUDE_SRELAY=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=y/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=n/' configs/templates/K2P_nano.config
for i in {0..1}; do
if [ "$i" -eq "1" ]; then
sed -i 's/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=n/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=y/' build_firmware_modify
fi
fakeroot ./build_firmware_modify K2P_nano
for f in images/*.trx; do
if [ "$i" -eq "1" ]; then
cp -v -- "$f" "$IMAGE_DIR/$(basename $f .trx)_zerotier.trx"
else
cp -v -- "$f" "$IMAGE_DIR/$(basename $f .trx).trx"
fi
done
rm -rf images/*
done
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/k2p_nano_4.4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: K2P_nano_4.4

on:
release:
types: [published]

jobs:
build:
permissions:
contents: write
env:
IMAGE_DIR: /opt/images
runs-on: ubuntu-20.04
if: ${{ contains(github.ref, '-k4') }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare environment
run: |
mkdir -p ${IMAGE_DIR}
sudo apt update
sudo apt install libtool-bin gperf python-docutils autopoint gettext
- name: Checkout rt-n56u
run: |
git clone --depth=1 https://github.com/undoubted/padavan-4.4.git rt-n56u
- name: Prepare toolchain
run: |
cd ./rt-n56u/toolchain-mipsel
sh dl_toolchain.sh
- name: Build images
run: |
cd ./rt-n56u/trunk
sed -i 's/CONFIG_FIRMWARE_INCLUDE_CURL=y/CONFIG_FIRMWARE_INCLUDE_CURL=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NAPT66=y/CONFIG_FIRMWARE_INCLUDE_NAPT66=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_VLMCSD=y/CONFIG_FIRMWARE_INCLUDE_VLMCSD=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_TTYD=y/CONFIG_FIRMWARE_INCLUDE_TTYD=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_HTOP=y/CONFIG_FIRMWARE_INCLUDE_HTOP=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NANO=y/CONFIG_FIRMWARE_INCLUDE_NANO=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_IPERF3=y/CONFIG_FIRMWARE_INCLUDE_IPERF3=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MTR=y/CONFIG_FIRMWARE_INCLUDE_MTR=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SOCAT=y/CONFIG_FIRMWARE_INCLUDE_SOCAT=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SRELAY=y/CONFIG_FIRMWARE_INCLUDE_SRELAY=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=y/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=n/' configs/templates/K2P_nano.config
for i in {0..1}; do
if [ "$i" -eq "1" ]; then
sed -i 's/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=n/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=y/' build_firmware_modify
fi
fakeroot ./build_firmware_modify K2P_nano
for f in images/*.trx; do
if [ "$i" -eq "1" ]; then
cp -v -- "$f" "$IMAGE_DIR/$(basename $f .trx)_zerotier.trx"
else
cp -v -- "$f" "$IMAGE_DIR/$(basename $f .trx).trx"
fi
done
rm -rf images/*
done
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{ env.IMAGE_DIR }}/*.trx

0 comments on commit c65eb2f

Please sign in to comment.