mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2026-02-02 23:47:48 +05:00
Compare commits
19 Commits
887d928a4b
...
v24-260120
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b6e495bc8 | ||
|
|
e4a6502e6f | ||
|
|
8c4beac735 | ||
|
|
ac0bf84ce1 | ||
|
|
488be8d6d1 | ||
|
|
0babf26e52 | ||
|
|
0aeee17021 | ||
|
|
0fc5ed4afe | ||
|
|
1380b0c663 | ||
|
|
ff59b05218 | ||
|
|
7afa0202ba | ||
|
|
ce52956483 | ||
|
|
a1f00666d4 | ||
|
|
c056d7f32a | ||
|
|
4cf85c12bf | ||
|
|
88a9ebe300 | ||
|
|
757b9b3676 | ||
|
|
fc2ca4f2de | ||
|
|
abdae49448 |
413
.github/workflows/build.yml
vendored
413
.github/workflows/build.yml
vendored
@@ -3,8 +3,21 @@ name: build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
use_cache:
|
||||
description: 'Restore cache for host tools'
|
||||
required: true
|
||||
default: 'true'
|
||||
type: choice
|
||||
options:
|
||||
- true
|
||||
- false
|
||||
cache_ver:
|
||||
description: 'Use cache version'
|
||||
required: false
|
||||
default: '0'
|
||||
type: string
|
||||
test_build:
|
||||
description: 'Test build'
|
||||
description: 'Test build (only spec target) '
|
||||
required: true
|
||||
default: 'false'
|
||||
type: choice
|
||||
@@ -12,10 +25,15 @@ on:
|
||||
- true
|
||||
- false
|
||||
target_name:
|
||||
description: 'Target Name'
|
||||
description: 'Target Name for test build'
|
||||
required: false
|
||||
default: 'r3d'
|
||||
type: string
|
||||
package_dir:
|
||||
description: 'Package Dir for test build'
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
fake_build:
|
||||
description: 'Fake build'
|
||||
required: true
|
||||
@@ -24,6 +42,14 @@ on:
|
||||
options:
|
||||
- true
|
||||
- false
|
||||
trx_build:
|
||||
description: 'TRX images build'
|
||||
required: true
|
||||
default: 'false'
|
||||
type: choice
|
||||
options:
|
||||
- true
|
||||
- false
|
||||
suffix:
|
||||
description: 'TAG suffix'
|
||||
required: false
|
||||
@@ -32,15 +58,13 @@ on:
|
||||
|
||||
env:
|
||||
TEST_BUILD: ${{ github.event.inputs.test_build == 'true' }}
|
||||
TARGET_NAME: ${{ github.event.inputs.target_name }}
|
||||
FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
|
||||
TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || github.event.inputs.test_build == 'true' && '-test' || '' }}
|
||||
TARGET_NAME: ${{ github.event.inputs.target_name }}
|
||||
G_PKG_DIR: ${{ github.event.inputs.package_dir }}
|
||||
REPO_URL: https://github.com/openwrt-xiaomi/openwrt
|
||||
REPO_LNK: openwrt-xiaomi/openwrt
|
||||
REPO_BRANCH: xq-25.12
|
||||
TAG_PREFIX: v25-
|
||||
BUILD_ROOT: ${{ github.workspace }}/openwrt
|
||||
DEPENDENCIES: ${{ github.workspace }}/dependencies-ubuntu.txt
|
||||
REPO_BRANCH: xq-24.10
|
||||
TAG_PREFIX: v24-
|
||||
TZ: UTC
|
||||
DEVICE_NAME: unknown
|
||||
BUILD_DATE: unknown
|
||||
@@ -140,8 +164,9 @@ jobs:
|
||||
- rt-ax57m
|
||||
- rt-ax59u
|
||||
- rt-ax89x
|
||||
- tuf_ax4200
|
||||
- tuf_ax6000
|
||||
- tuf-ax4200
|
||||
- tuf-ax4200q
|
||||
- tuf-ax6000
|
||||
- zen-bt8
|
||||
isTest:
|
||||
- ${{ needs.check.outputs.test_build == 'true' }}
|
||||
@@ -156,7 +181,10 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get -qq update
|
||||
#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 squashfs-tools
|
||||
sudo apt-get -qq autoremove --purge
|
||||
sudo apt-get -qq clean
|
||||
sudo timedatectl set-timezone "$TZ"
|
||||
@@ -169,28 +197,124 @@ jobs:
|
||||
remove-haskell: true
|
||||
remove-codeql: 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
|
||||
uses: actions/checkout@main
|
||||
|
||||
- name: Prepare env params
|
||||
env:
|
||||
INP_FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
|
||||
INP_TRX_BUILD: ${{ github.event.inputs.trx_build == 'true' }}
|
||||
TARGET: ${{ matrix.target }}
|
||||
run: |
|
||||
FAKE_BUILD=$INP_FAKE_BUILD
|
||||
TRX_BUILD=false
|
||||
if [ "$INP_TRX_BUILD" = true ]; then
|
||||
CFG="./_initramfs/$TARGET.config"
|
||||
if [ -f "$CFG" ]; then
|
||||
TRX_BUILD=true
|
||||
echo "Start TRX build for $CFG"
|
||||
echo "OPT_INITRAMFS=-i" >> $GITHUB_ENV
|
||||
else
|
||||
FAKE_BUILD=true
|
||||
echo "Start FAKE build for $TARGET"
|
||||
echo "SKIP_ME=true" >> $GITHUB_ENV
|
||||
fi
|
||||
fi
|
||||
echo "FAKE_BUILD = $FAKE_BUILD"
|
||||
echo "TRX_BUILD = $TRX_BUILD"
|
||||
echo "FAKE_BUILD=$FAKE_BUILD" >> $GITHUB_ENV
|
||||
echo "TRX_BUILD=$TRX_BUILD" >> $GITHUB_ENV
|
||||
|
||||
- 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
|
||||
env:
|
||||
BLDROOT: ${{ github.workspace }}
|
||||
shell: bash
|
||||
run: |
|
||||
rsync -avq --exclude=".*" --exclude="$(basename $BUILD_ROOT)" $BLDROOT/ $BUILD_ROOT/
|
||||
cd $BUILD_ROOT
|
||||
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/24.10/keys/usign/53FF2B6672243D28.pub
|
||||
|
||||
- name: Update OpenWrt packages
|
||||
id: update
|
||||
run: |
|
||||
cd $BUILD_ROOT && ./xupdate.sh -f
|
||||
./xupdate.sh -f
|
||||
mkdir -p logs
|
||||
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
|
||||
id: configure
|
||||
@@ -199,15 +323,15 @@ jobs:
|
||||
TARGET: ${{ matrix.target }}
|
||||
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
||||
run: |
|
||||
cd $BUILD_ROOT && echo "init build config"
|
||||
FILE_DATE=$(date --utc +'%y%m%d')
|
||||
./xmake.sh -I -t $TARGET
|
||||
./xmake.sh $OPT_INITRAMFS -I -t $TARGET
|
||||
G_DEVICE_NAME=$( grep -so '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' )
|
||||
[ -z "$G_DEVICE_NAME" ] && exit 31
|
||||
G_BOARD_NAME=$( grep -so '^CONFIG_TARGET_BOARD=.*' .config | cut -d'"' -f2 )
|
||||
[ -z "$G_BOARD_NAME" ] && exit 32
|
||||
G_SUBTARGET_NAME=$( grep -so '^CONFIG_TARGET_SUBTARGET=.*' .config | cut -d'"' -f2 )
|
||||
[ -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"
|
||||
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
||||
./vermagic_update.sh $G_BOARD_NAME $G_SUBTARGET_NAME
|
||||
@@ -215,73 +339,199 @@ jobs:
|
||||
if [ $(find . -maxdepth 1 -name "$VERMAGIC_LIST" | wc -l) = "0" ]; then
|
||||
exit 41
|
||||
fi
|
||||
FILE_DATE=$(date --utc +'%y%m%d')
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
echo "FW_VER=$FW_VER" >> $GITHUB_ENV
|
||||
echo "G_DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
||||
echo "G_BOARD_NAME=$G_BOARD_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
|
||||
|
||||
- name: Dump .config file
|
||||
run: |
|
||||
echo "====== .config ========="
|
||||
cat $BUILD_ROOT/.config
|
||||
cat .config
|
||||
echo "========================"
|
||||
|
||||
- name: Build the firmware image
|
||||
id: compile
|
||||
if: steps.configure.outputs.status == 'success'
|
||||
cp -f .config logs/config1
|
||||
cp -f .config config1
|
||||
|
||||
- name: Monitor memory
|
||||
run: |
|
||||
echo "CPU cores = $(nproc)"
|
||||
echo "Memory and swap:"
|
||||
sudo free -h
|
||||
echo
|
||||
sudo swapon --show
|
||||
echo
|
||||
echo "Available storage:"
|
||||
sudo df -h
|
||||
|
||||
- name: Download sources (dl)
|
||||
id: download
|
||||
if: ${{ steps.configure.outputs.status == 'success' && env.FAKE_BUILD != 'true' }}
|
||||
run: |
|
||||
make -j$(nproc) download
|
||||
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
|
||||
id: tools
|
||||
if: ${{ steps.configure.outputs.status == 'success' && env.FAKE_BUILD != 'true' }}
|
||||
run: |
|
||||
make toolchain/install -j$(nproc)
|
||||
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 }}
|
||||
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
||||
run: |
|
||||
cd $BUILD_ROOT
|
||||
MAKE_JOBS=$(($(nproc)+1))
|
||||
echo "$MAKE_JOBS thread compile"
|
||||
make clean
|
||||
./xmake.sh $OPT_INITRAMFS -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' && env.FAKE_BUILD != 'true' }}
|
||||
run: |
|
||||
make target/linux/compile -j$(nproc)
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
|
||||
- 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
|
||||
id: compile
|
||||
if: steps.tools.outputs.status == 'success'
|
||||
env:
|
||||
TARGET: ${{ matrix.target }}
|
||||
run: |
|
||||
echo "Run $(nproc) thread compile"
|
||||
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$G_PKG_DIR" != "" ]; then
|
||||
make target/linux/compile -j$(npoc)
|
||||
echo "=============== BUILD PACKAGE: $G_PKG_DIR ==============="
|
||||
make $G_PKG_DIR/compile V=sc BUILD_LOG=1
|
||||
exit 99
|
||||
fi
|
||||
if [ "$FAKE_BUILD" != "true" ]; then
|
||||
if [ "$TEST_BUILD" != "true" ]; then
|
||||
make -j $MAKE_JOBS download world
|
||||
make -j$(nproc) world
|
||||
else
|
||||
make V=sc download world
|
||||
make V=sc world
|
||||
fi
|
||||
fi
|
||||
# process results
|
||||
OUT_DIR=$BUILD_ROOT/bin/targets/$G_BOARD_NAME/$G_SUBTARGET_NAME
|
||||
if [ "$FAKE_BUILD" = "true" ]; then
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Process out results
|
||||
id: install
|
||||
if: steps.compile.outputs.status == 'success' || env.FAKE_BUILD == 'true'
|
||||
env:
|
||||
TARGET: ${{ matrix.target }}
|
||||
OUT_DIR: ./bin/targets/${{ env.G_BOARD_NAME }}/${{ env.G_SUBTARGET_NAME }}
|
||||
run: |
|
||||
if [ "$FAKE_BUILD" = true ]; then
|
||||
mkdir -p logs
|
||||
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"
|
||||
ls -la
|
||||
mkdir -p "$OUT_DIR"
|
||||
cd "$OUT_DIR"
|
||||
echo "$G_BOARD_NAME $G_SUBTARGET_NAME $G_DEVICE_NAME" > "$G_DEVICE_NAME.txt"
|
||||
touch FAKE_BUILD.bin
|
||||
touch kernel-debug.tar.zst
|
||||
BLD_VER=$FW_VER
|
||||
else
|
||||
BLD_VER=$( cat $OUT_DIR/profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
|
||||
if [ ! -d "$OUT_DIR" ]; then
|
||||
echo "OUT_DIR not found!"
|
||||
exit 99
|
||||
fi
|
||||
cd "$OUT_DIR"
|
||||
BLD_VER=$( cat profiles.json | grep -so '"version_number":"[^"]*' | grep -so '[^"]*$' )
|
||||
fi
|
||||
if [ "$SKIP_ME" = true ]; then
|
||||
touch FLAG-SKIP_ME
|
||||
fi
|
||||
if [ "$TRX_BUILD" = true ]; then
|
||||
touch FLAG-TRX_BUILD
|
||||
fi
|
||||
echo "Firmware $BLD_VER [$FILE_DATE] builded!"
|
||||
if [ ! -f $OUT_DIR/kernel-debug.tar.zst ]; then
|
||||
if [ ! -f kernel-debug.tar.zst ]; then
|
||||
echo "File kernel-debug.tar.zst not found!"
|
||||
exit 100
|
||||
fi
|
||||
if [ "$TRX_BUILD" = true ]; then
|
||||
find . -maxdepth 1 -type f ! -name '*-initramfs*' ! -name 'FLAG-*' -delete
|
||||
VER_MAJOR=$( echo "$BLD_VER" | cut -d. -f1 )
|
||||
STD_IMG_DIR="openwrt-initramfs-bin-for-luci"
|
||||
mkdir $STD_IMG_DIR
|
||||
find . -maxdepth 1 -type f -name '*-initramfs*.bin' -exec mv -f {} $STD_IMG_DIR/openwrt-${VER_MAJOR}_${TARGET}_initramfs.bin \;
|
||||
find . -maxdepth 1 -type f -name '*-initramfs*.trx' -exec mv -f {} openwrt-${VER_MAJOR}_${TARGET}_initramfs.trx \;
|
||||
fi
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
echo "DEVICE_NAME=$G_DEVICE_NAME" >> $GITHUB_ENV
|
||||
echo "BOARD_NAME=$G_BOARD_NAME" >> $GITHUB_ENV
|
||||
echo "SUBTARGET_NAME=$G_SUBTARGET_NAME" >> $GITHUB_ENV
|
||||
echo "FW_BUILD_OK=1" >> $GITHUB_ENV
|
||||
echo "BLD_VER=$BLD_VER" >> $GITHUB_ENV
|
||||
echo "OUT_DIR=$OUT_DIR" >> $GITHUB_ENV
|
||||
|
||||
- name: Mark firmware build failed
|
||||
if: false # steps.install.outcome == 'failure' || 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
|
||||
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
|
||||
if: always()
|
||||
env:
|
||||
TARGET: ${{ matrix.target }}
|
||||
FW_DATE: ${{ needs.check.outputs.fw_date }}
|
||||
LOGS_DIR: ${{ env.BUILD_ROOT }}/logs
|
||||
run: |
|
||||
tar -cJvf logs-$TARGET-$FW_DATE.tar.xz $LOGS_DIR
|
||||
tar -cJvf logs-$TARGET-$FW_DATE.tar.xz logs
|
||||
|
||||
- name: Cleanup OUT directory
|
||||
if: steps.compile.outputs.status == 'success'
|
||||
if: steps.install.outputs.status == 'success'
|
||||
env:
|
||||
OUT_DIR: ${{ env.OUT_DIR }}
|
||||
run: |
|
||||
@@ -301,9 +551,9 @@ jobs:
|
||||
|
||||
- name: Upload OUT directory
|
||||
uses: actions/upload-artifact@main
|
||||
if: steps.compile.outputs.status == 'success'
|
||||
if: steps.install.outputs.status == 'success'
|
||||
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 }}
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -311,7 +561,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: logs-${{ matrix.target }}-${{ env.FW_DATE }}
|
||||
name: logs-${{ matrix.target }}-${{ needs.check.outputs.fw_date }}
|
||||
path: logs-*.tar.xz
|
||||
|
||||
release:
|
||||
@@ -327,22 +577,65 @@ jobs:
|
||||
with:
|
||||
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
|
||||
run: |
|
||||
mkdir -p public
|
||||
find . -mindepth 1 -type d -name 'openwrt-*' -exec sh -c 'zip -0 ./public/$(basename {}).zip -j {} {}/*' \;
|
||||
for DIR in openwrt-*; do
|
||||
[ -d "$DIR" ] || continue
|
||||
if [ -f "$DIR/FLAG-SKIP_ME" ]; then
|
||||
echo "Skip $DIR"
|
||||
continue
|
||||
fi
|
||||
ZIP_SUFFIX=""
|
||||
if [ -f "$DIR/FLAG-TRX_BUILD" ]; then
|
||||
echo "TRX_BUILD=true" >> $GITHUB_ENV
|
||||
ZIP_SUFFIX=".trx"
|
||||
fi
|
||||
rm -f "$DIR"/FLAG-*
|
||||
zip_name="./public/$(basename "$DIR")${ZIP_SUFFIX}.zip"
|
||||
echo "Creating $zip_name"
|
||||
( cd "$DIR"; zip -0 -r "../$zip_name" . )
|
||||
done
|
||||
|
||||
- name: Show all zip files
|
||||
run: |
|
||||
ls -lh ./public/*.zip
|
||||
|
||||
- name: Upload assets
|
||||
uses: andelf/nightly-release@main
|
||||
- name: Generate names
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ needs.check.outputs.tag }}
|
||||
FW_VER: ${{ needs.check.outputs.fw_ver }}
|
||||
FW_DATE: ${{ needs.check.outputs.fw_date }}
|
||||
run: |
|
||||
NAME="$TAG"
|
||||
DESC="OpenWrt $FW_VER [$FW_DATE]"
|
||||
if [ "$TRX_BUILD" = true ]; then
|
||||
NAME="TRX-$TAG"
|
||||
TAG="$TAG-trx"
|
||||
DESC="TRX images based on $DESC"
|
||||
fi
|
||||
echo "REL_TAG=$TAG" >> $GITHUB_ENV
|
||||
echo "REL_NAME=$NAME" >> $GITHUB_ENV
|
||||
echo "REL_DESC=$DESC" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload assets
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
prerelease: ${{ env.TEST_BUILD == 'true' || env.FAKE_BUILD == 'true' }}
|
||||
tag_name: ${{ needs.check.outputs.tag }}${{ env.TAG_SUFFIX }}
|
||||
name: '${{ needs.check.outputs.tag }}'
|
||||
draft: ${{ env.TEST_BUILD == 'true' || github.event.inputs.fake_build == 'true' }}
|
||||
prerelease: true
|
||||
tag_name: ${{ env.REL_TAG }}${{ env.TAG_SUFFIX }}
|
||||
name: '${{ env.REL_NAME }}'
|
||||
body: |
|
||||
OpenWrt ${{ needs.check.outputs.fw_ver }} [${{ needs.check.outputs.fw_date }}]
|
||||
${{ env.REL_DESC }}
|
||||
author: [remittor](https://github.com/remittor)
|
||||
files: ./public/*.zip
|
||||
|
||||
@@ -45,6 +45,8 @@ CONFIG_PACKAGE_luci-app-filemanager=y
|
||||
CONFIG_PACKAGE_luci-i18n-filemanager-ru=y
|
||||
#CONFIG_PACKAGE_atftp=y
|
||||
#CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_bind-tools=y
|
||||
CONFIG_PACKAGE_facinstall=y
|
||||
|
||||
### Add-on programs
|
||||
@@ -186,6 +188,7 @@ CONFIG_OPENSSL_WITH_MDC2=y
|
||||
CONFIG_OPENSSL_WITH_WHIRLPOOL=y
|
||||
|
||||
### SSL certificates
|
||||
CONFIG_PACKAGE_ca-bundle=y
|
||||
CONFIG_PACKAGE_ca-certificates=y
|
||||
|
||||
### Luci
|
||||
@@ -37,12 +37,14 @@ CONFIG_PACKAGE_uboot-envtools=y
|
||||
CONFIG_PACKAGE_mtd-utils=y
|
||||
CONFIG_PACKAGE_iw=y
|
||||
CONFIG_PACKAGE_mc=y
|
||||
CONFIG_PACKAGE_rsync=y
|
||||
CONFIG_PACKAGE_luci-app-ttyd=y
|
||||
CONFIG_PACKAGE_luci-i18n-ttyd-ru=y
|
||||
CONFIG_PACKAGE_luci-app-filemanager=y
|
||||
CONFIG_PACKAGE_luci-i18n-filemanager-ru=y
|
||||
CONFIG_PACKAGE_atftp=y
|
||||
#CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_facinstall=y
|
||||
|
||||
CONFIG_PACKAGE_kmod-mtd-rw=y
|
||||
@@ -55,6 +57,7 @@ CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_htop=y
|
||||
CONFIG_PACKAGE_nano=y
|
||||
CONFIG_PACKAGE_ccrypt=y
|
||||
CONFIG_PACKAGE_curl=y
|
||||
CONFIG_PACKAGE_wget=y
|
||||
CONFIG_PACKAGE_patch=y
|
||||
CONFIG_PACKAGE_diffutils=y
|
||||
@@ -64,6 +67,10 @@ CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_zlib=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
|
||||
### SSL certificates
|
||||
CONFIG_PACKAGE_ca-bundle=y
|
||||
CONFIG_PACKAGE_ca-certificates=y
|
||||
|
||||
### Luci
|
||||
CONFIG_LUCI_LANG_en=y
|
||||
CONFIG_LUCI_LANG_ru=y
|
||||
@@ -9,12 +9,7 @@ CONFIG_PACKAGE_luci-i18n-https-dns-proxy-ru=y
|
||||
CONFIG_PACKAGE_igmpproxy=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_zapret2=y
|
||||
CONFIG_PACKAGE_zapret2-mdig=y
|
||||
CONFIG_PACKAGE_zapret2-ip2net=y
|
||||
CONFIG_PACKAGE_luci-app-zapret2=y
|
||||
14
_initramfs/tuf-ax4200q.config
Normal file
14
_initramfs/tuf-ax4200q.config
Normal file
@@ -0,0 +1,14 @@
|
||||
CONFIG_TARGET_mediatek=y
|
||||
CONFIG_TARGET_mediatek_filogic=y
|
||||
CONFIG_TARGET_mediatek_filogic_DEVICE_asus_tuf-ax4200q=y
|
||||
|
||||
#include _addons.config
|
||||
#include _base_initrd.config
|
||||
#include _wifi_en.config
|
||||
|
||||
|
||||
CONFIG_TARGET_INITRAMFS_FORCE=y
|
||||
CONFIG_TARGET_ROOTFS_INITRAMFS=y
|
||||
CONFIG_USES_SEPARATE_INITRAMFS=n
|
||||
CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE=n
|
||||
|
||||
44
tuf-ax4200q.config
Normal file
44
tuf-ax4200q.config
Normal file
@@ -0,0 +1,44 @@
|
||||
CONFIG_TARGET_mediatek=y
|
||||
CONFIG_TARGET_mediatek_filogic=y
|
||||
CONFIG_TARGET_mediatek_filogic_DEVICE_asus_tuf-ax4200q=y
|
||||
|
||||
#include _addons.config
|
||||
#include _base.config
|
||||
#include _wifi_en.config
|
||||
#include _printer.config
|
||||
#include _samba.config
|
||||
#include _torrents.config
|
||||
#include _proxy.config
|
||||
#include _argon.config
|
||||
#include _vpn.config
|
||||
|
||||
### Temp and sensors
|
||||
CONFIG_PACKAGE_lm-sensors=y
|
||||
CONFIG_PACKAGE_lm-sensors-detect=y
|
||||
CONFIG_PACKAGE_luci-app-temp-status=y
|
||||
CONFIG_PACKAGE_luci-i18n-temp-status-ru=y
|
||||
CONFIG_PACKAGE_collectd-mod-sensors=y
|
||||
|
||||
### HDD tools
|
||||
CONFIG_PACKAGE_smartmontools=y
|
||||
CONFIG_PACKAGE_hdparm=y
|
||||
CONFIG_PACKAGE_hd-idle=y
|
||||
CONFIG_PACKAGE_luci-app-hd-idle=y
|
||||
#CONFIG_PACKAGE_luci-i18n-hd-idle-ru=y
|
||||
CONFIG_PACKAGE_luci-app-disks-info=y
|
||||
#CONFIG_PACKAGE_luci-i18n-disks-info-ru=y
|
||||
CONFIG_PACKAGE_luci-app-diskman=y
|
||||
|
||||
### Luci dashboard
|
||||
CONFIG_PACKAGE_luci-mod-dashboard=y
|
||||
CONFIG_PACKAGE_luci-i18n-dashboard-ru=y
|
||||
|
||||
### Network Ports viewer
|
||||
CONFIG_PACKAGE_luci-app-tn-netports=y
|
||||
CONFIG_PACKAGE_luci-i18n-tn-netports-ru=y
|
||||
|
||||
### TimeControl
|
||||
CONFIG_PACKAGE_luci-app-timecontrol=m
|
||||
|
||||
CONFIG_PACKAGE_fantastic-feeds=m
|
||||
|
||||
145
xmake.sh
145
xmake.sh
@@ -15,7 +15,6 @@ OPT_FULL_REBUILD=false
|
||||
KALLSYMS=false
|
||||
TESTING_KERNEL=false
|
||||
BUILD_ONLY_INITRAMFS=false
|
||||
BUILD_SKIP_INITRAMFS=false
|
||||
ONLY_INIT=false
|
||||
|
||||
while getopts "j:t:fiskTI" opt; do
|
||||
@@ -26,7 +25,6 @@ while getopts "j:t:fiskTI" opt; do
|
||||
k) KALLSYMS=true;;
|
||||
T) TESTING_KERNEL=true;;
|
||||
i) BUILD_ONLY_INITRAMFS=true;;
|
||||
s) BUILD_SKIP_INITRAMFS=true;;
|
||||
I) ONLY_INIT=true;;
|
||||
esac
|
||||
done
|
||||
@@ -70,7 +68,7 @@ function build_target {
|
||||
fi
|
||||
inclst=$( get_cfg_inc_lst $CFG )
|
||||
for inc in $inclst; do
|
||||
incfn=$XDIR/$inc
|
||||
incfn=$XDIR/_cfginc/$inc
|
||||
[ ! -f $incfn ] && die "File '$inc' not found!"
|
||||
sed -i "/#include $inc/a <<LF>><<LF>>" $CFG
|
||||
sed -i "s/<<LF>>/\n/g" $CFG
|
||||
@@ -108,6 +106,7 @@ function build_target {
|
||||
############ change images prefix ############
|
||||
# IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
|
||||
sed -i -e 's/^IMG_PREFIX:=.*/IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(call sanitize,$(VERSION_NUMBER))-'$CURDATE'/g' $XDIR/include/image.mk
|
||||
echo ">>> image.mk patched !!!"
|
||||
fi
|
||||
if [ 1 = 1 ]; then
|
||||
############ remove "squashfs" suffix ############
|
||||
@@ -120,10 +119,10 @@ function build_target {
|
||||
fi
|
||||
fi
|
||||
|
||||
AWG_LUCI_MK=$XDIR/package/feeds/_ruantiblock/luci-app-ruantiblock/Makefile
|
||||
if [ -f $AWG_LUCI_MK ]; then
|
||||
if ! grep "PKG_PROVIDES" $AWG_LUCI_MK >/dev/null ; then
|
||||
sed -i 's/LUCI_PKGARCH:=all/LUCI_PKGARCH:=all\nPKG_PROVIDES:=luci-app-ruantiblock/g' $AWG_LUCI_MK
|
||||
RAB_LUCI_MK=$XDIR/package/feeds/_ruantiblock/luci-app-ruantiblock/Makefile
|
||||
if [ -f $RAB_LUCI_MK ]; then
|
||||
if ! grep "PKG_PROVIDES" $RAB_LUCI_MK >/dev/null ; then
|
||||
sed -i 's/LUCI_PKGARCH:=all/LUCI_PKGARCH:=all\nPKG_PROVIDES:=luci-app-ruantiblock/g' $RAB_LUCI_MK
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -134,38 +133,42 @@ function build_target {
|
||||
fi
|
||||
fi
|
||||
|
||||
PODKOP_MK=$XDIR/package/feeds/_podkop/podkop/Makefile
|
||||
if [ -f $PODKOP_MK ]; then
|
||||
sed -i 's/+sing-box / /g' $PODKOP_MK
|
||||
sed -i 's/CONFLICTS:=.*/CONFLICTS:=/g' $PODKOP_MK
|
||||
fi
|
||||
PODKOP_SH=$XDIR/package/feeds/_podkop/podkop/files/usr/bin/podkop
|
||||
if [ -f $PODKOP_SH ] && ! grep -q '(which sing-box)' $PODKOP_SH ; then
|
||||
sed -i '/,\\"dns_configured\\":/i [ -z "$(which sing-box)" ] && status="not installed"' $PODKOP_SH
|
||||
PODKOP_DIR=$XDIR/package/feeds/_podkop
|
||||
if [ -d $PODKOP_DIR ]; then
|
||||
PODKOP_PATCH=
|
||||
PODKOP_MK=$PODKOP_DIR/podkop/Makefile
|
||||
if [ -f $PODKOP_MK ] && grep -q '+sing-box' $PODKOP_MK ; then
|
||||
sed -i 's/+sing-box / /g' $PODKOP_MK
|
||||
sed -i 's/CONFLICTS:=.*/CONFLICTS:=/g' $PODKOP_MK
|
||||
PODKOP_PATCH="$PODKOP_PATCH (del depend sing-box)"
|
||||
fi
|
||||
PODKOP_SH=$PODKOP_DIR/podkop/files/usr/bin/podkop
|
||||
if [ -f $PODKOP_SH ] && ! grep -q '(which sing-box)' $PODKOP_SH ; then
|
||||
sed -i '/,\\"dns_configured\\":/i [ -z "$(which sing-box)" ] && status="not installed"' $PODKOP_SH
|
||||
PODKOP_PATCH="$PODKOP_PATCH (status for sing-box)"
|
||||
fi
|
||||
if [ -f $PODKOP_MK ] && grep -q 'PODKOP_VERSION' $PODKOP_MK ; then
|
||||
PKGVERLIST=$( git ls-remote --tags https://github.com/itdoginfo/podkop.git | awk -F/ '{print $3}' | grep -Ev '^v' | sort -V | tail -n 2 )
|
||||
VER_PREV=$( sed -n '1p' <<< "$PKGVERLIST" )
|
||||
VER_LATEST=$( sed -n '2p' <<< "$PKGVERLIST" )
|
||||
[ -z "$VER_LATEST" ] && { echo "ERROR: cannot detect version of podkop!"; exit 1; }
|
||||
sed -i 's/PKG_VERSION :=.*/PKG_VERSION:='$VER_LATEST'/g' $PODKOP_MK
|
||||
PODKOP_PATCH="$PODKOP_PATCH (set ver $VER_LATEST)"
|
||||
fi
|
||||
PODKOP_MK=$PODKOP_DIR/luci-app-podkop/Makefile
|
||||
if [ -f $PODKOP_MK ] && grep -q 'PODKOP_VERSION' $PODKOP_MK ; then
|
||||
PKGVERLIST=$( git ls-remote --tags https://github.com/itdoginfo/podkop.git | awk -F/ '{print $3}' | grep -Ev '^v' | sort -V | tail -n 2 )
|
||||
VER_PREV=$( sed -n '1p' <<< "$PKGVERLIST" )
|
||||
VER_LATEST=$( sed -n '2p' <<< "$PKGVERLIST" )
|
||||
[ -z "$VER_LATEST" ] && { echo "ERROR: cannot detect version of podkop!"; exit 1; }
|
||||
sed -i 's/PKG_VERSION :=.*/PKG_VERSION:='$VER_LATEST'/g' $PODKOP_MK
|
||||
PODKOP_PATCH="$PODKOP_PATCH (Set Ver $VER_LATEST)"
|
||||
fi
|
||||
[ "$PODKOP_PATCH" != "" ] && echo ">>> podkop patched !!! $PODKOP_PATCH"
|
||||
fi
|
||||
|
||||
DROPBEAR_DIR=$XDIR/package/network/services/dropbear
|
||||
TMP_DROPBEAR_DIR=$XDIR/_dropbear2024
|
||||
DROPBEAR_MK=$XDIR/package/network/services/dropbear/Makefile
|
||||
if [ -f $DROPBEAR_MK ]; then
|
||||
# download dropbear 2024.86 (OpenWrt v24.10)
|
||||
if [ ! -f $TMP_DROPBEAR_DIR/Makefile ]; then
|
||||
rm -rf $TMP_DROPBEAR_DIR
|
||||
git clone --depth 1 --filter=blob:none --sparse https://github.com/openwrt/openwrt.git $TMP_DROPBEAR_DIR && (
|
||||
cd $TMP_DROPBEAR_DIR
|
||||
git sparse-checkout set package/network/services/dropbear
|
||||
git checkout a2f0cd35ac1d15e69f4897b35c049e175dd06825 # commit 2024-12-12 https://github.com/openwrt/openwrt/commits/openwrt-25.12/package/network/services/dropbear
|
||||
mv package/network/services/dropbear/* .
|
||||
)
|
||||
rm -rf $TMP_DROPBEAR_DIR/package
|
||||
rm -rf $TMP_DROPBEAR_DIR/.git
|
||||
fi
|
||||
rm -rf $DROPBEAR_DIR/files
|
||||
rm -rf $DROPBEAR_DIR/patches
|
||||
fi
|
||||
DROPBEAR_MK=$DROPBEAR_DIR/Makefile
|
||||
if [ -f $DROPBEAR_MK ]; then
|
||||
# downgrade dropbear to 2024.86 (OpenWrt v24.10)
|
||||
cp -a $TMP_DROPBEAR_DIR/. $DROPBEAR_DIR/
|
||||
# patch: Disable MODERN and enable RSA/DH-SHA1
|
||||
sed -i 's/^PKG_RELEASE:=.*/PKG_RELEASE:=0/g' $DROPBEAR_MK
|
||||
sed -i '/,CONFIG_DROPBEAR_MODERN_ONLY,/d' $DROPBEAR_MK
|
||||
@@ -173,6 +176,7 @@ function build_target {
|
||||
sed -i 's/ CONFIG_DROPBEAR_MODERN_ONLY/ /g' $DROPBEAR_MK
|
||||
sed -i 's/DROPBEAR_DH_GROUP14_SHA1,0/ /g' $DROPBEAR_MK
|
||||
sed -i 's/DROPBEAR_SHA1_HMAC,0/ /g' $DROPBEAR_MK
|
||||
echo ">>> dropbear patched !!! (disable MODERN_ONLY)"
|
||||
fi
|
||||
|
||||
make defconfig
|
||||
@@ -210,7 +214,10 @@ function build_target {
|
||||
echo -e "\nCONFIG_PACKAGE_wpad-openssl=y\n" >> $CFG
|
||||
fi
|
||||
|
||||
#DASHBRDPO=$XDIR/feeds/luci/modules/luci-mod-dashboard/po/ru/dashboard.po
|
||||
DASHBRDPO=$XDIR/feeds/luci/modules/luci-mod-dashboard/po/ru/dashboard.po
|
||||
if [ -f $DASHBRDPO ]; then
|
||||
sed -i 's/msgid "Dashboard"/msgid "__dash_board__"/g' $DASHBRDPO
|
||||
fi
|
||||
DASHBRDPO=$XDIR/package/feeds/luci/luci-mod-dashboard/po/ru/dashboard.po
|
||||
if [ -f $DASHBRDPO ]; then
|
||||
sed -i 's/msgid "Dashboard"/msgid "__dash_board__"/g' $DASHBRDPO
|
||||
@@ -301,10 +308,13 @@ function build_target {
|
||||
echo "src/gz fantastic_packages_special $PKG_LINK/special" >> $OPKG_CFEED_FN
|
||||
TARGET_ARCH_PACKAGES=$( get_cfg_opt_value $CFG TARGET_ARCH_PACKAGES )
|
||||
[ -z "$TARGET_ARCH_PACKAGES" ] && die "Cannot find TARGET ARCH"
|
||||
sed -i "s/<<VER>>/25.12/g" $OPKG_CFEED_FN
|
||||
sed -i "s/<<VER>>/24.10/g" $OPKG_CFEED_FN
|
||||
sed -i "s/<<ARCH>>/$TARGET_ARCH_PACKAGES/g" $OPKG_CFEED_FN
|
||||
logmsg "Added support of Fantastic packages [https://fantastic-packages.github.io/packages]"
|
||||
fi
|
||||
if [ $BUILD_ONLY_INITRAMFS = true ]; then
|
||||
rm -f $OPKG_DIR/customfeeds.conf
|
||||
fi
|
||||
|
||||
SYSCTLCONF_FN=$XDIR/files/etc/sysctl.conf
|
||||
if [ -f $SYSCTLCONF_FN ]; then
|
||||
@@ -334,13 +344,19 @@ function build_config {
|
||||
local cfg=$1
|
||||
local cfg_name=$( basename $cfg )
|
||||
local target_name=${cfg_name%.*}
|
||||
local initramfs=false
|
||||
local board=$( get_cfg_board $cfg )
|
||||
local subtarget=$( get_cfg_subtarget $cfg $board )
|
||||
local device=$( get_cfg_dev_lst $cfg $board $subtarget )
|
||||
local outdir=$XDIR/bin/targets/$board/$subtarget
|
||||
echo Start build for target $cfg_name "($board-$subtarget-$device)"
|
||||
|
||||
build_target $cfg_name
|
||||
|
||||
if echo "$cfg" | grep -q '_initramfs/' ; then
|
||||
initramfs=true
|
||||
target_name=${target_name}_initramfs
|
||||
fi
|
||||
echo Start build for target $target_name "($board-$subtarget-$device)"
|
||||
|
||||
build_target $cfg
|
||||
|
||||
if [ ! -f $outdir/kernel-debug.tar.zst ]; then
|
||||
echo "ERROR: cannot build images for target $target_name"
|
||||
@@ -355,6 +371,9 @@ function build_config {
|
||||
|
||||
if [ "$XTARGET" != "*" ]; then
|
||||
TARGETCFG=$XDIR/$XTARGET
|
||||
if [ $BUILD_ONLY_INITRAMFS = true ]; then
|
||||
TARGETCFG=$XDIR/_initramfs/$XTARGET
|
||||
fi
|
||||
XTARGET_EXT="${XTARGET##*.}"
|
||||
[ $XTARGET_EXT != config ] && TARGETCFG=$TARGETCFG.config
|
||||
[ ! -f $TARGETCFG ] && die "File '"`basename $TARGETCFG`"' not found!"
|
||||
@@ -366,7 +385,12 @@ if [ "$XTARGET" != "*" ]; then
|
||||
fi
|
||||
|
||||
XOUT=$XDIR/xout
|
||||
CFG_LIST=$( find $XDIR/* -maxdepth 1 -name '[a-z0-9]*.config' )
|
||||
|
||||
if [ $BUILD_ONLY_INITRAMFS = true ]; then
|
||||
CFG_LIST=$( find $XDIR/_initramfs/* -maxdepth 1 -name '[a-z0-9]*.config' )
|
||||
else
|
||||
CFG_LIST=$( find $XDIR/* -maxdepth 1 -name '[a-z0-9]*.config' )
|
||||
fi
|
||||
|
||||
rm -rf $XOUT
|
||||
|
||||
@@ -375,35 +399,16 @@ if [ -z "$CFG_LIST" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INITRAMFS_COUNT=0
|
||||
if [ $BUILD_ONLY_INITRAMFS = true ]; then
|
||||
echo "Start make initramfs configs!"
|
||||
else
|
||||
echo "Start make non initramfs configs!"
|
||||
fi
|
||||
|
||||
clean_all
|
||||
|
||||
for CFG in $CFG_LIST; do
|
||||
if [[ "$CFG" == *"_initramfs"* ]]; then
|
||||
INITRAMFS_COUNT=$(( INITRAMFS_COUNT + 1 ))
|
||||
fi
|
||||
build_config $CFG
|
||||
done
|
||||
|
||||
if [ $INITRAMFS_COUNT = 0 ] && [ $BUILD_ONLY_INITRAMFS = true ]; then
|
||||
echo "ERROR: Cannot found initramfs configs!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $INITRAMFS_COUNT -gt 0 ] && [ $BUILD_SKIP_INITRAMFS != true ]; then
|
||||
echo "Start make initramfs configs!"
|
||||
clean_all
|
||||
for CFG in $CFG_LIST; do
|
||||
[[ "$CFG" != *"_initramfs"* ]] && continue # process only initramfs configs
|
||||
build_config $CFG
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $BUILD_ONLY_INITRAMFS != true ]; then
|
||||
echo "Start make non initramfs configs!"
|
||||
clean_all
|
||||
for CFG in $CFG_LIST; do
|
||||
[[ "$CFG" == *"_initramfs"* ]] && continue # skip initramfs configs
|
||||
build_config $CFG
|
||||
done
|
||||
fi
|
||||
|
||||
echo "All targets was builded!"
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
export XDIR=$SCRIPT_DIR
|
||||
export XADDONSDIR=$XDIR/package/addons
|
||||
FEEDSDIR=$XDIR/package/feeds
|
||||
ADDONSCFG=$XDIR/_addons.config
|
||||
ADDONSNSS=$XDIR/_addons_nss.config
|
||||
ADDONSCFG=$XDIR/_cfginc/_addons.config
|
||||
ADDONSNSS=$XDIR/_cfginc/_addons_nss.config
|
||||
|
||||
. ./xcommon.sh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user