From 5145e3deea943b92680b05f712c08e28b6a02345 Mon Sep 17 00:00:00 2001 From: Nikolay Vasilchuk Date: Thu, 3 Oct 2024 18:04:52 +0300 Subject: [PATCH] x86 and x86_64 support --- .github/workflows/release.yml | 10 ---------- Makefile | 27 ++++++++------------------- README.md | 10 ++-------- common/ipk/common | 9 +++++++-- 4 files changed, 17 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c69796..442abb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,16 +94,6 @@ jobs: asset_name: tpws-keenetic_${{ steps.version.outputs.content }}_aarch64-3.10.ipk asset_content_type: application/octet-stream - - name: Upload Release armv7 - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./out/tpws-keenetic_${{ steps.version.outputs.content }}_armv7-3.2.ipk - asset_name: tpws-keenetic_${{ steps.version.outputs.content }}_armv7-3.2.ipk - asset_content_type: application/octet-stream - - name: Upload Release multiarch uses: actions/upload-release-asset@v1 env: diff --git a/Makefile b/Makefile index e04f1e3..970d51f 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,8 @@ URL_MIPSEL := https://raw.githubusercontent.com/bol-van/zapret/master/binaries/m URL_MIPS := https://raw.githubusercontent.com/bol-van/zapret/master/binaries/mips32r1-msb/tpws URL_AARCH64 := https://raw.githubusercontent.com/bol-van/zapret/master/binaries/aarch64/tpws URL_ARMV7 := https://raw.githubusercontent.com/bol-van/zapret/master/binaries/arm/tpws +URL_X86 := https://raw.githubusercontent.com/bol-van/zapret/master/binaries/x86/tpws +URL_X86_64 := https://raw.githubusercontent.com/bol-van/zapret/master/binaries/x86_64/tpws .DEFAULT_GOAL := packages @@ -72,11 +74,15 @@ _binary-multi: curl -sSL $(URL_MIPS) -o out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-mips curl -sSL $(URL_AARCH64) -o out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-aarch64 curl -sSL $(URL_ARMV7) -o out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-armv7 + curl -sSL $(URL_X86) -o out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-x86 + curl -sSL $(URL_X86_64) -o out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-x86_64 chmod +x out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-mipsel chmod +x out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-mips chmod +x out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-aarch64 chmod +x out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-armv7 + chmod +x out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-x86 + chmod +x out/$(BUILD_DIR)/data$(ROOT_DIR)/tmp/tpws_binary/tpws-x86_64 _startup: @if [[ "$(BUILD_DIR)" == "openwrt" ]]; then \ @@ -147,14 +153,6 @@ aarch64: URL="$(URL_AARCH64)" \ _ipk -armv7: - @make \ - BUILD_DIR=armv7 \ - ARCH=armv7-3.2 \ - FILENAME=tpws-keenetic_$(VERSION)_armv7-3.2.ipk \ - URL="$(URL_ARMV7)" \ - _ipk - multi: @make \ BUILD_DIR=all \ @@ -170,7 +168,7 @@ openwrt: ROOT_DIR= \ _ipk -packages: mipsel mips aarch64 armv7 multi openwrt +packages: mipsel mips aarch64 multi openwrt _repo-clean: rm -rf out/_pages/$(BUILD_DIR) @@ -199,7 +197,6 @@ _repo-index: echo '
' >> out/_pages/index.html
 	echo 'all/' >> out/_pages/index.html
 	echo 'aarch64/' >> out/_pages/index.html
-	echo 'armv7/' >> out/_pages/index.html
 	echo 'mips/' >> out/_pages/index.html
 	echo 'mipsel/' >> out/_pages/index.html
 	echo 'openwrt/' >> out/_pages/index.html
@@ -254,13 +251,6 @@ repo-aarch64:
 		FILENAME=tpws-keenetic_$(VERSION)_aarch64-3.10.ipk \
 		_repository
 
-repo-armv7:
-	@make \
-		BUILD_DIR=armv7 \
-		ARCH=armv7-3.2 \
-		FILENAME=tpws-keenetic_$(VERSION)_armv7-3.2.ipk \
-		_repository
-
 repo-multi:
 	@make \
 		BUILD_DIR=all \
