Skip to content

Commit c17d012

Browse files
committed
Add installed modules to initramfs with dracut
Fedora seems to be adding the stock tablet drivers to its initramfs. As a result, newer tablets with VID:PID pairs already supported by the stock modules won't work, if plugged before boot, since they will be handled by the stock module. Explicitly add our modules to Fedora initramfs, so those tablets work even if plugged in before boot. Fixes #238
1 parent 5170d77 commit c17d012

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

Makefile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PWD := $(shell pwd)
99
DESTDIR =
1010
UDEV_RULES = $(DESTDIR)/lib/udev/rules.d/90-digimend.rules
1111
DEPMOD_CONF = $(DESTDIR)/etc/depmod.d/digimend.conf
12+
DRACUT_CONF_DIR = $(DESTDIR)/usr/lib/dracut/dracut.conf.d
13+
DRACUT_CONF = $(DRACUT_CONF_DIR)/90-digimend.conf
1214
HID_REBIND = $(DESTDIR)/lib/udev/hid-rebind
1315
XORG_CONF := $(DESTDIR)/usr/share/X11/xorg.conf.d/50-digimend.conf
1416
PACKAGE_NAME = digimend-kernel-drivers
@@ -27,6 +29,20 @@ depmod_conf_install:
2729
depmod_conf_uninstall:
2830
rm -vf $(DEPMOD_CONF)
2931

32+
dracut_conf_install:
33+
set -e -x; \
34+
if test -e $(DRACUT_CONF_DIR); then \
35+
install -m 0644 dracut.conf $(DRACUT_CONF); \
36+
dracut --force; \
37+
fi
38+
39+
dracut_conf_uninstall:
40+
set -e -x; \
41+
if test -e $(DRACUT_CONF); then \
42+
rm -v $(DRACUT_CONF); \
43+
dracut --force; \
44+
fi
45+
3046
xorg_conf_install:
3147
install -D -m 0644 xorg.conf $(XORG_CONF)
3248

@@ -46,11 +62,11 @@ modules_uninstall:
4662
/lib/modules/*/extra/hid-uclogic.ko \
4763
/lib/modules/*/extra/hid-viewsonic.ko
4864

49-
install: modules modules_install udev_rules_install depmod_conf_install xorg_conf_install
65+
install: modules modules_install udev_rules_install depmod_conf_install dracut_conf_install xorg_conf_install
5066
udevadm control --reload
5167
depmod -a
5268

53-
uninstall: modules_uninstall udev_rules_uninstall depmod_conf_uninstall xorg_conf_uninstall
69+
uninstall: dracut_conf_uninstall modules_uninstall udev_rules_uninstall depmod_conf_uninstall xorg_conf_uninstall
5470
udevadm control --reload
5571
depmod -a
5672

@@ -97,10 +113,10 @@ dkms_modules_uninstall: dkms_check
97113
} \
98114
done
99115

100-
dkms_install: dkms_modules_install udev_rules_install xorg_conf_install
116+
dkms_install: dkms_modules_install dracut_conf_install udev_rules_install xorg_conf_install
101117
udevadm control --reload
102118

103-
dkms_uninstall: dkms_modules_uninstall udev_rules_uninstall xorg_conf_uninstall
119+
dkms_uninstall: dracut_conf_uninstall dkms_modules_uninstall udev_rules_uninstall xorg_conf_uninstall
104120
udevadm control --reload
105121

106122
dist:

dracut.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Explicitly add our modules to initramfs/initrd to override the stock ones
2+
# added there, so that tablets work when plugged in before boot.
3+
add_drivers+=" hid-kye hid-polostar hid-uclogic hid-viewsonic "

0 commit comments

Comments
 (0)