diff --git a/Makefile b/Makefile index f6b282e..32b2a28 100644 --- a/Makefile +++ b/Makefile @@ -77,12 +77,14 @@ package-deb: cp -rf Makefile $(DEB_PACKAGE_SRC) cp -rf src $(DEB_PACKAGE_SRC) cp -rf src_pkg/dkms_postinst $(DEB_PACKAGE_BASE)/usr/share/$(MODULE_NAME)/postinst + cp -rf tuxedo_keyboard.conf $(DEB_PACKAGE_BASE)/usr/share/$(MODULE_NAME)/tuxedo_keyboard.conf # Make sure files and folders have acceptable permissions chmod -R 755 $(DEB_PACKAGE_CTRL) chmod 644 $(DEB_PACKAGE_CTRL)/control find deb/$(DEB_PACKAGE_NAME)/usr -type d -exec chmod 755 {} \; find deb/$(DEB_PACKAGE_NAME)/usr -type f -exec chmod 644 {} \; chmod 755 $(DEB_PACKAGE_BASE)/usr/share/$(MODULE_NAME)/postinst + chmod 644 $(DEB_PACKAGE_BASE)/usr/share/$(MODULE_NAME)/tuxedo_keyboard.conf gunzip $(DEB_PACKAGE_BASE)/usr/share/doc/$(MODULE_NAME)/changelog.gz gzip -n9 $(DEB_PACKAGE_BASE)/usr/share/doc/$(MODULE_NAME)/changelog @@ -116,6 +118,7 @@ package-rpm: cp -rf src $(RPM_PACKAGE_SRC) cp -rf LICENSE $(RPM_PACKAGE_SRC) cp -rf src_pkg/dkms_postinst $(RPM_PACKAGE_SRC)/postinst + cp -rf tuxedo_keyboard.conf $(RPM_PACKAGE_SRC) # Compress/package source cd rpm/SOURCES && tar cjvf $(RPM_PACKAGE_NAME).tar.bz2 $(RPM_PACKAGE_NAME) # Make rpm package diff --git a/deb/module-name/DEBIAN/control b/deb/module-name/DEBIAN/control index 5117e9c..e0ce638 100644 --- a/deb/module-name/DEBIAN/control +++ b/deb/module-name/DEBIAN/control @@ -3,6 +3,8 @@ Version: x.x.x Section: admin Priority: optional Depends: dkms (>= 1.95) +Conflicts: tuxedo-keyboard-dkms (<= 2.0.0), tuxedo-wmi-dkms (<= 1.5.1) +Replaces: tuxedo-keyboard-dkms (<= 2.0.0), tuxedo-wmi-dkms (<= 1.5.1) Maintainer: TUXEDO Computers GmbH Homepage: https://www.tuxedocomputers.com Architecture: all diff --git a/deb/module-name/DEBIAN/postinst b/deb/module-name/DEBIAN/postinst index fb6a25b..d943585 100755 --- a/deb/module-name/DEBIAN/postinst +++ b/deb/module-name/DEBIAN/postinst @@ -44,6 +44,12 @@ case "$1" in # Attempt to (re-)load module immediately, fail silently if not possible at this stage rmmod ${module} > /dev/null 2>&1 || true modprobe ${module} > /dev/null 2>&1 || true + + # Install default config if none exist already + if [ ! -f "/etc/modprobe.d/tuxedo_keyboard.conf" ]; then + cp -f /usr/share/tuxedo-keyboard/tuxedo_keyboard.conf /etc/modprobe.d/tuxedo_keyboard.conf + fi + ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/deb/module-name/DEBIAN/prerm b/deb/module-name/DEBIAN/prerm index 191d383..1e8aeed 100755 --- a/deb/module-name/DEBIAN/prerm +++ b/deb/module-name/DEBIAN/prerm @@ -6,7 +6,17 @@ version=x.x.x set -e case "$1" in - remove|upgrade|deconfigure) + remove) + if [ "`dkms status -m $module`" ] + then + dkms remove -m $module -v $version --all + # Attempt to remove module, fail silently if module is already unloaded + rmmod -s $module > /dev/null 2>&1 || true + fi + rm -f /etc/modprobe.d/tuxedo_keyboard.conf || true + ;; + + upgrade|deconfigure) if [ "`dkms status -m $module`" ] then dkms remove -m $module -v $version --all diff --git a/deb/module-name/usr/share/doc/module-name/changelog.gz b/deb/module-name/usr/share/doc/module-name/changelog.gz index 36bba27..8166d67 100644 Binary files a/deb/module-name/usr/share/doc/module-name/changelog.gz and b/deb/module-name/usr/share/doc/module-name/changelog.gz differ diff --git a/dkms.conf b/dkms.conf index e3830c0..1c4ab76 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME=tuxedo-keyboard -PACKAGE_VERSION=2.0.1 +PACKAGE_VERSION=2.0.2 DEST_MODULE_LOCATION[0]="/kernel/lib/" BUILT_MODULE_NAME[0]="tuxedo_keyboard" diff --git a/src/tuxedo_keyboard.c b/src/tuxedo_keyboard.c index 7743015..09fb000 100644 --- a/src/tuxedo_keyboard.c +++ b/src/tuxedo_keyboard.c @@ -36,7 +36,7 @@ MODULE_AUTHOR ("Christian Loritz / TUXEDO Computers GmbH "); MODULE_DESCRIPTION("TUXEDO Computers Keyboard Backlight Driver"); MODULE_LICENSE("GPL"); -MODULE_VERSION("2.0.1"); +MODULE_VERSION("2.0.2"); MODULE_ALIAS("wmi:" CLEVO_EVENT_GUID); MODULE_ALIAS("wmi:" CLEVO_GET_GUID); diff --git a/src_pkg/rpm_pkg.spec b/src_pkg/rpm_pkg.spec index d32d6be..048ef15 100644 --- a/src_pkg/rpm_pkg.spec +++ b/src_pkg/rpm_pkg.spec @@ -47,6 +47,7 @@ cp -R src/ %{buildroot}/usr/src/%{module}-%{version} mkdir -p %{buildroot}/usr/share/ mkdir -p %{buildroot}/usr/share/%{module}/ cp postinst %{buildroot}/usr/share/%{module} +cp tuxedo_keyboard.conf %{buildroot}/usr/share/%{module} %clean rm -rf %{buildroot} @@ -59,6 +60,7 @@ rm -rf %{buildroot} %attr(0644,root,root) /usr/src/%{module}-%{version}/src/* %attr(0755,root,root) /usr/share/%{module}/ %attr(0755,root,root) /usr/share/%{module}/postinst +%attr(0644,root,root) /usr/share/%{module}/tuxedo_keyboard.conf %license LICENSE %post @@ -67,6 +69,12 @@ for POSTINST in /usr/lib/dkms/common.postinst /usr/share/%{module}/postinst; do $POSTINST %{module} %{version} /usr/share/%{module} RET=$? modprobe %{module} > /dev/null 2>&1 || true + + # Install default config if none exist already + if [ ! -f "/etc/modprobe.d/tuxedo_keyboard.conf" ]; then + cp -f /usr/share/tuxedo-keyboard/tuxedo_keyboard.conf /etc/modprobe.d/tuxedo_keyboard.conf + fi + exit $RET fi echo "WARNING: $POSTINST does not exist." @@ -85,13 +93,17 @@ echo -e "Uninstall of %{module} module (version %{version}-%{release}) beginning dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade if [ $1 != 1 ];then /usr/sbin/rmmod %{module} > /dev/null 2>&1 || true + rm -f /etc/modprobe.d/tuxedo_keyboard.conf || true fi exit 0 %changelog -* UNRELEASED C Sandberg 2.0.2-0 +* Tue Apr 14 2020 C Sandberg 2.0.2-0 - Mark old named packages as conflicting and obsolete +- Fix not restoring state on resume +- Fix autoload issues +- Add standard config tuxedo_keyboard.conf to package * Tue Mar 17 2020 C Sandberg 2.0.1-0 - New packaging * Wed Dec 18 2019 Richard Sailer 2.0.0-1 diff --git a/trans_pkg_from_dkms/deb/tuxedo-keyboard-dkms/DEBIAN/control b/trans_pkg_from_dkms/deb/tuxedo-keyboard-dkms/DEBIAN/control new file mode 100644 index 0000000..35536cd --- /dev/null +++ b/trans_pkg_from_dkms/deb/tuxedo-keyboard-dkms/DEBIAN/control @@ -0,0 +1,10 @@ +Package: tuxedo-keyboard-dkms +Version: 2.0.1 +Section: oldlibs +Priority: optional +Depends: tuxedo-keyboard +Maintainer: TUXEDO Computers GmbH +Homepage: https://www.tuxedocomputers.com +Architecture: all +Description: Transitional package: tuxedo-keyboard-dkms -> tuxedo-keyboard + This is a transitional package, effectively renaming the package. diff --git a/tuxedo_keyboard.conf b/tuxedo_keyboard.conf index 251bfc0..6bc2838 100644 --- a/tuxedo_keyboard.conf +++ b/tuxedo_keyboard.conf @@ -1 +1 @@ -options tuxedo_keyboard mode=0 brightness=75 color_left=0xFFFFFF color_center=0xFFFFFF color_right=0xFFFFFF +options tuxedo-keyboard mode=0 brightness=75 color_left=0xFFFFFF color_center=0xFFFFFF color_right=0xFFFFFF