Recent Ubuntu releases (e.g. 15.10) include the Wacom driver in their
initramfs. If a tablet is connected at boot, this driver will be loaded
in preference to whatever we may have installed to /lib/modules. Since
we can't prevent this from occuring, we need to update the initramfs
to contain our module. Thankfully, Ubuntu provides a command to do just
that: update-initramfs. By running this after the module is installed
and depmod updated, the initramfs will be updated to contain our on-disk
driver and load it on boot.

Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
---
Changes from v1:
 * update-initramfs allows you to provide a kernel version parameter
   "-k". Use it to ensure the correct initramfs is rebuilt.

 3.17/Makefile.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/3.17/Makefile.in b/3.17/Makefile.in
index 69b19e1..55c49ca 100644
--- a/3.17/Makefile.in
+++ b/3.17/Makefile.in
@@ -16,6 +16,7 @@ endif # CONFIG_HID_WACOM
 
 else  # We were called from command line
 PWD  := $(shell pwd)
+UPDATE_INITRAMFS := $(shell command -v update-initramfs 2>/dev/null)
 
 WCM_KERNEL_DIR := @WCM_KERNEL_DIR@
 MODUTS := @MODUTS@
@@ -33,6 +34,9 @@ install modules_install:
        mkdir -p /etc/depmod.d
        echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf
        PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS)
+ifdef UPDATE_INITRAMFS
+       $(UPDATE_INITRAMFS) -u -k $(MODUTS)
+endif
 
 uninstall:
        @# Debian uses symlinks in the path to WCM_KERNEL_DIR
@@ -43,6 +47,9 @@ uninstall:
        cd $(WCM_KERNEL_DIR)/../extra; rm wacom_w8001.ko*
        rm -f /etc/depmod.d/input-wacom.conf
        PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS)
+ifdef UPDATE_INITRAMFS
+       $(UPDATE_INITRAMFS) -u -k $(MODUTS)
+endif
 
 endif  # End kbuild check
 
-- 
2.8.2


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to