Skip to content

Commit

Permalink
v9.8
Browse files Browse the repository at this point in the history
- NanoPi R5S/R5C | Resolved an issue where the Ethernet LEDs did not work on systems upgraded from the legacy Linux 5.10 kernel. Many thanks to `@innovodev` for reporting this issue: https://dietpi.com/forum/t/21026
  • Loading branch information
MichaIng committed Sep 5, 2024
1 parent 20576fd commit e7131f8
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
51 changes: 50 additions & 1 deletion .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ _EOF_
[[ $(</proc/device-tree/model) == *'R5C'* ]] 2> /dev/null && model='R5C'
G_DIETPI-NOTIFY 2 "Updating udev rule for NanoPi $model Ethernet LEDs"
G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf'
if [[ $model == 'R6S' ]]
if [[ $model == 'R5S' ]]
then
cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules
SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0"
Expand Down Expand Up @@ -1961,6 +1961,55 @@ Patch_9_7()
fi
}

Patch_9_8()
{
# NanoPi R5S/R5C
if (( $G_HW_MODEL == 76 )) && ! dpkg-query -s 'firmware-nanopi5' &> /dev/null
then
local model='R5S'
[[ $(</proc/device-tree/model) == *'R5C'* ]] 2> /dev/null && model='R5C'
G_DIETPI-NOTIFY 2 "Updating udev rule for NanoPi $model Ethernet LEDs"
G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf'
if [[ $model == 'R5S' ]]
then
cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules
SUBSYSTEM=="leds", KERNEL=="green:lan-1", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0"
SUBSYSTEM=="leds", KERNEL=="green:lan-2", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1"
SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth2", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth2", RUN+="/bin/ip l s down dev eth2"
_EOF_
else
cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules
SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0"
SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1"
SUBSYSTEM=="leds", KERNEL=="green:wlan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="wlan0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev wlan0", RUN+="/bin/ip l s down dev wlan0"
_EOF_
fi

# NanoPi R6S/R6C
elif (( $G_HW_MODEL == 79 )) && ! dpkg-query -s 'firmware-nanopi6' &> /dev/null
then
local model='R6S'
[[ $(</proc/device-tree/model) == *'R6C'* ]] 2> /dev/null && model='R6C'
G_DIETPI-NOTIFY 2 "Updating udev rule for NanoPi $model Ethernet LEDs"
G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf'
if [[ $model == 'R6S' ]]
then
cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules
SUBSYSTEM=="leds", KERNEL=="lan2_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0"
SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1"
SUBSYSTEM=="leds", KERNEL=="lan1_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth2", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1"
_EOF_
elif [[ $model == 'R6C' ]]
then
cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules
SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0"
SUBSYSTEM=="leds", KERNEL=="lan1_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1"
SUBSYSTEM=="leds", KERNEL=="user_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="wlan0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev wlan0", RUN+="/bin/ip l s down dev wlan0"
_EOF_
fi
fi
}

# v6.35 => v7 migration
if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 ))
then
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Enhancements:

Bug fixes:
- NanoPi M3/T3 | Resolved an issue where our recent image did not boot because the bootloader did not define a default device tree path anymore. Many thanks to @rozcietrzewiacz for reporting this issue: https://github.com/MichaIng/DietPi/issues/2630#issuecomment-2322085507
- NanoPi R5S/R5C | Resolved an issue where the Ethernet LEDs did not work on systems upgraded from the legacy Linux 5.10 kernel. Many thanks to @innovodev for reporting this issue: https://dietpi.com/forum/t/21026
- DietPi-Config | Resolved an issue where username and password in proxy settings could not be cleared, since the inputbox kept asking for an non-empty input. Many thanks to @dipisoft for reporting this issue: https://github.com/MichaIng/DietPi/issues/7211
- DietPi-Software | NoMachine: Resolved an issue where the installation failed due to an outdated download URL. Many thanks to @tzvi208 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7198

Expand Down

0 comments on commit e7131f8

Please sign in to comment.