ndsvw,
@ndsvw@feddit.de avatar

I know that it’s a hack. A really bad hack TBH.

But I wasn’t able to get it working differently.

This is the service code I’m using (yes, I know… It’s very bad, especially the pinging):


<span style="color:#323232;">while :
</span><span style="color:#323232;">do
</span><span style="color:#323232;">	if [[ $(ping 192.168.178.1 -c 3) ]]
</span><span style="color:#323232;">	then
</span><span style="color:#323232;">		echo "pinged"
</span><span style="color:#323232;">	else
</span><span style="color:#323232;">		if [[ $(lsmod | grep brcmfmac) ]]
</span><span style="color:#323232;">		then
</span><span style="color:#323232;">			sudo rmmod brcmfmac
</span><span style="color:#323232;">		fi
</span><span style="color:#323232;">		sudo modprobe brcmfmac
</span><span style="color:#323232;">		sleep 250
</span><span style="color:#323232;">	fi
</span><span style="color:#323232;">	sleep 15
</span><span style="color:#323232;">
</span><span style="color:#323232;">done
</span>

When closing and opening my MacBook, it’s necessary to execute sudo rmmod brcmfmac and then sudo modprobe brcmfmac. Only executing the 2nd command is not enough.


@MonkderZweite

Your first 2 paths under /etc have a description like this:

kernel modules to load at boot time.

The problem I’m having is that I have to reload the module when the laptop was closed and reopened.

So, I think, the first 2 paths won’t work, right? It’s not boot time?


Something like the 2nd path was described in a tutorial about getting started on a MacBook with Linux. I remember it.

But the path you described does not exist on my system.

I have a path /usr/lib/systemd/system-sleep/, do you mean that one?

This contains 1 file (probably created by me in the beginning) called lid_wakeup_disable:


<span style="color:#323232;"> #!/bin/sh
</span><span style="color:#323232;">
</span><span style="color:#323232;"># /lib/systemd/system-sleep/lid_wakeup_disable
</span><span style="color:#323232;">#
</span><span style="color:#323232;"># Avoids that system wakes up immediately after suspend or hibernate
</span><span style="color:#323232;"># with lid open (e.g. suspend/hibernate through KDE menu entry)
</span><span style="color:#323232;">#
</span><span style="color:#323232;"># Tested on MacBookPro12,1
</span><span style="color:#323232;">
</span><span style="color:#323232;">case $1 in
</span><span style="color:#323232;">  pre)
</span><span style="color:#323232;">    if cat /proc/acpi/wakeup | grep -qE '^LID0.*enabled'; then
</span><span style="color:#323232;">        echo LID0 > /proc/acpi/wakeup
</span><span style="color:#323232;">    fi
</span><span style="color:#323232;">    ;;
</span><span style="color:#323232;">esac
</span><span style="color:#323232;">
</span>

Do I add rmmod brcmfmac; modprobe brcmfmac; (without sudo) at the bottom?

I’m thankful for any help to get rid of the service.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #