Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipk #1

Open
wants to merge 62 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
05f5932
try package in one
Sep 12, 2022
9370c95
test on ipk branch
Sep 12, 2022
56bdc2c
test on ipk branch
Sep 12, 2022
115e77f
test on ipk branch
Sep 12, 2022
48ee847
test on ipk branch
Sep 12, 2022
28310c2
test on ipk branch
Sep 12, 2022
8aae1b2
test on ipk branch
Sep 12, 2022
07cd868
test on ipk branch
Sep 12, 2022
0e8ebfc
test on ipk branch
Sep 12, 2022
495cb22
test on ipk branch
Sep 12, 2022
df5119f
test on ipk branch
Sep 12, 2022
c562adb
test on ipk branch
Sep 12, 2022
b032e35
test on ipk branch
Sep 12, 2022
c08613e
test on ipk branch
Sep 12, 2022
3ccf496
test on ipk branch
Sep 12, 2022
190bd19
test on ipk branch
Sep 12, 2022
b9fa071
Update Makefile
yongqianme Sep 12, 2022
60c7a44
change tab to 4
Sep 12, 2022
55b45d7
change tab to 4
Sep 12, 2022
c678f9b
change tab to 4
Sep 12, 2022
93c014c
test
Sep 12, 2022
7aee17f
test
Sep 12, 2022
7c9e94f
test
Sep 12, 2022
c994d44
test
Sep 12, 2022
f7c719f
test
Sep 12, 2022
00f0a2b
test
Sep 12, 2022
d477f34
test
Sep 12, 2022
41bbedb
test
Sep 12, 2022
332a078
test
Sep 13, 2022
663b852
test
Sep 13, 2022
43c2a0a
test
Sep 13, 2022
c4b3bbd
test
Sep 13, 2022
9661e67
test
Sep 13, 2022
b247f9d
test
Sep 13, 2022
30c2da5
test
Sep 13, 2022
bddaae5
test
Sep 13, 2022
44d0d20
test
Sep 14, 2022
b02251b
test with mips, mipsle
Sep 14, 2022
c8f6847
test with mips, mipsle
Sep 14, 2022
a34bfae
tab:missing separator
Sep 14, 2022
cec5207
tab:missing separator
Sep 14, 2022
1949bb7
tab:missing separator
Sep 14, 2022
0cd9d95
build string
Sep 14, 2022
e020859
build string
Sep 14, 2022
29b31ef
build string
Sep 14, 2022
428b6a9
build
Sep 14, 2022
a591913
build,amd64 & 386
Sep 14, 2022
247964e
386
Sep 14, 2022
3022df2
386,x84_64
Sep 14, 2022
d2a8a52
386,x84_64
Sep 14, 2022
2a942a0
arm 64
Sep 14, 2022
f2de2bc
arm
Sep 14, 2022
89fed6a
mips, mipsle
Sep 14, 2022
85f531d
compile from go source
Sep 14, 2022
61c5508
ready for package from source
Sep 14, 2022
fb34015
remove a53,a72 for now
Sep 15, 2022
e36cafb
remove a53,a72 for now
Sep 15, 2022
8458ed6
build
Sep 15, 2022
b08b2f9
add arm_cortex-a8_vfpv3
Sep 15, 2022
9f534c7
build all including mips,mipsle
Sep 18, 2022
5943260
build all
Sep 18, 2022
ddbc839
change arch mipsel to mipsle
Sep 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .github/update.py

This file was deleted.

131 changes: 119 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,134 @@
name: build openwrt
on:
push:
branches:
- ipk
tags: [ 'v*' ]
pull_request:

