From 96b8b502df55cb22c917dcd24afdcec0874d3e84 Mon Sep 17 00:00:00 2001 From: anaelorlinski Date: Sat, 17 Sep 2022 12:59:15 +0200 Subject: [PATCH] align patches --- README.md | 4 +-- .../armv8/base-files/etc/board.d/02_network | 33 ++++++++++++++++--- ...chip-use-system-LED-for-OpenWrt-r2s.patch} | 17 +--------- openwrt-22.03/release-info.md | 1 + 4 files changed, 32 insertions(+), 23 deletions(-) rename openwrt-22.03/patches/target/linux/rockchip/patches-5.10/{100-rockchip-use-system-LED-for-OpenWrt.patch => 100-rockchip-use-system-LED-for-OpenWrt-r2s.patch} (70%) diff --git a/README.md b/README.md index 3c8b381..97dbbd9 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/openwrt-22.03/patches/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/openwrt-22.03/patches/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index 250a55a..6cd2de3 100644 --- a/openwrt-22.03/patches/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/openwrt-22.03/patches/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -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" @@ -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 diff --git a/openwrt-22.03/patches/target/linux/rockchip/patches-5.10/100-rockchip-use-system-LED-for-OpenWrt.patch b/openwrt-22.03/patches/target/linux/rockchip/patches-5.10/100-rockchip-use-system-LED-for-OpenWrt-r2s.patch similarity index 70% rename from openwrt-22.03/patches/target/linux/rockchip/patches-5.10/100-rockchip-use-system-LED-for-OpenWrt.patch rename to openwrt-22.03/patches/target/linux/rockchip/patches-5.10/100-rockchip-use-system-LED-for-OpenWrt-r2s.patch index d0860de..29aa285 100644 --- a/openwrt-22.03/patches/target/linux/rockchip/patches-5.10/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/openwrt-22.03/patches/target/linux/rockchip/patches-5.10/100-rockchip-use-system-LED-for-OpenWrt-r2s.patch @@ -29,19 +29,4 @@ Signed-off-by: David Bauer 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 { + diff --git a/openwrt-22.03/release-info.md b/openwrt-22.03/release-info.md index 7a8d9fc..f9beb7a 100644 --- a/openwrt-22.03/release-info.md +++ b/openwrt-22.03/release-info.md @@ -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