This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipq806x: add support for ruijie_rg-mtfi-m520 (#3025)
Signed-off-by: AmadeusGhost <[email protected]>
- Loading branch information
Showing
15 changed files
with
1,530 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
. /lib/functions.sh | ||
|
||
preinit_set_mac_address() { | ||
case $(board_name) in | ||
ruijie,rg-mtfi-m520) | ||
base_mac=$(mtd_get_mac_ascii PRODUCTINFO ethaddr) | ||
ip link set dev eth0 address $(macaddr_add "$base_mac" +1) | ||
ip link set dev eth1 address $(macaddr_add "$base_mac" +2) | ||
;; | ||
esac | ||
} | ||
|
||
boot_hook_add preinit_main preinit_set_mac_address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# | ||
# Copyright (C) 2016 lede-project.org | ||
# Copyright (C) 2020 AnYun | ||
# | ||
|
||
ruijie_do_flash() { | ||
local tar_file=$1 | ||
local kernel=$2 | ||
local rootfs=$3 | ||
|
||
# keep sure its unbound | ||
losetup --detach-all || { | ||
echo Failed to detach all loop devices. Skip this try. | ||
reboot -f | ||
} | ||
|
||
# use the first found directory in the tar archive | ||
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') | ||
board_dir=${board_dir%/} | ||
|
||
echo "flashing kernel to $kernel" | ||
tar xf $tar_file ${board_dir}/kernel -O > $kernel | ||
|
||
echo "flashing rootfs to $rootfs" | ||
tar xf $tar_file ${board_dir}/root -O > $rootfs | ||
|
||
# Cleanup | ||
losetup -d /dev/loop0 >/dev/null 2>&1 | ||
sync | ||
umount -a | ||
reboot -f | ||
} | ||
|
||
ruijie_do_upgrade() { | ||
local tar_file="$1" | ||
local board=$(board_name) | ||
local kernel= | ||
local rootfs= | ||
|
||
case "$board" in | ||
ruijie,rg-mtfi-m520) | ||
kernel="/dev/mmcblk0p2" | ||
rootfs="/dev/mmcblk0p3" | ||
;; | ||
*) | ||
return 1 | ||
;; | ||
esac | ||
|
||
ruijie_do_flash $tar_file $kernel $rootfs | ||
|
||
return 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
CONFIG_AHCI_IPQ=y | ||
CONFIG_ALIGNMENT_TRAP=y | ||
# CONFIG_AMBA_PL08X is not set | ||
# CONFIG_APQ_GCC_8084 is not set | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
CONFIG_AHCI_IPQ=y | ||
CONFIG_ALIGNMENT_TRAP=y | ||
# CONFIG_APQ_GCC_8084 is not set | ||
# CONFIG_APQ_MMCC_8084 is not set | ||
|
Oops, something went wrong.