jobs:
build-ipk:
name: Build - ${{ matrix.target.arch }}
runs-on: ubuntu-latest
build-openwrt-1:
name: Build openwrt ${{matrix.target.arch}}
env:
ENVIRONMENT: prod
strategy:
matrix:
target:
- arch: "arm"
- arch: "aarch64_generic"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/rockchip/armv8/openwrt-sdk-21.02.3-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz"
- arch: "aarch64_cortex-a53"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/bcm27xx/bcm2710/openwrt-sdk-21.02.3-bcm27xx-bcm2710_gcc-8.4.0_musl.Linux-x86_64.tar.xz"
- arch: "aarch64_cortex-a72"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/bcm27xx/bcm2711/openwrt-sdk-21.02.3-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a7_neon-vfpv4"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/ipq40xx/generic/openwrt-sdk-21.02.3-ipq40xx-generic_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "aarch64"
sdk: "https://downloads.openwrt.org/releases/22.03.0-rc5/targets/rockchip/armv8/openwrt-sdk-22.03.0-rc5-rockchip-armv8_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "i386"
sdk: "https://downloads.openwrt.org/releases/22.03.0-rc5/targets/x86/generic/openwrt-sdk-22.03.0-rc5-x86-generic_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a8_vfpv3"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/sunxi/cortexa8/openwrt-sdk-21.02.3-sunxi-cortexa8_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "arm_cortex-a9"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/bcm53xx/generic/openwrt-sdk-21.02.3-bcm53xx-generic_gcc-8.4.0_musl_eabi.Linux-x86_64.tar.xz"
- arch: "x86_64"
sdk: "https://downloads.openwrt.org/releases/22.03.0-rc5/targets/x86/64/openwrt-sdk-22.03.0-rc5-x86-64_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/x86/64/openwrt-sdk-21.02.3-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz"
- arch: "i386_pentium4"
sdk: "https://archive.openwrt.org/releases/21.02.3/targets/x86/generic/openwrt-sdk-21.02.3-x86-generic_gcc-8.4.0_musl.Linux-x86_64.tar.xz"
# - arch: "mips"
# sdk: " https://downloads.openwrt.org/releases/19.07.9/targets/ar71xx/generic/openwrt-sdk-19.07.9-ar71xx-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz"
# - arch: "mipsle"
# sdk: "https://downloads.openwrt.org/releases/18.06.9/targets/ramips/mt7621/openwrt-sdk-18.06.9-ramips-mt7621_gcc-7.3.0_musl.Linux-x86_64.tar.xz"
runs-on: ubuntu-latest
steps:
- name: Checkout with tag
uses: actions/checkout@master

- name: prepare requirements
run: |
sudo -E apt-get -y update
sudo -E apt-get install -y openssl
sudo -E apt-get install -y build-essential
sudo -E apt-get install -y libssl-dev
sudo -E apt-get install -y zip gzip upx wget make git
sudo -E apt-get install -y libncurses5 libncurses5-dev unzip gawk zlib1g-dev golang-go

- name: Install OpenWrt SDK
run: |
wget -O openwrt-sdk.tar.xz ${{ matrix.target.sdk }}
xz -q -d openwrt-sdk.tar.xz && tar -xvf openwrt-sdk.tar
mv -f openwrt-sdk-* openwrt-sdk

- name: Prepare GOARCH
run: |
case ${{ matrix.target.arch }} in
x86_64|amd64)
echo "ARCH_4_GO=amd64" >> $GITHUB_ENV
;;
i386_pentium4|i386|i686)
echo "ARCH_4_GO=386" >> $GITHUB_ENV
;;
arm64|aarch64|aarch64_be|aarch64_generic|aarch64_cortex-a53|aarch64_cortex-a72)
echo "ARCH_4_GO=arm64" >> $GITHUB_ENV
;;
arm|armeb|arm_cortex-a7_neon-vfpv4|arm_cortex-a9|arm_cortex-a8_vfpv3)
echo "ARCH_4_GO=arm" >> $GITHUB_ENV
;;
mips|mips64|mips64el)
echo "ARCH_4_GO=mips" >> $GITHUB_ENV
echo "MIPSFPU=softfloat" >> $GITHUB_ENV
;;
mipsle)
echo "ARCH_4_GO=mipsle" >> $GITHUB_ENV
echo "MIPSFPU=softfloat" >> $GITHUB_ENV
;;
esac

- name: prepare for makefile
run: |
wget -O omniedge.tar.gz https://codeload.github.com/omniedgeio/omniedge-cli/tar.gz/${{ github.ref_name }}?
echo "OMNIEDGE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo "HASH256=$(sh -c 'sha256sum < "$1" | cut -d" " -f1' -- omniedge.tar.gz)" >> $GITHUB_ENV
echo "CROSS_OPENWRT=openwrt" >> $GITHUB_ENV
echo "BUILD_ENV_GIT = ${{env.ENVIRONMENT}}" >> $GITHUB_ENV
rm omniedge.tar.gz

- name: Build Package
run: |
echo "src-link omniedge $GITHUB_WORKSPACE" > openwrt-sdk/feeds.conf
echo 'CONFIG_PACKAGE_omniedge=y
' >> openwrt-sdk/.config
cd openwrt-sdk
cat feeds.conf.default >> feeds.conf
cat feeds.conf
./scripts/feeds update -a > /dev/null
./scripts/feeds install uclibcxx > /dev/null
make defconfig
./scripts/feeds install -d y -f -a
make package/omniedge/compile V=s
tree bin/packages/

- name: Archive package
uses: actions/upload-artifact@v2
with:
name: omniedge-${{ matrix.target.arch }}
path: openwrt-sdk/bin/packages/*/omniedge/omniedge*.ipk
if-no-files-found: error

- name: Upload package to GitHub Release
uses: svenstaro/upload-release-action@v2
if: "startsWith(github.ref, 'refs/tags/')"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
overwrite: true
file: openwrt-sdk/bin/packages/*/omniedge/omniedge*.ipk
tag: ${{ github.ref }}

