This commit is contained in:
lean 2021-04-28 17:45:47 +08:00
commit 910af7e482
5 changed files with 34 additions and 26 deletions

View File

@ -20,6 +20,10 @@ PKG_MIRROR_HASH:=815410a7c348c82eea638f6d34fd4dfab59286e16b172c434ff0008de24676d
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_CONFIG_DEPENDS:= \
CONFIG_BAIDUPCS_WEB_COMPRESS_GOPROXY \
CONFIG_BAIDUPCS_WEB_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
@ -43,6 +47,21 @@ define Package/$(PKG_NAME)/description
BaiduPCS-Web is a web controller for BaiduPCS-Go
endef
define Package/$(PKG_NAME)/config
config BAIDUPCS_WEB_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config BAIDUPCS_WEB_COMPRESS_UPX
bool "Compress executable files with UPX"
default y
endef
ifeq ($(CONFIG_BAIDUPCS_WEB_COMPRESS_GOPROXY),y)
export GO111MODULE=on
export GOPROXY=https://goproxy.baidu.com
endif
define Build/Compile
( \
GOOS=$$$$(go env GOOS) GOARCH=$$$$(go env GOARCH) go get -v github.com/GeertJohan/go.rice/rice/... ; \
@ -50,7 +69,9 @@ define Build/Compile
"$$$$(go env GOPATH)/bin/rice" embed-go ; \
)
$(call GoPackage/Build/Compile)
ifeq ($(CONFIG_BAIDUPCS_WEB_COMPRESS_UPX),y)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/BaiduPCS-Go
endif
endef
define Package/$(PKG_NAME)/install

View File

@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621.dtsi"
@ -8,7 +9,7 @@
/ {
compatible = "xiaomi,mi-router-cr6606", "mediatek,mt7621-soc";
model = "Xiaomi Mi Router CR6606";
aliases {
led-boot = &led_sys_yellow;
led-failsafe = &led_sys_yellow;
@ -25,22 +26,22 @@
compatible = "gpio-leds";
led_sys_yellow: sys_yellow {
label = "yellow:sys";
label = "mi-router-cr6606:yellow:sys";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
};
led_sys_blue: sys_blue {
label = "blue:sys";
label = "mi-router-cr6606:blue:sys";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
net_yellow {
label = "yellow:net";
label = "mi-router-cr6606:yellow:net";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
};
net_blue {
label = "blue:net";
label = "mi-router-cr6606:blue:net";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};
};
@ -127,7 +128,7 @@
partition@7000000 {
label = "obr";
reg = <0x7000000 0x1000000>;
read-only;
read-only;
};
};
};
@ -184,4 +185,4 @@
groups = "jtag", "uart3", "wdt";
function = "gpio";
};
};
};

View File

@ -1065,8 +1065,6 @@ define Device/xiaomi_mir4
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router 4
SUPPORTED_DEVICES += R4
SUPPORTED_DEVICES += mir4
DEVICE_PACKAGES := kmod-mt7603e kmod-mt76x2e luci-app-mtwifi uboot-envtools
endef
TARGET_DEVICES += xiaomi_mir4
@ -1094,29 +1092,18 @@ endef
TARGET_DEVICES += xiaomi_mi-router-ac2100
define Device/xiaomi_mi-router-cr6606
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router CR6606
DEVICE_ALT0_VENDOR := Xiaomi
DEVICE_ALT0_MODEL := Mi Router CR6606
DEVICE_ALT0_VARIANT := China Unicom
DEVICE_ALT1_VENDOR := Xiaomi
DEVICE_ALT1_MODEL := Mi Router CR6608
DEVICE_ALT1_VARIANT := China Mobile
DEVICE_ALT2_VENDOR := Xiaomi
DEVICE_ALT2_MODEL := Mi Router CR6609
DEVICE_ALT2_VARIANT := China Telecom
BLOCKSIZE := 128k
PAGESIZE := 2048
UBINIZE_OPTS := -E 5
IMAGE_SIZE := 51200k
IMAGES += firmware.bin overlay.bin
IMAGE/firmware.bin := append-kernel | pad-to 128k | append-rootfs | \
pad-rootfs
IMAGE/firmware.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs
IMAGE/overlay.bin := append-ubi | check-size
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES += uboot-envtools kmod-mt7915e
DEVICE_VENDOR := Xiaomi
DEVICE_MODEL := Mi Router CR6606
DEVICE_PACKAGES += uboot-envtools kmod-mt7915e wpad-openssl
endef
TARGET_DEVICES += xiaomi_mi-router-cr6606

View File

@ -95,7 +95,7 @@ xiaomi,mi-router-ac2100)
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x1"
;;
xiaomi,mi-router-cr6606)
ucidef_set_led_netdev "internet" "internet" "blue:net" "wan"
ucidef_set_led_netdev "internet" "internet" "mi-router-cr6606:blue:net" "wan"
;;
xiaomi,redmi-router-ac2100)
ucidef_set_led_switch "wan" "wan" "$boardname:white:wan" "switch0" "0x1"

View File

@ -90,7 +90,6 @@ ramips_setup_interfaces()
ucidef_set_interface_lan "eth0.1 ra0 rai0"
;;
xiaomi,mi-router-ac2100|\
xiaomi,mi-router-cr6606|\
xiaomi,redmi-router-ac2100)
ucidef_add_switch "switch0" \
"0:wan" "2:lan:1" "3:lan:2" "4:lan:3" "6@eth0"