From 67422cc5bd3e2a897e6fea0258d126f8e08e8c9b Mon Sep 17 00:00:00 2001 From: Adam Madsen Date: Tue, 10 Nov 2020 13:00:04 -0600 Subject: [PATCH] Log when hooks are installed, set install_hook=y by default --- dkms.conf | 2 +- src/vendor-reset.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dkms.conf b/dkms.conf index b14fc92..3a11b0b 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="vendor-reset" -PACKAGE_VERSION="0.0.4" +PACKAGE_VERSION="0.0.5" BUILT_MODULE_NAME[0]="${PACKAGE_NAME}" MAKE[0]="make KDIR=${kernel_source_dir}" CLEAN="make KDIR=${kernel_source_dir} clean" diff --git a/src/vendor-reset.c b/src/vendor-reset.c index b4e40d5..9dd2618 100644 --- a/src/vendor-reset.c +++ b/src/vendor-reset.c @@ -33,7 +33,9 @@ Place, Suite 330, Boston, MA 02111-1307 USA #define VENDOR_RESET_DEVNAME "vendor_reset" -static bool install_hook = false; +#define vr_info(fmt, args...) pr_info("vendor-reset: " fmt, ##args) + +static bool install_hook = true; module_param(install_hook, bool, 0); static long vendor_reset_ioctl_reset(struct file * filp, unsigned long arg) @@ -156,7 +158,10 @@ static int __init vendor_reset_init(void) return ret; if (install_hook) + { ret = fh_install_hooks(fh_hooks); + vr_info("Hooks installed successfully\n"); + } return ret; }