From 7f5e8d1515667d96cbfd2016110499b060770561 Mon Sep 17 00:00:00 2001 From: Ritesh Raj Sarraf Date: Thu, 17 Apr 2014 15:24:53 +0530 Subject: [PATCH 1/4] Fix path for enable / disable ethernet device + [ x1 = x1 ] + [ -x /usr/bin/logger -a VERBOSE != STATUS ] + [ VERBOSE = MSG ] + [ VERBOSE = ERR ] + [ VERBOSE = VERBOSE ] + [ x0 = x1 ] + [ VERBOSE = VERBOSE ] + [ 1 = 0 ] + [ -z /sys/devices/pci0000:00/0000:00:19.0 ] + [ -f /sys/devices/pci0000:00/0000:00:19.0/enabled ] + [ x1 = x1 ] + [ -f /sys/devices/pci0000:00/0000:00:19.0/enabled ] + echo 0 sh: echo: I/O error + log VERBOSE ethernet: Disabling ethernet device eth0 + [ x1 = x1 ] + [ -x /usr/bin/logger -a VERBOSE != STATUS ] + [ VERBOSE = MSG ] + [ VERBOSE = ERR ] For some reason, I/O error is seen when writing to the file. This seems to be a cosmetic timing issue because irrespective of the error, the values are written to the file, and changes are effective. It could very well be a timing issue because the ethernet device is a PCI device too, which is also handle in Runtime PM --- usr/share/laptop-mode-tools/modules/ethernet | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr/share/laptop-mode-tools/modules/ethernet b/usr/share/laptop-mode-tools/modules/ethernet index 6fd06e2..0b31775 100755 --- a/usr/share/laptop-mode-tools/modules/ethernet +++ b/usr/share/laptop-mode-tools/modules/ethernet @@ -63,16 +63,16 @@ if [ x$CONTROL_ETHERNET = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_ETHE fi fi - if ! [ -z $dev_path ] && [ -f $dev_path/enable ]; then + if ! [ -z $dev_path ] && [ -f $dev_path/enabled ]; then if [ x$DISABLE_ETHERNET = x1 ]; then - if [ -f $dev_path/enable ]; then - echo 0 > $dev_path/enable + if [ -f $dev_path/enabled ]; then + echo 0 > $dev_path/enabled 2>/dev/null log "VERBOSE" "ethernet: Disabling ethernet device $DEVICE" DISABLED=1 fi elif [ x$DISABLE_ETHERNET = x0 ]; then - if [ -f $dev_path/enable ]; then - echo 1 > $dev_path/enable + if [ -f $dev_path/enabled ]; then + echo 1 > $dev_path/enabled 2>/dev/null log "VERBOSE" "ethernet: Re-enabling ethernet device $DEVICE" DISABLED=0 fi -- 1.8.5.5