16 Commits

Author SHA1 Message Date
remittor
71cc899a8a test 14 2025-01-13 21:50:57 +03:00
remittor
1319a71eb8 test 13 2025-01-13 19:54:09 +03:00
remittor
780d267c51 test 12 2025-01-13 17:08:26 +03:00
remittor
3312aa1a1a test 11 2025-01-13 17:06:08 +03:00
remittor
d277ae7c4d test 11 2025-01-13 16:54:12 +03:00
remittor
466536466f test 10 2025-01-13 16:38:36 +03:00
remittor
f95c5e6368 test 9 2025-01-13 16:05:43 +03:00
remittor
038c27a05a test 8 2025-01-13 15:52:59 +03:00
remittor
2e3db4faa2 test 7 2025-01-13 15:38:46 +03:00
remittor
f23162d73e test 6 2025-01-13 15:21:12 +03:00
remittor
0073630566 test 5 2025-01-13 15:13:29 +03:00
remittor
ae23d4b8e3 test 4 2025-01-13 13:20:23 +03:00
remittor
d4a1ec7f70 test 3 2025-01-13 12:55:14 +03:00
remittor
32acb91ac6 test 2 2025-01-13 12:51:56 +03:00
remittor
8cc2e45f53 test 1 2025-01-13 12:40:52 +03:00
remittor
63511e08c1 Add action builder 2025-01-13 12:13:00 +03:00
6 changed files with 58 additions and 132 deletions

31
.github/FUNDING.yml vendored
View File

@@ -1,31 +0,0 @@
# These are supported funding model platforms
# Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github:
# Replace with a single Patreon username
patreon:
# Replace with a single Open Collective username
open_collective:
# Replace with a single Ko-fi username
ko_fi:
# Replace with a single Tidelift platform-name/package-name e.g., npm/babel
tidelift:
# Replace with a single Community Bridge project-name e.g., cloud-foundry
community_bridge:
# Replace with a single Liberapay username
liberapay:
# Replace with a single IssueHunt username
issuehunt:
# Replace with a single Otechie username
otechie:
# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ['https://github.com/remittor/donate']

View File