build-ipk-2:
name: Build - ${{ matrix.target.arch }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- arch: "mips"
sdk: "https://downloads.openwrt.org/releases/19.07.9/targets/ar71xx/generic/openwrt-sdk-19.07.9-ar71xx-generic_gcc-7.5.0_musl.Linux-x86_64.tar.xz"
- arch: "mipsel"
- arch: "mipsle"
sdk: "https://downloads.openwrt.org/releases/22.03.0/targets/ramips/mt7621/openwrt-sdk-22.03.0-ramips-mt7621_gcc-11.2.0_musl.Linux-x86_64.tar.xz"
steps:
- uses: actions/checkout@v2
Expand All @@ -35,7 +142,7 @@ jobs:
wget -O openwrt-sdk.tar.xz ${{ matrix.target.sdk }}
xz -q -d openwrt-sdk.tar.xz && tar -xvf openwrt-sdk.tar
mv -f openwrt-sdk-* openwrt-sdk

- name: download binary
run: |
wget https://github.com/omniedgeio/omniedge/releases/download/${{ github.ref_name }}/omniedge-${{ github.ref_name }}-openwrt-${{ matrix.target.arch }}.zip
Expand Down Expand Up @@ -71,7 +178,7 @@ jobs:

- name: Upload package to GitHub Release
uses: svenstaro/upload-release-action@v2
# if: "startsWith(github.ref, 'refs/tags/')"
if: "startsWith(github.ref, 'refs/tags/')"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/update.yml

This file was deleted.

33 changes: 24 additions & 9 deletions omniedge/Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,57 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=omniedge
PKG_NAME:=omniedge-cli
PKG_VERSION:=$$(OMNIEDGE_VERSION)
PKG_RELEASE:=$(AUTORELEASE)
PKG_ARCH:= $$(ARCH)
PKG_ARCH:= $$(ARCH_4_GO)

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-openwrt-$(PKG_ARCH).zip
PKG_SOURCE_URL:=https://github.com/omniedgeio/omniedge/releases/download/${PKG_VERSION}

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/omniedgeio/omniedge-cli/tar.gz/$(PKG_VERSION)?
PKG_HASH:=$$(HASH256)

PKG_MAINTAINER:=omniedge <[email protected]>
PKG_LICENSE:=GPL-3.0

PKG_BUILD_DEPENDS:=golang/host libpthread
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0

include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk

define Package/omniedge
SECTION:=net
CATEGORY:=Network
SUBMENU:=VPN
TITLE:=Bring intranet on the internet.What happens in intranet, stays in in intranet.
TITLE:=Bring intranet on the internet.
URL:=https://github.com/omniedgeio/omniedge
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +libpthread $(CXX_DEPENDS) +openssl
endef

define Package/omniedge/description
Bring everything into intranet.
endef

define Build/Compile
true
endef

define Build/Configure
true
git clone -b $(PKG_VERSION) https://github.com/omniedgeio/omniedge-cli
cd omniedge-cli && ls && CXX="$(TARGET_CROSS)g++" CC="$(TARGET_CROSS)gcc" CGO_ENABLED=1 GOARCH=$(PKG_ARCH) GOMIPS=$$(MIPSFPU) CROSS_OPENWRT=openwrt BUILD_ENV=$$(BUILD_ENV_GIT) make build
ls omniedge-cli/out
ls $(BUILD_DIR) && cp omniedge-cli/out/omniedge $(BUILD_DIR)/

endef

define Package/omniedge/install

$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(BUILD_DIR)/omniedge $(1)/usr/bin/omniedge

$(INSTALL_DIR) $(1)/etc/init.d/
$(CP) $(CURDIR)/files/omniedge.init $(1)/etc/init.d/omniedge

$(INSTALL_DIR) $(1)/etc/
$(CP) $(CURDIR)/files/omniedge $(1)/etc/
endef

$(eval $(call BuildPackage,omniedge))
33 changes: 24 additions & 9 deletions omniedge/files/omniedge.init
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2015 OpenWrt.org

USE_PROCD=1

START=99
START=10
STOP=15

NAME=omniedge
BIN=/usr/bin/omniedge
AUTH=/etc/omniedge/auth.json
security_key=OMNIEDGE_SECURITY_KEY
virtual_network_id=OMNIEDGE_VIRUTALNETWORK_ID


start_service() {
procd_open_instance
procd_set_param command /bin/sh -c "/usr/bin/$NAME service run"
procd_set_param pidfile /var/run/$NAME.pid
procd_close_instance
start() {
cp /proc/sys/kernel/random/uuid /etc/machine-id
echo start
$BIN login -s $security_key -f $AUTH
sleep 5
$BIN join -n $virtual_network_id -r -f $AUTH &
}

stop() {
echo stop
kill $(pidof omniedge)
}

restart() {
echo restop
stop
start
}
Empty file.
Loading