@@ -275,12 +265,11 @@ repo-openwrt:
 		FILENAME=tpws-keenetic_$(VERSION)_all_openwrt.ipk \
 		_repository
 
-repository: repo-mipsel repo-mips repo-aarch64 repo-armv7 repo-multi repo-openwrt _repo-index
+repository: repo-mipsel repo-mips repo-aarch64 repo-multi repo-openwrt _repo-index
 
 clean:
 	rm -rf out/mipsel
 	rm -rf out/mips
 	rm -rf out/aarch64
-	rm -rf out/armv7
 	rm -rf out/all
 	rm -rf out/openwrt
diff --git a/README.md b/README.md
index f557bf4..1f687e8 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@
    mkdir -p /opt/etc/opkg
    echo "src/gz tpws-keenetic https://anonym-tsk.github.io/tpws-keenetic/all" > /opt/etc/opkg/tpws-keenetic.conf
    ```
-   Репозиторий универсальный, поддерживаемые архитектуры: `mipsel`, `mips`, `aarch64`, `armv7`
+   Репозиторий универсальный, поддерживаемые архитектуры: `mipsel`, `mips`, `aarch64`, `armv7`, `x86`, `x86_64`.
 
    
Или можете выбрать репозиторий под конкретную архитектуру @@ -91,12 +91,6 @@ mkdir -p /opt/etc/opkg echo "src/gz tpws-keenetic https://anonym-tsk.github.io/tpws-keenetic/aarch64" > /opt/etc/opkg/tpws-keenetic.conf ``` - - - `armv7-3.2` - ``` - mkdir -p /opt/etc/opkg - echo "src/gz tpws-keenetic https://anonym-tsk.github.io/tpws-keenetic/armv7" > /opt/etc/opkg/tpws-keenetic.conf - ```
3. Установите пакет @@ -154,7 +148,7 @@ which nft ``` echo "src/gz tpws-keenetic https://anonym-tsk.github.io/tpws-keenetic/openwrt" > /etc/opkg/tpws-keenetic.conf ``` - Репозиторий универсальный, поддерживаемые архитектуры: `mipsel`, `mips`, `aarch64`, `armv7`. + Репозиторий универсальный, поддерживаемые архитектуры: `mipsel`, `mips`, `aarch64`, `armv7`, `x86`, `x86_64`. Для добавления поддержки новых устройств, [создайте Feature Request](https://github.com/Anonym-tsk/tpws-keenetic/issues/new?template=feature_request.md&title=%5BFeature+request%5D+) 4. Установите пакет diff --git a/common/ipk/common b/common/ipk/common index 7305d07..75c7e84 100755 --- a/common/ipk/common +++ b/common/ipk/common @@ -92,21 +92,26 @@ install_binary_func() { OPKG_CONF="${ROOT_DIR}/etc/opkg.conf" if [ -f "$OPKG_CONF" ]; then - ARCH=$(cat "$OPKG_CONF" | grep -oE 'mips-3|mips_|mipsel-3|mipsel_|aarch64-3|aarch64_|armv7' | head -n 1) + ARCH=$(cat "$OPKG_CONF" | grep -oE 'mips-3|mips_|mipsel-3|mipsel_|aarch64-3|aarch64_|armv7|i386|i686|x86_64' | head -n 1) case "$ARCH" in "mips-3"|"mips_") ARCH="mips" ;; "mipsel-3"|"mipsel_") ARCH="mipsel" ;; "aarch64-3"|"aarch64_") ARCH="aarch64" ;; "armv7") ARCH="armv7" ;; + "i386"|"i686") ARCH="x86" ;; esac fi if [ -z $ARCH ]; then - ARCH=$(uname -m | grep -oE 'mips|mipsel|aarch64|armv7') + ARCH=$(uname -m | grep -oE 'mips|mipsel|aarch64|armv7|i386|i686|x86_64') if [ "$ARCH" == "mips" ]; then if grep -qE 'system type.*MediaTek' /proc/cpuinfo; then ARCH="mipsel" + elif grep -q 'mips32r1' /proc/cpuinfo; then + ARCH="mipsel" fi + elif [ "$ARCH" == "i386" ] || [ "$ARCH" == "i686" ]; then + ARCH="x86" fi fi