mirror of
https://github.com/openwrt-xiaomi/builder.git
synced 2026-02-02 23:47:48 +05:00
Compare commits
1 Commits
v25-260106
...
a8f744bf4b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8f744bf4b |
80
.github/workflows/build.yml
vendored
80
.github/workflows/build.yml
vendored
@@ -4,18 +4,13 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
use_cache:
|
||||
description: 'Restore cache for host tools'
|
||||
description: 'Use cache for host tools'
|
||||
required: true
|
||||
default: 'true'
|
||||
default: 'false'
|
||||
type: choice
|
||||
options:
|
||||
- true
|
||||
- false
|
||||
cache_ver:
|
||||
description: 'Use cache version'
|
||||
required: false
|
||||
default: '0'
|
||||
type: string
|
||||
test_build:
|
||||
description: 'Test build (only spec target) '
|
||||
required: true
|
||||
@@ -53,7 +48,7 @@ env:
|
||||
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 }}
|
||||
PACKAGE_DIR: ${{ github.event.inputs.package_dir }}
|
||||
REPO_URL: https://github.com/openwrt-xiaomi/openwrt
|
||||
REPO_LNK: openwrt-xiaomi/openwrt
|
||||
REPO_BRANCH: xq-25.12
|
||||
@@ -176,7 +171,7 @@ jobs:
|
||||
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 install libc6-dev pkg-config
|
||||
sudo apt-get -qq autoremove --purge
|
||||
sudo apt-get -qq clean
|
||||
sudo timedatectl set-timezone "$TZ"
|
||||
@@ -218,41 +213,26 @@ jobs:
|
||||
|
||||
- name: Update OpenWrt packages
|
||||
id: update
|
||||
env:
|
||||
USE_CACHE: ${{ github.event.inputs.use_cache }}
|
||||
run: |
|
||||
./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: |
|
||||
echo "USE_CACHE=$USE_CACHE" >> $GITHUB_ENV
|
||||
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/**') }}
|
||||
key: host-tools-001-${{ hashFiles('tools/**') }}
|
||||
path: |
|
||||
staging_dir/host
|
||||
build_dir/host
|
||||
@@ -266,6 +246,7 @@ jobs:
|
||||
find build_dir/host -name ".prepared*" -exec touch {} +
|
||||
find build_dir/host -name ".configured" -exec touch {} +
|
||||
find build_dir/host -name ".built" -exec touch {} +
|
||||
touch build_dir/stamp
|
||||
|
||||
- name: Inspect restored host tools
|
||||
if: github.event.inputs.use_cache == 'true'
|
||||
@@ -321,8 +302,6 @@ jobs:
|
||||
echo "====== .config ========="
|
||||
cat .config
|
||||
echo "========================"
|
||||
cp -f .config logs/config1
|
||||
cp -f .config config1
|
||||
|
||||
- name: Monitor memory
|
||||
run: |
|
||||
@@ -351,6 +330,7 @@ jobs:
|
||||
find build_dir/host -name ".prepared*" -exec touch {} +
|
||||
find build_dir/host -name ".configured" -exec touch {} +
|
||||
find build_dir/host -name ".built" -exec touch {} +
|
||||
touch build_dir/stamp
|
||||
|
||||
- name: Build tools and toolchain
|
||||
id: tools
|
||||
@@ -359,12 +339,22 @@ jobs:
|
||||
make toolchain/install -j$(nproc)
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Save cache for host tools
|
||||
- name: Save cache for host tools (use_cache = true)
|
||||
id: tools_cache_save
|
||||
if: steps.tools.outputs.status == 'success'
|
||||
if: steps.tools.outputs.status == 'success' && github.event.inputs.use_cache == 'true' && steps.tools_cache_restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
key: host-tools-${{ env.CACHE_VER }}-${{ env.CACHE_ARCH }}-${{ hashFiles('tools/**') }}
|
||||
key: ${{ steps.tools_cache_restore.outputs.cache-primary-key }}
|
||||
path: |
|
||||
staging_dir/host
|
||||
build_dir/host
|
||||
|
||||
- name: Save cache for host tools (use_cache = false)
|
||||
id: tools_cache_save_2
|
||||
if: steps.tools.outputs.status == 'success' && github.event.inputs.use_cache != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
key: host-tools-001-${{ hashFiles('tools/**') }}
|
||||
path: |
|
||||
staging_dir/host
|
||||
build_dir/host
|
||||
@@ -377,15 +367,21 @@ jobs:
|
||||
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)
|
||||
make target/linux/compile -j$(npoc)
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
make package/feeds/packages/mdio-netlink/compile V=s --debug=j
|
||||
|
||||
- name: XXX compile
|
||||
if: false # ${{ steps.tools.outputs.status == 'success' && github.event.inputs.fake_build != 'true' }}
|
||||
run: |
|
||||
make package/utils/lua/host/compile
|
||||
make package/system/apk/host/compile
|
||||
make make package/feeds/packages/mdio-netlink/compile V=sc
|
||||
echo "status=success" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Monitor memory 2
|
||||
@@ -405,10 +401,10 @@ jobs:
|
||||
TARGET: ${{ matrix.target }}
|
||||
run: |
|
||||
echo "Run $(nproc) thread compile"
|
||||
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$G_PKG_DIR" != "" ]; then
|
||||
if [ "$FAKE_BUILD" != "true" -a "$TEST_BUILD" = "true" -a "$PACKAGE_DIR" != "" ]; then
|
||||
make target/linux/compile -j$(npoc)
|
||||
echo "=============== BUILD PACKAGE: $G_PKG_DIR ==============="
|
||||
make $G_PKG_DIR/compile V=sc BUILD_LOG=1
|
||||
echo "=============== BUILD PACKAGE: $PACKAGE_DIR ==============="
|
||||
make $PACKAGE_DIR/compile V=sc BUILD_LOG=1
|
||||
exit 99
|
||||
fi
|
||||
if [ "$FAKE_BUILD" != "true" ]; then
|
||||
@@ -501,7 +497,7 @@ jobs:
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: logs-${{ matrix.target }}-${{ needs.check.outputs.fw_date }}
|
||||
name: logs-${{ matrix.target }}-${{ env.FW_DATE }}
|
||||
path: logs-*.tar.xz
|
||||
|
||||
release:
|
||||
@@ -539,7 +535,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ needs.check.outputs.tag }}
|
||||
with:
|
||||
prerelease: true
|
||||
prerelease: ${{ env.TEST_BUILD == 'true' || env.FAKE_BUILD == 'true' }}
|
||||
tag_name: ${{ needs.check.outputs.tag }}${{ env.TAG_SUFFIX }}
|
||||
name: '${{ needs.check.outputs.tag }}'
|
||||
body: |
|
||||
|
||||
28
xmake.sh
28
xmake.sh
@@ -108,7 +108,6 @@ 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 ############
|
||||
@@ -143,13 +142,10 @@ function build_target {
|
||||
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
|
||||
echo ">>> podkop patched !!!"
|
||||
fi
|
||||
|
||||
DROPBEAR_DIR=$XDIR/package/network/services/dropbear
|
||||
DROPBEAR_MK=$DROPBEAR_DIR/Makefile
|
||||
TMP_DROPBEAR_DIR=$XDIR/_dropbear2024
|
||||
TMP_DROPBEAR_MK=$TMP_DROPBEAR_DIR/Makefile
|
||||
if [ -f $DROPBEAR_MK ]; then
|
||||
# download dropbear 2024.86 (OpenWrt v24.10)
|
||||
if [ ! -f $TMP_DROPBEAR_DIR/Makefile ]; then
|
||||
@@ -163,22 +159,20 @@ function build_target {
|
||||
rm -rf $TMP_DROPBEAR_DIR/package
|
||||
rm -rf $TMP_DROPBEAR_DIR/.git
|
||||
fi
|
||||
rm -rf $DROPBEAR_DIR/files
|
||||
rm -rf $DROPBEAR_DIR/patches
|
||||
fi
|
||||
if [ -f $TMP_DROPBEAR_MK ] && ! grep -q 'PKG_RELEASE:=0' $TMP_DROPBEAR_MK ; then
|
||||
# patch: Disable MODERN and enable RSA/DH-SHA1
|
||||
sed -i 's/^PKG_RELEASE:=.*/PKG_RELEASE:=0/g' $TMP_DROPBEAR_MK
|
||||
sed -i '/,CONFIG_DROPBEAR_MODERN_ONLY,/d' $TMP_DROPBEAR_MK
|
||||
sed -i 's/\tCONFIG_DROPBEAR_MODERN_ONLY/ /g' $TMP_DROPBEAR_MK
|
||||
sed -i 's/ CONFIG_DROPBEAR_MODERN_ONLY/ /g' $TMP_DROPBEAR_MK
|
||||
sed -i 's/DROPBEAR_DH_GROUP14_SHA1,0/ /g' $TMP_DROPBEAR_MK
|
||||
sed -i 's/DROPBEAR_SHA1_HMAC,0/ /g' $TMP_DROPBEAR_MK
|
||||
echo ">>> dropbear patched !!! (disable MODERN_ONLY)"
|
||||
fi
|
||||
if [ -f $DROPBEAR_MK ] && [ -f $TMP_DROPBEAR_MK ] && ! cmp -s $DROPBEAR_MK $TMP_DROPBEAR_MK ; then
|
||||
DROPBEAR_MK=$DROPBEAR_DIR/Makefile
|
||||
if [ -f $DROPBEAR_MK ]; then
|
||||
# downgrade dropbear to 2024.86 (OpenWrt v24.10)
|
||||
rm -rf $DROPBEAR_DIR/*
|
||||
cp -a $TMP_DROPBEAR_DIR/. $DROPBEAR_DIR/
|
||||
echo ">>> dropbear downgraded to 2024.86 !!!"
|
||||
# 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
|
||||
sed -i 's/\tCONFIG_DROPBEAR_MODERN_ONLY/ /g' $DROPBEAR_MK
|
||||
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
|
||||
fi
|
||||
|
||||
make defconfig
|
||||
|
||||
Reference in New Issue
Block a user