1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-11-30 14:59:43 +01:00
nixos-hardware/dell/inspiron/5515/fix_touchpad.sh

27 lines
404 B
Bash
Raw Normal View History

2021-12-27 13:00:00 +01:00
#!/bin/sh
set -eux
unload () {
if modprobe -r "$1" 2>&1;
then echo ok
else echo fail
fi
}
wait_unload() {
while sleep 1; do
output="$(unload "$1")"
case "$output" in
2021-12-27 13:00:00 +01:00
*is\ in\ use*) :;;
*ok*) return 0;;
*) echo "modprobe said: $output"; echo giving up; return 1;
2021-12-27 13:00:00 +01:00
esac
done
}
wait_unload i2c_hid_acpi
wait_unload i2c_hid
modprobe i2c_hid
modprobe i2c_hid_acpi