Skip to content

Commit

Permalink
align patches
Browse files Browse the repository at this point in the history
  • Loading branch information
anaelorlinski committed Sep 17, 2022
1 parent 7dd2289 commit 96b8b50
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Automated builds of OpenWrt for FriendlyARM NanoPi R2S & R4S boards

[![NanoPi Build](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/actions/workflows/NanoPi-Build.yml/badge.svg)](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/actions/workflows/NanoPi-Build.yml)

## OpenWrt branch 22.03 (WIP)
## OpenWrt branch 22.03 (stable)

[Download 22.03 Releases](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/releases?q=OpenWrtAO-22.03&expanded=true) [Changelog](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/openwrt-22.03/release-info.md)

## OpenWrt branch 21.02 (stable)
## OpenWrt branch 21.02 (EOL)

[Download 21.02 Releases](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/releases?q=OpenWrtAO-21.02&expanded=true) [Changelog](https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/blob/main/openwrt-21.02/release-info.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,36 @@ rockchip_setup_interfaces()
esac
}

nanopi_r2s_generate_mac()
generate_mac_from_mmc_cid()
{
local sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid)
local mmc_dev=$1

local sd_hash=$(sha256sum /sys/class/block/$mmc_dev/device/cid)
local mac_base=$(macaddr_canonicalize "$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)")
echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")"
}

nanopi_r4s_get_mac()
{
local interface=$1
local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
local address

if [ -f "$eeprom_path" ]; then
address=$(get_mac_binary "$eeprom_path" 0xfa)
if [ "$interface" = "lan" ]; then
address=$(macaddr_setbit_la "$address")
fi
else
address=$(generate_mac_from_mmc_cid mmcblk1)
if [ "$interface" = "lan" ]; then
address=$(macaddr_add "$address" 1)
fi
fi

echo "$address"
}

rockchip_setup_macs()
{
local board="$1"
Expand All @@ -35,12 +58,12 @@ rockchip_setup_macs()
case "$board" in
friendlyarm,nanopi-r2c|\
friendlyarm,nanopi-r2s)
wan_mac=$(nanopi_r2s_generate_mac)
wan_mac=$(generate_mac_from_mmc_cid mmcblk0)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
friendlyarm,nanopi-r4s)
wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa)
lan_mac=$(macaddr_setbit_la "$wan_mac")
wan_mac=$(nanopi_r4s_get_mac wan)
lan_mac=$(nanopi_r4s_get_mac lan)
;;
esac

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,4 @@ Signed-off-by: David Bauer <[email protected]>
chosen {
stdout-path = "serial2:1500000n8";
};
--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
@@ -19,6 +19,13 @@
model = "FriendlyElec NanoPi R4S";
compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399";

+ aliases {
+ led-boot = &sys_led;
+ led-failsafe = &sys_led;
+ led-running = &sys_led;
+ led-upgrade = &sys_led;
+ };
+
/delete-node/ display-subsystem;

gpio-leds {

1 change: 1 addition & 0 deletions openwrt-22.03/release-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- pbr latest version from https://github.com/stangri/source.openwrt.melmac.net

### Changelog
- [2022-09-17] Align patches / Haproxy 2.6.5
- [2022-08-30] Add qosify
- [2022-08-25] Update U-Boot to 2022.07 (only tested on R4S 4GB)
- [2022-08-25] Backport Packages from master
Expand Down

0 comments on commit 96b8b50

Please sign in to comment.