Skip to content

Instantly share code, notes, and snippets.

@ammgws
Created July 23, 2017 16:32
Show Gist options
  • Select an option

  • Save ammgws/ce229a6cdd4657e381cde11363eb6e4d to your computer and use it in GitHub Desktop.

Select an option

Save ammgws/ce229a6cdd4657e381cde11363eb6e4d to your computer and use it in GitHub Desktop.
re-enable WOL for atheros (alx) driver

Use the script from here.

automatic dkms module installer for patched alx

This is a quick and dirty setup that will automatically setup the dkms module for your specific kernel version.
This will only work on debian/ubuntu and other derivates and requires dkms and patch to be setup already.

The setup uses sudo and thus you are asked for your password once.
It will then attempt to download your kernels source, copy and patch the alx related files and place a "alx-" in your /usr/src directory, enable and compile the module and finally rebuild your initrd.
Currently the the very first compilation somehow fails, thats why it's run twice.

The last lines of output should look like this:

...
DKMS: build completed.

alx.ko:
Running module version sanity check.
 - Original module
 - Installation
   - Installing to /lib/modules/4.2.0-27-generic/updates/dkms/

depmod....

DKMS: install completed.
update-initramfs: Generating /boot/initrd.img-4.2.0-27-generic

Note: may need to manually run sudo update-initramfs -u if the script doesn't do it.

@ammgws
Copy link
Author

ammgws commented Oct 16, 2021

Possibly not needed anymore?

https://bugzilla.kernel.org/show_bug.cgi?id=61651#c158

I didn't see this mentioned, so I wanted to point out that the Ubuntu kernel has the WoL feature enabled behind a module parameter (off by default). You can run the following to see the value:
cat /sys/module/alx/parameters/enable_wol

'N' = off, 'Y' = on

To turn it on, you just need to add:
options alx enable_wol=Y

to modeprobe. For example, by running:
sudo bash -c 'echo options alx enable_wol=Y > /etc/modprobe.d/alx.conf'

You can then test this by running:
sudo bash -c 'modprobe -r alx && modprobe alx' &&
cat /sys/module/alx/parameters/enable_wol

Finally, to ensure the modprobe config change is present during startup, update your initramfs with:
sudo update-initramfs -u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment