ethtool: rework wakeup handling for WOL devices via udev, thanks to Wintemrute

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-12-31 15:03:30 +01:00
parent a5c79792b1
commit a741c69eb8
2 changed files with 9 additions and 9 deletions

View File

@ -4,3 +4,6 @@
mkdir -p $INSTALL/usr/sbin
cp $PKG_BUILD/ethtool $INSTALL/usr/sbin
mkdir -p $INSTALL/lib/udev/rules.d
cp $PKG_DIR/udev.d/*.rules $INSTALL/lib/udev/rules.d

View File

@ -1,5 +1,3 @@
#!/bin/sh
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
@ -20,12 +18,11 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
# enable WOL on eth0 and eth1
#
# runlevels: openelec, textmode
ACTION!="add|change", GOTO="end"
SUBSYSTEM!="net", GOTO="end"
ENV{INTERFACE}!="eth*", GOTO="end"
. /etc/profile
RUN+="/bin/sh -c 'echo enabled >/sys/class/net/$env{INTERFACE}/device/power/wakeup' "
RUN+="/usr/sbin/ethtool -s $env{INTERFACE} wol g"
progress "enable WOL on eth0 and (maybe) eth1"
/usr/sbin/ethtool -s eth0 wol g > /dev/null 2>&1 &
/usr/sbin/ethtool -s eth1 wol g > /dev/null 2>&1 &
LABEL="end"