Skip to content

Commit

Permalink
x86 and x86_64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonym-tsk committed Oct 3, 2024
1 parent ec16bab commit 5145e3d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 39 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 8 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand 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)
Expand Down Expand Up @@ -199,7 +197,6 @@ _repo-index:
echo '<pre>' >> out/_pages/index.html
echo '<a href="all/">all/</a>' >> out/_pages/index.html
echo '<a href="aarch64/">aarch64/</a>' >> out/_pages/index.html
echo '<a href="armv7/">armv7/</a>' >> out/_pages/index.html
echo '<a href="mips/">mips/</a>' >> out/_pages/index.html
echo '<a href="mipsel/">mipsel/</a>' >> out/_pages/index.html
echo '<a href="openwrt/">openwrt/</a>' >> out/_pages/index.html
Expand Down Expand Up @@ -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 \
Expand 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
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

<details>
<summary>Или можете выбрать репозиторий под конкретную архитектуру</summary>
Expand All @@ -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
```
</details>
3. Установите пакет
Expand Down Expand Up @@ -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. Установите пакет
Expand Down
9 changes: 7 additions & 2 deletions common/ipk/common
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5145e3d

Please sign in to comment.