recover_duts: spruce up reload_network_device

There's a lot of problems in this file

 * it's no longer used in a udev rule [1] -- it's only used in test images,
   for the 'check_ethernet' hook used in the lab; so remove some of the
   udev cruft
 * it isn't very nice for interactive use (most of its errors go only to
   syslog; it doesn't give clear expectations about its args)
 * it tries to control wlan power, if used on a wlan device; this will
   fail on a lot of devices, which means you'll be stuck (we already
   removed the driver module at this point, and 'set -e' means we fail
   hard). That's not even verified or recommended even on those devices
   where it may work. So stop doing it.
 * not all drivers are modules

This cleans up most of that.

Currently, check_ethernet.hook only calls this for ethernet devices. Now
it is safe(r) to use on wlan devices too.


TEST=`reload_network_device`, with {lo,eth0,wlan0} args, and without

Change-Id: I61dcff44e3293b1d4fc9ff29ed21fe42cd3d344d
Signed-off-by: Brian Norris <>
Commit-Ready: ChromeOS CL Exonerator Bot <>
Reviewed-by: Grant Grundler <>
1 file changed