Skip to content

Commit 0815eae

Browse files
author
Milan Paessler
committed
adding mi-router-4a-gigabit patch
1 parent a50e071 commit 0815eae

File tree

5 files changed

+108
-2
lines changed

5 files changed

+108
-2
lines changed

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ build_images_for_site ()
163163
# append_quoted_arg ARGS BUILD_LOG "1"
164164

165165
# Setting GLUON_BRANCH enables the firmware autoupdater.
166-
append_quoted_arg ARGS GLUON AUTOUPDATER_ENABLED=1 GLUON_AUTOUPDATER_BRANCH "$RELBRANCH"
166+
append_quoted_arg ARGS GLUON AUTOUPDATER_ENABLED=1
167+
append_quoted_arg ARGS GLUON_AUTOUPDATER_BRANCH "$RELBRANCH"
167168

168169
# Parameters for setting buildbot signatures
169170
local SIGN_ARGS=""
@@ -186,7 +187,7 @@ build_images_for_site ()
186187
if [[ "$PREPARED_CONTENTS" != "$TEMPLATE_NAME" ]]; then
187188

188189
rm -rf .git/rebase-apply
189-
git reset --hard origin/$GLUONBRANCH
190+
# git reset --hard origin/$GLUONBRANCH
190191

191192
for (( target_index=0; target_index < ${#TARGETS[@]}; target_index += 1 )); do
192193
TARGET="${TARGETS[target_index]}"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/targets/ramips-mt7621 b/targets/ramips-mt7621
2+
index 978eb619..2d159ed2 100644
3+
--- a/targets/ramips-mt7621
4+
+++ b/targets/ramips-mt7621
5+
@@ -25,6 +25,12 @@ device('netgear-wndr3700v5', 'wndr3700v5', {
6+
broken = true, -- untested
7+
})
8+
9+
+-- Xiaomi
10+
+
11+
+device('xiaomi-mi-router-4a-gigabit-edition', 'xiaomi_mi-router-4a-gigabit', {
12+
+ factory = false,
13+
+})
14+
+
15+
16+
-- ZBT
17+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
2+
index 8ca1831afe..24b895c92b 100755
3+
--- a/target/linux/ramips/base-files/etc/board.d/02_network
4+
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
5+
@@ -310,7 +310,8 @@ ramips_setup_interfaces()
6+
ucidef_add_switch "switch0" \
7+
"4:lan" "6t@eth0"
8+
;;
9+
- cudy,wr1000)
10+
+ cudy,wr1000|\
11+
+ xiaomi,mi-router-4a-gigabit)
12+
ucidef_add_switch "switch0" \
13+
"2:lan:2" "3:lan:1" "4:wan" "6@eth0"
14+
;;
15+
@@ -687,6 +688,10 @@ ramips_setup_macs()
16+
xiaomi,mir3p)
17+
lan_mac=$(mtd_get_mac_binary Factory 0xe006)
18+
;;
19+
+ xiaomi,mi-router-4a-gigabit)
20+
+ wan_mac=$(mtd_get_mac_binary factory 0xe006)
21+
+ label_mac=$wan_mac
22+
+ ;;
23+
zyxel,keenetic-start)
24+
wan_mac=$(mtd_get_mac_binary factory 40)
25+
;;
26+
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
27+
index 28ae0d451f..084c03b2a9 100644
28+
--- a/target/linux/ramips/image/mt7621.mk
29+
+++ b/target/linux/ramips/image/mt7621.mk
30+
@@ -60,6 +60,14 @@ define Build/wr1201-factory-header
31+
mv $@.new $@
32+
endef
33+
34+
+define Build/mi-router-4a-gigabit-factory-header
35+
+ mkimage -A $(LINUX_KARCH) \
36+
+ -O linux -T kernel \
37+
+ -C lzma -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
38+
+ -n 'R4A' -d $@ $@.new
39+
+ mv $@.new $@
40+
+endef
41+
+
42+
define Build/netis-tail
43+
echo -n $(1) >> $@
44+
echo -n $(UIMAGE_NAME)-yun | $(STAGING_DIR_HOST)/bin/mkhash md5 | \
45+
@@ -298,6 +306,18 @@ define Device/xiaomi_mir3g
46+
endef
47+
TARGET_DEVICES += xiaomi_mir3g
48+
49+
+define Device/xiaomi_mi-router-4a-gigabit
50+
+ DTS := XIAOMI-MIR4A-GIGABIT
51+
+ MTK_SOC := mt7621
52+
+ IMAGE_SIZE := 14848k
53+
+ DEVICE_VENDOR := Xiaomi
54+
+ DEVICE_TITLE := Xiaomi Mi Router 4A Gigabit Edition
55+
+ DEVICE_VARIANT := Gigabit Edition
56+
+ DEVICE_MODEL := Mi Router 4A
57+
+ DEVICE_PACKAGES := kmod-mt7603-compat kmod-mt76x2-compat wpad-basic uboot-envtools
58+
+endef
59+
+TARGET_DEVICES += xiaomi_mi-router-4a-gigabit
60+
+
61+
define Device/mt7621
62+
DTS := MT7621
63+
BLOCKSIZE := 64k
64+
@@ -384,6 +404,7 @@ define Device/netgear_r6350
65+
IMAGE/kernel.bin := append-kernel
66+
IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
67+
DEVICE_TITLE := Netgear R6350
68+
+ DEVICE_MODEL := netgear_r6350
69+
DEVICE_PACKAGES := \
70+
kmod-mt7603 kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
71+
endef
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
echo $PWD
3+
4+
patchfile="../patches/add-mi-router-4a-gigabit-gluon.patch"
5+
if ! patch -R -p1 -s -f --ignore-whitespace --dry-run <$patchfile &>/dev/null; then
6+
patch -p1 --ignore-whitespace <$patchfile
7+
fi
8+
grep 'mi-router-4a-gigabit' targets/ramips-mt7621
9+
10+
cd openwrt
11+
patchfile="../patches/add-mi-router-4a-gigabit-openwrt.patch"
12+
if ! patch -R -p1 -s -f --ignore-whitespace --dry-run <$patchfile &>/dev/null; then
13+
patch -p1 --ignore-whitespace <$patchfile
14+
fi
15+
grep 'mi-router-4a-gigabit' target/linux/ramips/image/mt7621.mk
16+

templates/13_dusfl-key/prepare.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#pushd ../gluon ; ../patches/add-TPlinkArcherA7V5.sh; popd # adding TP-Link Archer A7-V5
1212
#pushd ../gluon ; ../patches/kernelswapon.sh; popd # enable swap for all
1313
#pushd ../gluon ; ../patches/ignore-preservechannels-for-outdoormode.sh ; popd # correct handling of outdoor-devices (enable auto-channel)
14+
pushd ../gluon ; ../patches/add-mi-router-4a-gigabit.sh; popd # adding Xiaomi -mi-router-4a-gigabit edition
1415

1516
exit 0;
1617

0 commit comments

Comments
 (0)