@@ -2,25 +2,12 @@ name: build
on: on:
workflow_dispatch: workflow_dispatch:
inputs: # push:
fake_build: # tags:
description: 'Fake build' # - v[0-9]+*
required: true
default: 'false'
type: choice
options:
- true
- false
suffix:
description: 'TAG suffix'
required: false
default: ''
type: string
env: env:
FAKE_BUILD: ${{ github.event.inputs.fake_build }} REPO_URL: https://github.com/openwrt-xiaomi/openwrt.git
REPO_URL: https://github.com/openwrt-xiaomi/openwrt
REPO_LNK: openwrt-xiaomi/openwrt
REPO_BRANCH: xq-24.10 REPO_BRANCH: xq-24.10
TAG_PREFIX: v24- TAG_PREFIX: v24-
BUILD_ROOT: ${{ github.workspace }}/openwrt BUILD_ROOT: ${{ github.workspace }}/openwrt
@@ -28,9 +15,6 @@ env:
TZ: UTC TZ: UTC
DEVICE_NAME: unknown DEVICE_NAME: unknown
BUILD_DATE: unknown BUILD_DATE: unknown
REPO_DATE: unknown
FW_DATE: unknown
FW_VER: unknown
jobs: jobs:
check: check:
@@ -41,56 +25,43 @@ jobs:
sha: ${{ steps.gh.outputs.sha }} sha: ${{ steps.gh.outputs.sha }}
url: ${{ steps.gh.outputs.url }} url: ${{ steps.gh.outputs.url }}
message: ${{ steps.gh.outputs.message }} message: ${{ steps.gh.outputs.message }}
build_date: ${{ steps.gh.outputs.build_date }}
fw_date: ${{ steps.gh.outputs.fw_date }}
fw_ver: ${{ steps.gh.outputs.fw_ver }}
is_active: ${{ steps.activity.outputs.is_active }} is_active: ${{ steps.activity.outputs.is_active }}
steps: steps:
- name: Get repo data via GH API - name: Get repo data via GH API
id: gh id: gh
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: 'openwrt-xiaomi/openwrt'
run: | run: |
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
echo "Tag name from github.ref_name: ${{ github.ref_name }}" echo "Tag name from github.ref_name: ${{ github.ref_name }}"
BRANCH=$REPO_BRANCH BRANCH=$(gh api repos/$REPO --jq '.default_branch')
REPO_DATE=$(gh api repos/$REPO_LNK/commits/$BRANCH --jq '.commit.committer.date') DATE=$(gh api repos/$REPO/commits/$BRANCH --jq '.commit.committer.date')
BUILD_DATE=$( date --utc +'%y%m%d' ) BUILD_DATE=$( date --utc +'%y%m%d' )
FW_DATE=$( date --utc +'%Y-%m-%d' )
TAG=$TAG_PREFIX$BUILD_DATE TAG=$TAG_PREFIX$BUILD_DATE
echo "REPO_DATE=$REPO_DATE" >> $GITHUB_ENV
echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV
echo "FW_DATE=$FW_DATE" >> $GITHUB_ENV
echo "TAG=$TAG" >> $GITHUB_ENV
wget $REPO_URL/raw/refs/heads/$BRANCH/include/version.mk
FW_VERSION=$( grep -s '^VERSION_NUMBER:=$(if' version.mk 2>/dev/null )
[ -z "$FW_VERSION" ] && { echo "ERROR: Cannot find VERSION_NUMBER"; exit 90; }
FW_VER=$( echo $FW_VERSION | cut -d"," -f3 | cut -d")" -f1 )
echo 'FW_VER = "'$FW_VER'"'
echo "FW_VER=$FW_VER" >> $GITHUB_ENV
rm -f version.mk
{ {
echo "tag=$TAG" echo "tag=$TAG"
echo "date=$(date --utc -d $REPO_DATE +%Y%m%d)" echo "date=$(date --utc -d $DATE +%Y%m%d)"
echo "sha=$(gh api repos/$REPO_LNK/commits/$BRANCH --jq '.sha[0:7]')" echo "sha=$(gh api repos/$REPO/commits/$BRANCH --jq '.sha[0:7]')"
echo "url=$(gh api repos/$REPO_LNK/commits/$BRANCH --jq '.html_url')" echo "url=$(gh api repos/$REPO/commits/$BRANCH --jq '.html_url')"
echo "build_root=$BUILD_ROOT"
echo "message<<EOF" echo "message<<EOF"
gh api repos/$REPO_LNK/commits/$BRANCH --jq '.commit.message' gh api repos/$REPO/commits/$BRANCH --jq '.commit.message'
echo EOF echo EOF
echo "build_date=$BUILD_DATE"
echo "fw_date=$FW_DATE"
echo "fw_ver=$FW_VER"
} >> $GITHUB_OUTPUT } >> $GITHUB_OUTPUT
echo "DATE=$DATE" >> $GITHUB_ENV
echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Check for repo activity - name: Check for repo activity
id: activity id: activity
env: env:
REPO_DATE: ${{ env.REPO_DATE }} DATE: ${{ env.DATE }}
URL: ${{ steps.gh.outputs.url }} URL: ${{ steps.gh.outputs.url }}
run: | run: |
TIMESTAMP=$(date --utc -d $REPO_DATE +%s) TIMESTAMP=$(date --utc -d $DATE +%s)
DAYS=$(( ( $(date --utc +%s) - $TIMESTAMP ) / 86400 )) DAYS=$(( ( $(date --utc +%s) - $TIMESTAMP ) / 86400 ))
echo "Repository activity: $(date --utc -d $REPO_DATE)" echo "Repository activity: $(date --utc -d $DATE)"
echo "Commit: $URL" echo "Commit: $URL"
if [ "${{ github.event_name }}" != "schedule" ]; then if [ "${{ github.event_name }}" != "schedule" ]; then
is_active=true is_active=true
@@ -147,7 +118,7 @@ jobs:
uses: actions/checkout@main uses: actions/checkout@main
- name: Download OpenWrt sources - name: Download OpenWrt sources
run: git clone --branch $REPO_BRANCH $REPO_URL.git $BUILD_ROOT run: git clone --branch $REPO_BRANCH $REPO_URL $BUILD_ROOT
- name: Init builder - name: Init builder
env: env:
@@ -160,42 +131,35 @@ jobs:
wget https://github.com/fantastic-packages/packages/raw/refs/heads/24.10/keys/usign/53FF2B6672243D28.pub wget https://github.com/fantastic-packages/packages/raw/refs/heads/24.10/keys/usign/53FF2B6672243D28.pub
- name: Update OpenWrt packages - name: Update OpenWrt packages
id: update
run: | run: |
cd $BUILD_ROOT && ./xupdate.sh -f cd $BUILD_ROOT
echo "status=success" >> $GITHUB_OUTPUT ./xupdate.sh -f
- name: Build the firmware image - name: Build the firmware image
id: compile id: compile
if: steps.update.outputs.status == 'success'
env: env:
TARGET: ${{ matrix.target }} TARGET: ${{ matrix.target }}
FW_VER: ${{ needs.check.outputs.fw_ver }}
run: | run: |
cd $BUILD_ROOT cd $BUILD_ROOT
MAKE_JOBS=$(($(nproc)+1)) MAKE_JOBS=$(($(nproc)+1))
echo "$MAKE_JOBS thread compile" echo "$MAKE_JOBS thread compile"
./xmake.sh -I -t $TARGET ./xmake.sh -m -t $TARGET
[ "$FAKE_BUILD" != "true" ] && make -j $MAKE_JOBS download world make -j $MAKE_JOBS download world
FILE_DATE=$(date --utc +'%y%m%d') # || make V=sc
DEVICE_NAME=$( grep -so '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' ) DEVICE_NAME=$( grep -so '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' )
BOARD_NAME=$( grep -so '^CONFIG_TARGET_BOARD=.*' .config | cut -d'"' -f2 ) BOARD_NAME=$( grep -so '^CONFIG_TARGET_BOARD=.*' .config | cut -d'"' -f2 )
SUBTARGET_NAME=$( grep -so '^CONFIG_TARGET_SUBTARGET=.*' .config | cut -d'"' -f2 ) SUBTARGET_NAME=$( grep -so '^CONFIG_TARGET_SUBTARGET=.*' .config | cut -d'"' -f2 )
OUT_DIR=$BUILD_ROOT/bin/targets/$BOARD_NAME/$SUBTARGET_NAME OUT_DIR=$BUILD_ROOT/bin/targets/$BOARD_NAME/$SUBTARGET_NAME
if [ "$FAKE_BUILD" = "true" ]; then # BLD_VER=24.10.0-rc5
mkdir -p logs BLD_VER=$( cat $OUT_DIR/profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
mkdir -p $OUT_DIR FILE_DATE=$(date --utc +'%y%m%d')
echo "$BOARD_NAME $SUBTARGET_NAME $DEVICE_NAME" > "$OUT_DIR/$DEVICE_NAME.txt"
touch "$OUT_DIR/kernel-debug.tar.zst"
ls -la
BLD_VER=$FW_VER
else
BLD_VER=$( cat $OUT_DIR/profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
fi
echo "Firmware $BLD_VER [$FILE_DATE] builded!" echo "Firmware $BLD_VER [$FILE_DATE] builded!"
# mkdir -p logs
# mkdir -p $OUT_DIR
# echo "$BOARD_NAME $SUBTARGET_NAME $DEVICE_NAME" > "$OUT_DIR/$DEVICE_NAME.txt"
if [ ! -f $OUT_DIR/kernel-debug.tar.zst ]; then if [ ! -f $OUT_DIR/kernel-debug.tar.zst ]; then
echo "File kernel-debug.tar.zst not found!" echo "File kernel-debug.tar.zst not found!"
exit 100 exit 100
fi fi
echo "status=success" >> $GITHUB_OUTPUT echo "status=success" >> $GITHUB_OUTPUT
echo "DEVICE_NAME=$DEVICE_NAME" >> $GITHUB_ENV echo "DEVICE_NAME=$DEVICE_NAME" >> $GITHUB_ENV
@@ -203,7 +167,8 @@ jobs:
echo "SUBTARGET_NAME=$SUBTARGET_NAME" >> $GITHUB_ENV echo "SUBTARGET_NAME=$SUBTARGET_NAME" >> $GITHUB_ENV
echo "BLD_VER=$BLD_VER" >> $GITHUB_ENV echo "BLD_VER=$BLD_VER" >> $GITHUB_ENV
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
echo "FILE_DATE=$FILE_DATE" >> $GITHUB_ENV echo "FILE_DATE=$(date --utc +'%y%m%d')" >> $GITHUB_ENV
echo "FILE_TIME=$(date --utc +'%Y%m%d%H%M')" >> $GITHUB_ENV
- name: Check space usage - name: Check space usage
run: df -hT run: df -hT
@@ -212,10 +177,9 @@ jobs:
if: always() if: always()
env: env:
TARGET: ${{ matrix.target }} TARGET: ${{ matrix.target }}
FW_DATE: ${{ needs.check.outputs.fw_date }}
LOGS_DIR: ${{ env.BUILD_ROOT }}/logs LOGS_DIR: ${{ env.BUILD_ROOT }}/logs
run: | run: |
tar -cJvf logs-$TARGET-$FW_DATE.tar.xz $LOGS_DIR tar -cJvf logs-$TARGET.tar.xz $LOGS_DIR
- name: Cleanup OUT directory - name: Cleanup OUT directory
if: steps.compile.outputs.status == 'success' if: steps.compile.outputs.status == 'success'
@@ -232,11 +196,19 @@ jobs:
rm -f *ubi-cleaner* rm -f *ubi-cleaner*
rm -f *-ram-*.bin rm -f *-ram-*.bin
- name: Info
env:
OUT_DIR: ${{ env.OUT_DIR }}
run: |
echo "---------------------------"
ls -la $OUT_DIR
echo "---------------------------"
- name: Upload OUT directory - name: Upload OUT directory
uses: actions/upload-artifact@main uses: actions/upload-artifact@main
if: steps.compile.outputs.status == 'success' if: steps.compile.outputs.status == 'success'
with: with:
name: openwrt-${{ env.BLD_VER }}-${{ needs.check.outputs.build_date }}-${{ env.DEVICE_NAME }} name: openwrt-${{ env.BLD_VER }}-${{ env.FILE_DATE }}-${{ env.DEVICE_NAME }}
path: ${{ env.OUT_DIR }} path: ${{ env.OUT_DIR }}
if-no-files-found: error if-no-files-found: error
@@ -244,7 +216,7 @@ jobs:
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: logs-${{ matrix.target }}-${{ env.FW_DATE }} name: logs-${{ matrix.target }}
path: logs-*.tar.xz path: logs-*.tar.xz
release: release:
@@ -261,6 +233,9 @@ jobs:
pattern: openwrt-* pattern: openwrt-*
- name: Put images into zip - name: Put images into zip
env:
TAG: ${{ needs.check.outputs.tag }}
DATE: ${{ needs.check.outputs.date }}
run: | run: |
mkdir -p public mkdir -p public
find . -mindepth 1 -type d -name 'openwrt-*' -exec sh -c 'zip -0 ./public/$(basename {}).zip -j {} {}/*' \; find . -mindepth 1 -type d -name 'openwrt-*' -exec sh -c 'zip -0 ./public/$(basename {}).zip -j {} {}/*' \;
@@ -275,7 +250,4 @@ jobs:
prerelease: false prerelease: false
tag_name: ${{ needs.check.outputs.tag }} tag_name: ${{ needs.check.outputs.tag }}
name: '${{ needs.check.outputs.tag }}' name: '${{ needs.check.outputs.tag }}'
body: |
OpenWrt ${{ needs.check.outputs.fw_ver }} [${{ needs.check.outputs.fw_date }}]
author: [remittor](https://github.com/remittor)
files: ./public/*.zip files: ./public/*.zip

View File

@@ -1,8 +1,3 @@
[![Github All Releases](https://img.shields.io/github/downloads/openwrt-xiaomi/builder/total.svg)](https://github.com/openwrt-xiaomi/builder/releases)
[![ViewCount](https://views.whatilearened.today/views/github/openwrt-xiaomi/builder.svg)](https://github.com/openwrt-xiaomi/builder/releases)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fopenwrt-xiaomi%2Fbuilder&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://github.com/openwrt-xiaomi/builder/releases)
[![Donations Page](https://github.com/andry81-cache/gh-content-static-cache/raw/master/common/badges/donate/donate.svg)](https://github.com/remittor/donate)
# OpenWrt builder # OpenWrt builder
For OpenWrt >= 21.02 For OpenWrt >= 21.02
@@ -18,11 +13,11 @@ sudo apt-get install python3-distutils rsync unzip zlib1g-dev
## Build firmware ## Build firmware
``` ```
git clone https://github.com/openwrt-xiaomi/builder -b v24 openwrt-v24 git clone https://github.com/openwrt-xiaomi/builder -b v23 openwrt-v23
cd openwrt-v24 cd openwrt-v23
./xcreate.sh -v xq-24.10 ./xcreate.sh -v xq-23.05.0
cd xq-24.10 cd xq-23.05.0
./xupdate.sh -f ./xupdate.sh -f

View File

@@ -12,8 +12,6 @@ CONFIG_TARGET_ipq806x_generic_DEVICE_xiaomi_r3d=y
#include _argon.config #include _argon.config
#include _vpn.config #include _vpn.config
CONFIG_KERNEL_KALLSYMS=y
### Temp and sensors ### Temp and sensors
CONFIG_PACKAGE_lm-sensors=y CONFIG_PACKAGE_lm-sensors=y
CONFIG_PACKAGE_lm-sensors-detect=y CONFIG_PACKAGE_lm-sensors-detect=y

View File

@@ -16,9 +16,9 @@ KALLSYMS=false
TESTING_KERNEL=false TESTING_KERNEL=false
BUILD_ONLY_INITRAMFS=false BUILD_ONLY_INITRAMFS=false
BUILD_SKIP_INITRAMFS=false BUILD_SKIP_INITRAMFS=false
ONLY_INIT=false CALL_MAKE=true
while getopts "j:t:fiskTI" opt; do while getopts "j:t:fiskTm" opt; do
case $opt in case $opt in
j) MAKE_JOBS=$OPTARG;; j) MAKE_JOBS=$OPTARG;;
t) XTARGET=$OPTARG;; t) XTARGET=$OPTARG;;
@@ -27,7 +27,7 @@ while getopts "j:t:fiskTI" opt; do
T) TESTING_KERNEL=true;; T) TESTING_KERNEL=true;;
i) BUILD_ONLY_INITRAMFS=true;; i) BUILD_ONLY_INITRAMFS=true;;
s) BUILD_SKIP_INITRAMFS=true;; s) BUILD_SKIP_INITRAMFS=true;;
I) ONLY_INIT=true;; m) CALL_MAKE=false;;
esac esac
done done
@@ -264,7 +264,7 @@ function build_target {
#make tools/install -j$make_jobs #make tools/install -j$make_jobs
#make toolchain/install -j$make_jobs #make toolchain/install -j$make_jobs
[ "$ONLY_INIT" = "true" ] && return 0 [ "$CALL_MAKE" = "false" ] && return 0
make -j $make_jobs download world make -j $make_jobs download world
} }

View File

@@ -10,11 +10,9 @@ ADDONSNSS=$XDIR/_addons_nss.config
. ./xcommon.sh . ./xcommon.sh
OPT_FULL_UPDATE=false OPT_FULL_UPDATE=false
USE_GITHUB_SRC=false
while getopts "f" opt; do while getopts "f" opt; do
case $opt in case $opt in
f) OPT_FULL_UPDATE=true;; f) OPT_FULL_UPDATE=true;;
g) USE_GITHUB_SRC=true;;
esac esac
done done
@@ -48,12 +46,6 @@ git reset --hard origin/$CUR_BRANCH
rm -f feeds.conf rm -f feeds.conf
cp -f feeds.conf.default feeds.conf cp -f feeds.conf.default feeds.conf
if [ "$USE_GITHUB_SRC" = "true" ]; then
sed -i -e 's|https://git.openwrt.org/feed/|https://github.com/openwrt/|' feeds.conf
sed -i -e 's|https://git.openwrt.org/project/|https://github.com/openwrt/|' feeds.conf
fi
feed_lst=$( get_cfg_feed_lst "$ADDONSCFG" ) feed_lst=$( get_cfg_feed_lst "$ADDONSCFG" )
for feed in $feed_lst; do for feed in $feed_lst; do
value=$( get_cfg_feed_url "$ADDONSCFG" $feed ) value=$( get_cfg_feed_url "$ADDONSCFG" $feed )