diff --git a/system_files/deck/shared/usr/etc/device-quirks/systemd-suspend-mods.conf b/system_files/deck/shared/usr/etc/device-quirks/systemd-suspend-mods.conf new file mode 100644 index 0000000000..9a7e7794f1 --- /dev/null +++ b/system_files/deck/shared/usr/etc/device-quirks/systemd-suspend-mods.conf @@ -0,0 +1,2 @@ +# Line separated list of modules to unload/reload at suspend/resume. +mt7921e diff --git a/system_files/deck/shared/usr/lib/systemd/system-sleep/systemd-suspend-mods.sh b/system_files/deck/shared/usr/lib/systemd/system-sleep/systemd-suspend-mods.sh new file mode 100755 index 0000000000..ad584fbcd6 --- /dev/null +++ b/system_files/deck/shared/usr/lib/systemd/system-sleep/systemd-suspend-mods.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# This file runs during sleep/resume events. It will read the list of modules +# in /etc/device-quirks/systemd-suspend-mods.conf and rmmod them on suspend, +# insmod them on resume. +# Originally created by ChimeraOS + +MOD_LIST=$(grep -v ^\# /etc/device-quirks/systemd-suspend-mods.conf) + +case $1 in + pre) + for mod in $MOD_LIST; do + modprobe -r $mod + done + ;; + post) + for mod in $MOD_LIST; do + modprobe $mod + done + ;; +esac