Initial version of DKMS support.

Worked once, will not work again.  Build occurs, dkms reports that the
build of ./src/oneUpPower.ko failed.  Kernel module is being generated,
but not located anywhere it can be found.
This commit is contained in:
Jeff Curless
2026-01-10 17:53:21 -05:00
parent 4a74ca431d
commit 6c84fd6422
5 changed files with 50 additions and 0 deletions

8
battery/dkms/Makefile Normal file
View File

@@ -0,0 +1,8 @@
obj-m += oneUpPower.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
# Clean:
# make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

10
battery/dkms/dkms.conf Normal file
View File

@@ -0,0 +1,10 @@
PACKAGE_NAME="oneUpPower"
PACKAGE_VERSION="1.0"
MAKE="make -C /lib/modules/$(uname -r)/build M=$PWD/src modules"
CLEAN="make -C /lib/modules/$(uname -r)/build M=$PWD/src clean"
BUILT_MODULE_NAME="oneUpPower"
BUILT_MODULE_LOCATION="./src/"
DEST_MODULE_LOCATION="/kernel/drivers/power/supply/"
AUTOINSTALL="yes"
POST_INSTALL="./postinstall"

10
battery/dkms/postinstall Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
#sudo cp -vf oneUpPower.ko /lib/modules/`uname -r`/kernel/drivers/power/supply/oneUpPower.ko
if ! grep -qF "oneUpPower" /etc/modules
then
sudo sh -c 'echo "oneUpPower" >> /etc/modules'
fi
sudo sh -c 'echo "options oneUpPower soc_shutdown=5" > /etc/modprobe.d/oneUpPower.conf'
sudo depmod -a
sudo insmod oneUpPower.ko
sync