mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2026-02-06 17:36:15 +05:00
Compare commits
29 Commits
c5fe3ea00b
...
v25-260103
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca4573f31f | ||
|
|
f01482890b | ||
|
|
510a31e7ec | ||
|
|
8f6a81ecd2 | ||
|
|
68cb027109 | ||
|
|
acff39477b | ||
|
|
e57e548f61 | ||
|
|
eb978ba58e | ||
|
|
61f33e4c33 | ||
|
|
0a66ad1f3a | ||
|
|
e67a3d001b | ||
|
|
b01b370c51 | ||
|
|
75542fe301 | ||
|
|
8739c51995 | ||
|
|
ea8d7eea5f | ||
|
|
1d93b461b7 | ||
|
|
cfc8241f53 | ||
|
|
8c2f6fd7de | ||
|
|
e021297496 | ||
|
|
0cb316891c | ||
|
|
aed5f171a8 | ||
|
|
08cccf41b7 | ||
|
|
e6e97ddbc8 | ||
|
|
b650894e8a | ||
|
|
78cc0dee60 | ||
|
|
0b066fe854 | ||
|
|
67e187b849 | ||
|
|
ef5e7155b5 | ||
|
|
b788e7e165 |
345
.github/workflows/build.yml
vendored
345
.github/workflows/build.yml
vendored
@@ -3,8 +3,21 @@ name: build
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
use_cache:
|
||||||
|
description: 'Restore cache for host tools'
|
||||||
|
required: true
|
||||||
|
default: 'false'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- true
|
||||||
|
- false
|
||||||
|
cache_ver:
|
||||||
|
description: 'Use cache version'
|
||||||
|
required: false
|
||||||
|
default: '0'
|
||||||
|
type: string
|
||||||
test_build:
|
test_build:
|
||||||
description: 'Test build'
|
description: 'Test build (only spec target) '
|
||||||
required: true
|
required: true
|
||||||
default: 'false'
|
default: 'false'
|
||||||
type: choice
|
type: choice
|
||||||
@@ -12,12 +25,12 @@ on:
|
|||||||
- true
|
- true
|
||||||
- false
|
- false
|
||||||
target_name:
|
target_name:
|
||||||
description: 'Target Name'
|
description: 'Target Name for test build'
|
||||||
required: false
|
required: false
|
||||||
default: 'r3d'
|
default: 'r3d'
|
||||||
type: string
|
type: string
|
||||||
package_dir:
|
package_dir:
|
||||||
description: 'Package Dir'
|
description: 'Package Dir for test build'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
@@ -40,13 +53,11 @@ env:
|
|||||||
FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
|
FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
|
||||||
TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || github.event.inputs.test_build == 'true' && '-test' || '' }}
|
TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || github.event.inputs.test_build == 'true' && '-test' || '' }}
|
||||||
TARGET_NAME: ${{ github.event.inputs.target_name }}
|
TARGET_NAME: ${{ github.event.inputs.target_name }}
|
||||||
PACKAGE_DIR: ${{ github.event.inputs.package_dir }}
|
G_PKG_DIR: ${{ github.event.inputs.package_dir }}
|
||||||
REPO_URL: https://github.com/openwrt-xiaomi/openwrt
|
REPO_URL: https://github.com/openwrt-xiaomi/openwrt
|
||||||
REPO_LNK: openwrt-xiaomi/openwrt
|
REPO_LNK: openwrt-xiaomi/openwrt
|
||||||
REPO_BRANCH: xq-25.12
|
REPO_BRANCH: xq-25.12
|
||||||
TAG_PREFIX: v25-
|
TAG_PREFIX: v25-
|
||||||
BUILD_ROOT: ${{ github.workspace }}/openwrt
|
|
||||||
DEPENDENCIES: ${{ github.workspace }}/dependencies-ubuntu.txt
|
|
||||||
TZ: UTC
|
TZ: UTC
|
||||||
DEVICE_NAME: unknown
|
DEVICE_NAME: unknown
|
||||||
BUILD_DATE: unknown
|
BUILD_DATE: unknown
|
||||||
@@ -162,7 +173,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt-get -qq update
|
sudo apt-get -qq update
|
||||||
#sudo apt-get -qq update && sudo apt-get -qq upgrade
|
#sudo apt-get -qq update && sudo apt-get -qq upgrade
|
||||||
sudo apt-get -qq install $(cat $DEPENDENCIES)
|
sudo apt-get -qq install build-essential gawk flex rsync swig unzip zlib1g-dev file wget
|
||||||
|
sudo apt-get -qq install libc6-dev clang bison g++ gcc-multilib g++-multilib
|
||||||
|
sudo apt-get -qq install gettext git libncurses5-dev libssl-dev python3-setuptools
|
||||||
|
sudo apt-get -qq install libc6-dev pkg-config
|
||||||
sudo apt-get -qq autoremove --purge
|
sudo apt-get -qq autoremove --purge
|
||||||
sudo apt-get -qq clean
|
sudo apt-get -qq clean
|
||||||
sudo timedatectl set-timezone "$TZ"
|
sudo timedatectl set-timezone "$TZ"
|
||||||
@@ -175,28 +189,100 @@ jobs:
|
|||||||
remove-haskell: true
|
remove-haskell: true
|
||||||
remove-codeql: true
|
remove-codeql: true
|
||||||
remove-docker-images: true
|
remove-docker-images: true
|
||||||
|
|
||||||
|
- name: Set fixed workspace
|
||||||
|
env:
|
||||||
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p $GITHUB_WORKSPACE/_temp
|
||||||
|
#sudo chown -R $USER:$USER $GITHUB_WORKSPACE
|
||||||
|
echo "GITHUB_WORKSPACE = $GITHUB_WORKSPACE"
|
||||||
|
echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" >> $GITHUB_ENV
|
||||||
|
echo "RUNNER_TEMP=$GITHUB_WORKSPACE/_temp" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Checkout builder
|
- name: Checkout builder
|
||||||
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.git openwrt
|
||||||
|
rm -rf .git
|
||||||
|
rsync -a openwrt/ ./
|
||||||
|
rm -rf openwrt
|
||||||
|
|
||||||
- name: Init builder
|
- name: Init builder
|
||||||
env:
|
|
||||||
BLDROOT: ${{ github.workspace }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
rsync -avq --exclude=".*" --exclude="$(basename $BUILD_ROOT)" $BLDROOT/ $BUILD_ROOT/
|
|
||||||
cd $BUILD_ROOT
|
|
||||||
chmod +x *.sh
|
chmod +x *.sh
|
||||||
wget https://github.com/fantastic-packages/packages/raw/refs/heads/25.12/keys/usign/53FF2B6672243D28.pub
|
#wget https://github.com/fantastic-packages/packages/raw/refs/heads/master/keys/apksign/20241123170031.pub
|
||||||
|
wget https://fantastic-packages.github.io/releases/25.12/20241123170031.pub
|
||||||
|
|
||||||
- name: Update OpenWrt packages
|
- name: Update OpenWrt packages
|
||||||
id: update
|
id: update
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT && ./xupdate.sh -f
|
./xupdate.sh -f
|
||||||
|
mkdir -p logs
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Prepare for cache
|
||||||
|
id: cache_prepare
|
||||||
|
env:
|
||||||
|
TARGET: ${{ matrix.target }}
|
||||||
|
USE_CACHE: ${{ github.event.inputs.use_cache }}
|
||||||
|
CACHE_VER: ${{ github.event.inputs.cache_ver }}
|
||||||
|
run: |
|
||||||
|
if [ "$USE_CACHE" = "true" ]; then
|
||||||
|
rm -rf staging_dir/
|
||||||
|
mkdir -p staging_dir/host
|
||||||
|
rm -rf build_dir/
|
||||||
|
mkdir -p build_dir/host
|
||||||
|
fi
|
||||||
|
if [[ " kng_re r3g r3p " == *" $TARGET "* ]]; then
|
||||||
|
CACHE_ARCH=mips
|
||||||
|
else
|
||||||
|
CACHE_ARCH=arm
|
||||||
|
fi
|
||||||
|
echo "CACHE_ARCH = $CACHE_ARCH"
|
||||||
|
echo "USE_CACHE=$USE_CACHE" >> $GITHUB_ENV
|
||||||
|
echo "CACHE_VER=$CACHE_VER" >> $GITHUB_ENV
|
||||||
|
echo "CACHE_ARCH=$CACHE_ARCH" >> $GITHUB_ENV
|
||||||
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Restore cache for host tools
|
||||||
|
id: tools_cache_restore
|
||||||
|
if: github.event.inputs.use_cache == 'true'
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
key: host-tools-${{ env.CACHE_VER }}-${{ env.CACHE_ARCH }}-${{ hashFiles('tools/**') }}
|
||||||
|
path: |
|
||||||
|
staging_dir/host
|
||||||
|
build_dir/host
|
||||||
|
|
||||||
|
- name: Fix time stamps into restored dirs
|
||||||
|
if: github.event.inputs.use_cache == 'true' && steps.tools_cache_restore.outputs.cache-hit == 'true'
|
||||||
|
run: |
|
||||||
|
touch staging_dir/host/.prepared
|
||||||
|
touch staging_dir/host/.prereq-build
|
||||||
|
touch staging_dir/host/stamp/.* 2>/dev/null
|
||||||
|
find build_dir/host -name ".prepared*" -exec touch {} +
|
||||||
|
find build_dir/host -name ".configured" -exec touch {} +
|
||||||
|
find build_dir/host -name ".built" -exec touch {} +
|
||||||
|
|
||||||
|
- name: Inspect restored host tools
|
||||||
|
if: github.event.inputs.use_cache == 'true'
|
||||||
|
run: |
|
||||||
|
echo "====== openwrt-native.txt ======"
|
||||||
|
cat build_dir/host/pkgconf-*/openwrt-native.txt || true
|
||||||
|
echo "====== staging_dir/host ====="
|
||||||
|
du -sh staging_dir/host || true
|
||||||
|
ls -la staging_dir/host || true
|
||||||
|
echo "====== staging_dir/host/bin ====="
|
||||||
|
du -sh staging_dir/host/bin || true
|
||||||
|
ls -1 staging_dir/host/bin | head -20 || true
|
||||||
|
echo "====== build_dir/host ======="
|
||||||
|
du -sh build_dir/host || true
|
||||||
|
ls -1 build_dir/host | head -20 || true
|
||||||
|
echo "====== path info ========"
|
||||||
|
grep -R "/home/runner" build_dir/host | head
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
id: configure
|
id: configure
|
||||||
@@ -205,8 +291,6 @@ jobs:
|
|||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT && echo "init build config"
|
|
||||||
FILE_DATE=$(date --utc +'%y%m%d')
|
|
||||||
./xmake.sh -I -t $TARGET
|
./xmake.sh -I -t $TARGET
|
||||||
G_DEVICE_NAME=$( grep -so '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' )
|
G_DEVICE_NAME=$( grep -so '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' )
|
||||||
[ -z "$G_DEVICE_NAME" ] && exit 31
|
[ -z "$G_DEVICE_NAME" ] && exit 31
|
||||||
@@ -214,6 +298,8 @@ jobs:
|
|||||||
[ -z "$G_BOARD_NAME" ] && exit 32
|
[ -z "$G_BOARD_NAME" ] && exit 32
|
||||||
G_SUBTARGET_NAME=$( grep -so '^CONFIG_TARGET_SUBTARGET=.*' .config | cut -d'"' -f2 )
|
G_SUBTARGET_NAME=$( grep -so '^CONFIG_TARGET_SUBTARGET=.*' .config | cut -d'"' -f2 )
|
||||||
[ -z "$G_SUBTARGET_NAME" ] && exit 33
|
[ -z "$G_SUBTARGET_NAME" ] && exit 33
|
||||||
|
G_TARGET_ARCH=$( grep -so '^CONFIG_TARGET_ARCH_PACKAGES=.*' .config | cut -d'"' -f2 )
|
||||||
|
echo "G_TARGET_ARCH = $G_TARGET_ARCH"
|
||||||
VERMAGIC_LIST="vermagic-$G_BOARD_NAME-$G_SUBTARGET_NAME-*.list"
|
VERMAGIC_LIST="vermagic-$G_BOARD_NAME-$G_SUBTARGET_NAME-*.list"
|
||||||
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
||||||
./vermagic_update.sh $G_BOARD_NAME $G_SUBTARGET_NAME
|
./vermagic_update.sh $G_BOARD_NAME $G_SUBTARGET_NAME
|
||||||
@@ -221,133 +307,139 @@ jobs:
|
|||||||
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
||||||
exit 41
|
exit 41
|
||||||
fi
|
fi
|
||||||
|
FILE_DATE=$(date --utc +'%y%m%d')
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
echo "FW_VER=$FW_VER" >> $GITHUB_ENV
|
echo "FW_VER=$FW_VER" >> $GITHUB_ENV
|
||||||
echo "G_DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
echo "G_DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
||||||
echo "G_BOARD_NAME=$G_BOARD_NAME" >> $GITHUB_ENV
|
echo "G_BOARD_NAME=$G_BOARD_NAME" >> $GITHUB_ENV
|
||||||
echo "G_SUBTARGET_NAME=$G_SUBTARGET_NAME" >> $GITHUB_ENV
|
echo "G_SUBTARGET_NAME=$G_SUBTARGET_NAME" >> $GITHUB_ENV
|
||||||
|
echo "G_TARGET_ARCH=$G_TARGET_ARCH" >> $GITHUB_ENV
|
||||||
echo "FILE_DATE=$FILE_DATE" >> $GITHUB_ENV
|
echo "FILE_DATE=$FILE_DATE" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Dump .config file
|
- name: Dump .config file
|
||||||
run: |
|
run: |
|
||||||
echo "====== .config ========="
|
echo "====== .config ========="
|
||||||
cat $BUILD_ROOT/.config
|
cat .config
|
||||||
echo "========================"
|
echo "========================"
|
||||||
|
cp -f .config logs/config1
|
||||||
|
cp -f .config config1
|
||||||
|
|
||||||
- name: Download tools and toolchain
|
- name: Monitor memory
|
||||||
id: tools_download
|
|
||||||
if: steps.configure.outputs.status == 'success'
|
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT
|
echo "CPU cores = $(nproc)"
|
||||||
G_TARGET_ARCH=$( grep -so '^CONFIG_TARGET_ARCH_PACKAGES=' .config | cut -d'"' -f2 )
|
echo "Memory and swap:"
|
||||||
echo "G_TARGET_ARCH=$G_TARGET_ARCH" >> $GITHUB_ENV
|
sudo free -h
|
||||||
echo "OpenWrt version: $FW_VER"
|
echo
|
||||||
SDK_URL_BASE="https://downloads.openwrt.org/releases/${FW_VER}/targets/${G_BOARD_NAME}/${G_SUBTARGET_NAME}"
|
sudo swapon --show
|
||||||
echo "Searching SDK at $SDK_URL_BASE"
|
echo
|
||||||
SDK_TARBALL=$( curl -s "$SDK_URL_BASE/" | grep -oE 'openwrt-sdk-[^"]+Linux-x86_64\.tar\.(xz|zst)' | head -n1 )
|
echo "Available storage:"
|
||||||
if [ -z "$SDK_TARBALL" ]; then
|
sudo df -h
|
||||||
echo "ERROR: SDK not found for ${G_BOARD_NAME}/${G_SUBTARGET_NAME}"
|
|
||||||
exit 81
|
- name: Download sources (dl)
|
||||||
fi
|
id: download
|
||||||
echo "Found SDK: $SDK_TARBALL"
|
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
||||||
#curl -L --fail --retry 5 --retry-delay 5 --progress-bar -o "$SDK_TARBALL" "$SDK_URL_BASE/$SDK_TARBALL"
|
run: |
|
||||||
wget --progress=dot:mega "$SDK_URL_BASE/$SDK_TARBALL"
|
make -j$(nproc) download
|
||||||
if [[ "$SDK_TARBALL" == *.tar.xz ]]; then
|
|
||||||
tar -xf "$SDK_TARBALL"
|
|
||||||
elif [[ "$SDK_TARBALL" == *.tar.zst ]]; then
|
|
||||||
tar -I zstd -xf "$SDK_TARBALL"
|
|
||||||
else
|
|
||||||
echo "Unknown archive format: $SDK_TARBALL"
|
|
||||||
exit 82
|
|
||||||
fi
|
|
||||||
SDK_DIR=$(tar -tf "$SDK_TARBALL" | head -n1 | cut -d/ -f1)
|
|
||||||
echo "Using SDK dir: $SDK_DIR"
|
|
||||||
rm -rf staging_dir
|
|
||||||
mv "$SDK_DIR/staging_dir" .
|
|
||||||
echo "========= staging_dir =========="
|
|
||||||
ls -l staging_dir
|
|
||||||
echo "================================"
|
|
||||||
#cp -a "$SDK_DIR"/toolchain/* toolchain/ 2>/dev/null || true
|
|
||||||
TOOLS_DIR=staging_dir/host
|
|
||||||
touch $TOOLS_DIR/.prepared
|
|
||||||
TOOLS_STAMP_DIR=$TOOLS_DIR/stamp
|
|
||||||
TOOLS_PKGS=$(
|
|
||||||
find tools/ -maxdepth 1 -mindepth 1 -type d | while read -r d; do
|
|
||||||
mk="$d/Makefile"
|
|
||||||
[ -f "$mk" ] || continue
|
|
||||||
awk -F':=' '
|
|
||||||
/^[[:space:]]*PKG_NAME[[:space:]]*:=/ {
|
|
||||||
v=$2
|
|
||||||
gsub(/\r/, "", v)
|
|
||||||
gsub(/^[[:space:]]+/, "", v)
|
|
||||||
gsub(/[[:space:]]+$/, "", v)
|
|
||||||
if (v != "") print v
|
|
||||||
}
|
|
||||||
' "$mk"
|
|
||||||
done | sort -u
|
|
||||||
)
|
|
||||||
mkdir -p "$TOOLS_STAMP_DIR"
|
|
||||||
echo "Found host tools packages: $TOOLS_PKGS"
|
|
||||||
for pkg in $TOOLS_PKGS; do
|
|
||||||
touch "$TOOLS_STAMP_DIR/.$pkg"_installed
|
|
||||||
done
|
|
||||||
TOOLCHAIN_DIR=$( find staging_dir -maxdepth 1 -type d -name "toolchain-*" )
|
|
||||||
echo "Found toolchain directory: $TOOLCHAIN_DIR"
|
|
||||||
#touch $TOOLCHAIN_DIR/.prepared
|
|
||||||
mkdir -p "$TOOLCHAIN_DIR/stamp"
|
|
||||||
touch $TOOLCHAIN_DIR/stamp/.binutils_installed
|
|
||||||
#touch $TOOLCHAIN_DIR/stamp/.fortify-headers_installed
|
|
||||||
touch $TOOLCHAIN_DIR/stamp/.gcc_final_installed
|
|
||||||
touch $TOOLCHAIN_DIR/stamp/.gcc_initial_installed
|
|
||||||
touch $TOOLCHAIN_DIR/stamp/.gdb_installed
|
|
||||||
#touch $TOOLCHAIN_DIR/stamp/.linux_installed
|
|
||||||
touch $TOOLCHAIN_DIR/stamp/.musl_installed
|
|
||||||
touch $TOOLCHAIN_DIR/stamp/.toolchain_compile
|
|
||||||
echo "Checking cross-compiler..."
|
|
||||||
find staging_dir -name '*gcc' | head -n 10
|
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Fix time stamps into restored dirs
|
||||||
|
if: github.event.inputs.use_cache == 'true' && steps.tools_cache_restore.outputs.cache-hit == 'true'
|
||||||
|
run: |
|
||||||
|
touch staging_dir/host/.prepared
|
||||||
|
touch staging_dir/host/.prereq-build
|
||||||
|
touch staging_dir/host/stamp/.* 2>/dev/null
|
||||||
|
find build_dir/host -name ".prepared*" -exec touch {} +
|
||||||
|
find build_dir/host -name ".configured" -exec touch {} +
|
||||||
|
find build_dir/host -name ".built" -exec touch {} +
|
||||||
|
|
||||||
- name: Build tools and toolchain
|
- name: Build tools and toolchain
|
||||||
id: tools
|
id: tools
|
||||||
if: steps.configure.outputs.status == 'success'
|
if: ${{ steps.configure.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT
|
make toolchain/install -j$(nproc)
|
||||||
MAKE_JOBS=$(nproc)
|
|
||||||
echo "$MAKE_JOBS thread compile"
|
|
||||||
export CCACHE=1
|
|
||||||
make tools/install -j$MAKE_JOBS
|
|
||||||
make toolchain/install -j$MAKE_JOBS
|
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Save cache for host tools
|
||||||
|
id: tools_cache_save
|
||||||
|
if: steps.tools.outputs.status == 'success'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
key: host-tools-${{ env.CACHE_VER }}-${{ env.CACHE_ARCH }}-${{ hashFiles('tools/**') }}
|
||||||
|
path: |
|
||||||
|
staging_dir/host
|
||||||
|
build_dir/host
|
||||||
|
|
||||||
|
- name: Configure 2
|
||||||
|
id: configure2
|
||||||
|
if: steps.tools.outputs.status == 'success'
|
||||||
|
env:
|
||||||
|
TARGET: ${{ matrix.target }}
|
||||||
|
run: |
|
||||||
|
make clean
|
||||||
|
./xmake.sh -I -t $TARGET
|
||||||
|
mkdir -p logs
|
||||||
|
cp -f .config logs/config2
|
||||||
|
[ -f config1 ] && cp -f config1 logs/config1
|
||||||
|
|
||||||
|
- name: Kernel compile
|
||||||
|
id: kernel
|
||||||
|
if: ${{ steps.tools.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
||||||
|
run: |
|
||||||
|
make target/linux/compile -j$(nproc)
|
||||||
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: <<< TEST compile >>>
|
||||||
|
if: false # ${{ steps.kernel.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
||||||
|
run: |
|
||||||
|
make buildinfo
|
||||||
|
echo "====== package/utils/lua/host/compile"
|
||||||
|
make package/utils/lua/host/compile
|
||||||
|
echo "====== package/system/apk/host/compile"
|
||||||
|
make package/system/apk/host/compile
|
||||||
|
cp -f .config logs/config3
|
||||||
|
echo "====== package/feeds/packages/mdio-netlink"
|
||||||
|
make package/feeds/packages/mdio-netlink/compile V=sc
|
||||||
|
# exit 78
|
||||||
|
# make package/feeds/packages/mdio-netlink/compile V=s --debug=j
|
||||||
|
# make package/feeds/packages/mdio-netlink/compile V=sc
|
||||||
|
|
||||||
|
- name: Monitor memory 2
|
||||||
|
run: |
|
||||||
|
echo "Memory and swap:"
|
||||||
|
sudo free -h
|
||||||
|
echo
|
||||||
|
sudo swapon --show
|
||||||
|
echo
|
||||||
|
echo "Available storage:"
|
||||||
|
sudo df -h
|
||||||
|
|
||||||
- name: Build the firmware image
|
- name: Build the firmware image
|
||||||
id: compile
|
id: compile
|
||||||
if: steps.tools.outputs.status == 'success'
|
if: steps.tools.outputs.status == 'success'
|
||||||
env:
|
env:
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
run: |
|
run: |
|
||||||
cd $BUILD_ROOT
|
echo "Run $(nproc) thread compile"
|
||||||
MAKE_JOBS=$(nproc)
|
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$G_PKG_DIR" != "" ]; then
|
||||||
echo "$MAKE_JOBS thread compile"
|
make target/linux/compile -j$(npoc)
|
||||||
export CCACHE=1
|
echo "=============== BUILD PACKAGE: $G_PKG_DIR ==============="
|
||||||
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$PACKAGE_DIR" != "" ]; then
|
make $G_PKG_DIR/compile V=sc BUILD_LOG=1
|
||||||
make $PACKAGE_DIR/compile V=sc BUILD_LOG=1
|
|
||||||
exit 99
|
exit 99
|
||||||
fi
|
fi
|
||||||
if [ "$FAKE_BUILD" != "true" ]; then
|
if [ "$FAKE_BUILD" != "true" ]; then
|
||||||
if [ "$TEST_BUILD" != "true" ]; then
|
if [ "$TEST_BUILD" != "true" ]; then
|
||||||
make -j $MAKE_JOBS download world
|
make -j$(nproc) world
|
||||||
else
|
else
|
||||||
make V=sc download world
|
make V=sc world
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# process results
|
# process results
|
||||||
OUT_DIR=$BUILD_ROOT/bin/targets/$G_BOARD_NAME/$G_SUBTARGET_NAME
|
OUT_DIR=bin/targets/$G_BOARD_NAME/$G_SUBTARGET_NAME
|
||||||
if [ "$FAKE_BUILD" = "true" ]; then
|
if [ "$FAKE_BUILD" = "true" ]; then
|
||||||
mkdir -p logs
|
mkdir -p logs
|
||||||
mkdir -p $OUT_DIR
|
mkdir -p $OUT_DIR
|
||||||
echo "$G_BOARD_NAME $G_SUBTARGET_NAME $G_DEVICE_NAME" > "$OUT_DIR/$G_DEVICE_NAME.txt"
|
echo "$G_BOARD_NAME $G_SUBTARGET_NAME $G_DEVICE_NAME" > "$OUT_DIR/$G_DEVICE_NAME.txt"
|
||||||
touch "$OUT_DIR/kernel-debug.tar.zst"
|
touch "$OUT_DIR/kernel-debug.tar.zst"
|
||||||
ls -la
|
|
||||||
BLD_VER=$FW_VER
|
BLD_VER=$FW_VER
|
||||||
else
|
else
|
||||||
BLD_VER=$( cat $OUT_DIR/profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
|
BLD_VER=$( cat $OUT_DIR/profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
|
||||||
@@ -358,23 +450,40 @@ jobs:
|
|||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
echo "status=success" >> $GITHUB_OUTPUT
|
echo "status=success" >> $GITHUB_OUTPUT
|
||||||
echo "DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
echo "FW_BUILD_OK=1" >> $GITHUB_ENV
|
||||||
echo "BOARD_NAME=$G_BOARD_NAME" >> $GITHUB_ENV
|
|
||||||
echo "SUBTARGET_NAME=$G_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
|
||||||
|
|
||||||
|
- name: Mark firmware build failed
|
||||||
|
if: false # steps.compile.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
echo "Firmware build failed, continuing pipeline"
|
||||||
|
echo "FW_BUILD_OK=0" >> $GITHUB_ENV
|
||||||
|
OUT_DIR=_bin_fake
|
||||||
|
mkdir -p $OUT_DIR
|
||||||
|
echo "$G_BOARD_NAME $G_SUBTARGET_NAME $G_DEVICE_NAME" > "$OUT_DIR/$G_DEVICE_NAME.txt"
|
||||||
|
touch "$OUT_DIR/kernel-debug.tar.zst"
|
||||||
|
echo "BUILD FAILED" > $OUT_DIR/FAILED.txt
|
||||||
|
echo "BLD_VER=$FW_VER" >> $GITHUB_ENV
|
||||||
|
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check space usage
|
- name: Check space usage
|
||||||
run: df -hT
|
run: df -hT
|
||||||
|
|
||||||
|
- name: Check OOM error
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
dmesg | grep -i -E 'oom|killed process' || true
|
||||||
|
echo "================== Memory ================="
|
||||||
|
free -h
|
||||||
|
|
||||||
- name: Compress build logs
|
- name: Compress build logs
|
||||||
if: always()
|
if: always()
|
||||||
env:
|
env:
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
FW_DATE: ${{ needs.check.outputs.fw_date }}
|
FW_DATE: ${{ needs.check.outputs.fw_date }}
|
||||||
LOGS_DIR: ${{ env.BUILD_ROOT }}/logs
|
|
||||||
run: |
|
run: |
|
||||||
tar -cJvf logs-$TARGET-$FW_DATE.tar.xz $LOGS_DIR
|
tar -cJvf logs-$TARGET-$FW_DATE.tar.xz logs
|
||||||
|
|
||||||
- name: Cleanup OUT directory
|
- name: Cleanup OUT directory
|
||||||
if: steps.compile.outputs.status == 'success'
|
if: steps.compile.outputs.status == 'success'
|
||||||
@@ -399,7 +508,7 @@ jobs:
|
|||||||
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 }}-${{ needs.check.outputs.build_date }}-${{ env.G_DEVICE_NAME }}
|
||||||
path: ${{ env.OUT_DIR }}
|
path: ${{ env.OUT_DIR }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
@@ -407,7 +516,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 }}-${{ needs.check.outputs.fw_date }}
|
||||||
path: logs-*.tar.xz
|
path: logs-*.tar.xz
|
||||||
|
|
||||||
release:
|
release:
|
||||||
@@ -423,6 +532,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
pattern: openwrt-*
|
pattern: openwrt-*
|
||||||
|
|
||||||
|
- name: Check for failed builds
|
||||||
|
run: |
|
||||||
|
echo "Checking for FAILED.txt in openwrt-* directories..."
|
||||||
|
FAILED_DIRS=$( find . -maxdepth 1 -type d -name 'openwrt-*' -exec test -f '{}/FAILED.txt' \; -print )
|
||||||
|
if [ -n "$FAILED_DIRS" ]; then
|
||||||
|
echo "❌ Build failures detected in:"
|
||||||
|
exit 201
|
||||||
|
fi
|
||||||
|
echo "✅ No FAILED.txt found, proceeding to release"
|
||||||
|
|
||||||
- name: Put images into zip
|
- name: Put images into zip
|
||||||
run: |
|
run: |
|
||||||
mkdir -p public
|
mkdir -p public
|
||||||
|
|||||||
@@ -9,12 +9,7 @@ CONFIG_PACKAGE_luci-i18n-https-dns-proxy-ru=y
|
|||||||
CONFIG_PACKAGE_igmpproxy=y
|
CONFIG_PACKAGE_igmpproxy=y
|
||||||
|
|
||||||
CONFIG_PACKAGE_zapret=y
|
CONFIG_PACKAGE_zapret=y
|
||||||
CONFIG_PACKAGE_zapret-tpws=y
|
|
||||||
CONFIG_PACKAGE_zapret-mdig=y
|
|
||||||
CONFIG_PACKAGE_zapret-ip2net=y
|
|
||||||
CONFIG_PACKAGE_luci-app-zapret=y
|
CONFIG_PACKAGE_luci-app-zapret=y
|
||||||
|
|
||||||
CONFIG_PACKAGE_zapret2=y
|
CONFIG_PACKAGE_zapret2=y
|
||||||
CONFIG_PACKAGE_zapret2-mdig=y
|
|
||||||
CONFIG_PACKAGE_zapret2-ip2net=y
|
|
||||||
CONFIG_PACKAGE_luci-app-zapret2=y
|
CONFIG_PACKAGE_luci-app-zapret2=y
|
||||||
|
|||||||
37
xmake.sh
37
xmake.sh
@@ -282,28 +282,29 @@ function build_target {
|
|||||||
echo "Patch '$(basename $incfn)' result: OK"
|
echo "Patch '$(basename $incfn)' result: OK"
|
||||||
done
|
done
|
||||||
|
|
||||||
OPKG_DIR=$XDIR/files/etc/opkg
|
APK_DIR=$XDIR/files/etc/apk
|
||||||
if [ -d $OPKG_DIR ]; then
|
if [ -d $APK_DIR ]; then
|
||||||
rm -rf $OPKG_DIR
|
rm -rf $APK_DIR
|
||||||
fi
|
fi
|
||||||
FANT_PKG_KEY=$XDIR/53FF2B6672243D28.pub
|
FANT_PKG_KEY=$XDIR/20241123170031.pub
|
||||||
if [ -f $FANT_PKG_KEY ]; then
|
if [ -f $FANT_PKG_KEY ]; then
|
||||||
OPKG_SRC_DIR=$XDIR/package/system/opkg/files
|
APK_SRC_DIR=$XDIR/package/system/apk/files
|
||||||
OPKG_KEYS_DIR=$OPKG_DIR/keys
|
APK_KEYS_DIR=$APK_DIR/keys
|
||||||
mkdir -p $OPKG_KEYS_DIR
|
mkdir -p $APK_KEYS_DIR
|
||||||
cp $FANT_PKG_KEY $OPKG_KEYS_DIR/53ff2b6672243d28
|
cp $FANT_PKG_KEY $APK_KEYS_DIR/fantastic-packages-20241123170031.pem
|
||||||
OPKG_CFEED_FN=$OPKG_DIR/customfeeds.conf
|
APK_CFEED_FN=$APK_DIR/repositories.d/customfeeds.list
|
||||||
cp $OPKG_SRC_DIR/customfeeds.conf $OPKG_CFEED_FN
|
mkdir -p $APK_DIR/repositories.d
|
||||||
PKG_LINK="https://fantastic-packages.github.io/packages/releases/<<VER>>/packages/<<ARCH>>"
|
cp $APK_SRC_DIR/customfeeds.list $APK_CFEED_FN
|
||||||
echo "" >> $OPKG_CFEED_FN
|
PKG_LINK="https://fantastic-packages.github.io/releases/<<VER>>/packages/<<ARCH>>"
|
||||||
echo "src/gz fantastic_packages_luci $PKG_LINK/luci" >> $OPKG_CFEED_FN
|
echo "" >> $APK_CFEED_FN
|
||||||
echo "src/gz fantastic_packages_packages $PKG_LINK/packages" >> $OPKG_CFEED_FN
|
echo "$PKG_LINK/luci/packages.adb" >> $APK_CFEED_FN
|
||||||
echo "src/gz fantastic_packages_special $PKG_LINK/special" >> $OPKG_CFEED_FN
|
echo "$PKG_LINK/packages/packages.adb" >> $APK_CFEED_FN
|
||||||
|
echo "$PKG_LINK/special/packages.adb" >> $APK_CFEED_FN
|
||||||
TARGET_ARCH_PACKAGES=$( get_cfg_opt_value $CFG TARGET_ARCH_PACKAGES )
|
TARGET_ARCH_PACKAGES=$( get_cfg_opt_value $CFG TARGET_ARCH_PACKAGES )
|
||||||
[ -z "$TARGET_ARCH_PACKAGES" ] && die "Cannot find TARGET ARCH"
|
[ -z "$TARGET_ARCH_PACKAGES" ] && die "Cannot find TARGET ARCH"
|
||||||
sed -i "s/<<VER>>/25.12/g" $OPKG_CFEED_FN
|
sed -i "s/<<VER>>/25.12/g" $APK_CFEED_FN
|
||||||
sed -i "s/<<ARCH>>/$TARGET_ARCH_PACKAGES/g" $OPKG_CFEED_FN
|
sed -i "s/<<ARCH>>/$TARGET_ARCH_PACKAGES/g" $APK_CFEED_FN
|
||||||
logmsg "Added support of Fantastic packages [https://fantastic-packages.github.io/packages]"
|
logmsg "Added support of Fantastic packages [https://fantastic-packages.github.io/releases]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SYSCTLCONF_FN=$XDIR/files/etc/sysctl.conf
|
SYSCTLCONF_FN=$XDIR/files/etc/sysctl.conf
|
||||||
|
|||||||
Reference in New Issue
Block a user