Radxa-e52c. Device NIC port rename to match device labels and network LED config via radxa-e52c.conf (#8633)

* Add_to_radxa-e52c.conf

1. Add a network rule to rename interfaces to match device port labeling (wan,lan)

2. Add network activity LEDs config for wan and lan for radxa-e52c

* Update config/boards/radxa-e52c.conf

Coderabbitai suggested clean-up of function name.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update radxa-e52c.conf - fix typo.

* Update radxa-e52c.conf - fix function consistency

As recommended by  EvilOlaf

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
schwar3kat
2025-09-18 01:50:32 +12:00
committed by GitHub
parent 9d0ed58bb0
commit 4372e7da29

View File

@@ -8,3 +8,45 @@ BOOT_FDT_FILE="rockchip/rk3588s-radxa-e52c.dtb"
BOOT_SCENARIO="spl-blobs" BOOT_SCENARIO="spl-blobs"
BOOT_SOC="rk3588" BOOT_SOC="rk3588"
IMAGE_PARTITION_TABLE="gpt" IMAGE_PARTITION_TABLE="gpt"
function post_family_tweaks_bsp__radxa_e52c_enable_leds() {
display_alert "Creating board support LEDs config for radxa-e52c."
cat <<- EOF > "${destination}"/etc/armbian-leds.conf
[/sys/class/leds/lan-led]
trigger=netdev
interval=52
brightness=1
link=1
tx=0
rx=1
device_name=lan
[/sys/class/leds/wan-led]
trigger=netdev
interval=52
brightness=1
link=1
tx=0
rx=1
device_name=wan
[/sys/class/leds/mmc0::]
trigger=mmc0
brightness=0
[/sys/class/leds/sys-led]
trigger=heartbeat
brightness=0
invert=0
EOF
# add a network rule to rename interfaces to match device labeling.
display_alert "Creating board support network rename rule to rename interfaces to match device labeling for radxa-e52c"
mkdir -p "${destination}"/etc/udev/rules.d/
cat <<- EOF > "${destination}"/etc/udev/rules.d/70-rename-lan.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="enP3p49s0", NAME="wan"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="enP4p65s0", NAME="lan"
EOF
}