This list is closed, nobody may subscribe to it.
2003 |
Jan
(17) |
Feb
(19) |
Mar
(7) |
Apr
(20) |
May
(9) |
Jun
(26) |
Jul
(10) |
Aug
(4) |
Sep
(15) |
Oct
(2) |
Nov
(10) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(3) |
Feb
(7) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
(3) |
Aug
(1) |
Sep
(4) |
Oct
(7) |
Nov
(6) |
Dec
(2) |
2005 |
Jan
(3) |
Feb
(43) |
Mar
(35) |
Apr
(4) |
May
(38) |
Jun
(2) |
Jul
(5) |
Aug
(2) |
Sep
(5) |
Oct
(25) |
Nov
(42) |
Dec
(10) |
2006 |
Jan
(8) |
Feb
(16) |
Mar
(31) |
Apr
(24) |
May
(10) |
Jun
(2) |
Jul
(2) |
Aug
(11) |
Sep
|
Oct
(4) |
Nov
(24) |
Dec
(12) |
2007 |
Jan
|
Feb
(3) |
Mar
(20) |
Apr
(5) |
May
(10) |
Jun
(6) |
Jul
(11) |
Aug
(3) |
Sep
(13) |
Oct
(11) |
Nov
(16) |
Dec
(5) |
2008 |
Jan
(12) |
Feb
(23) |
Mar
(9) |
Apr
(85) |
May
(72) |
Jun
(10) |
Jul
(54) |
Aug
(43) |
Sep
(33) |
Oct
(21) |
Nov
(48) |
Dec
(51) |
2009 |
Jan
(25) |
Feb
(5) |
Mar
(5) |
Apr
(7) |
May
(32) |
Jun
(22) |
Jul
(17) |
Aug
(2) |
Sep
(4) |
Oct
(28) |
Nov
(20) |
Dec
(128) |
2010 |
Jan
(169) |
Feb
(187) |
Mar
(239) |
Apr
(78) |
May
(107) |
Jun
(180) |
Jul
(119) |
Aug
(128) |
Sep
(110) |
Oct
(153) |
Nov
(189) |
Dec
(183) |
2011 |
Jan
(338) |
Feb
(262) |
Mar
(429) |
Apr
(156) |
May
(79) |
Jun
(106) |
Jul
(71) |
Aug
(153) |
Sep
(159) |
Oct
(141) |
Nov
(109) |
Dec
(93) |
2012 |
Jan
(133) |
Feb
(162) |
Mar
(125) |
Apr
(195) |
May
(199) |
Jun
(54) |
Jul
(51) |
Aug
(64) |
Sep
(74) |
Oct
(131) |
Nov
(86) |
Dec
(123) |
2013 |
Jan
(56) |
Feb
(11) |
Mar
(31) |
Apr
(24) |
May
(65) |
Jun
(9) |
Jul
(8) |
Aug
(15) |
Sep
(51) |
Oct
(46) |
Nov
(5) |
Dec
(1) |
2014 |
Jan
(29) |
Feb
(109) |
Mar
(97) |
Apr
(35) |
May
(25) |
Jun
(25) |
Jul
(28) |
Aug
(7) |
Sep
(62) |
Oct
(9) |
Nov
(18) |
Dec
(53) |
2015 |
Jan
(42) |
Feb
(27) |
Mar
(56) |
Apr
(25) |
May
(7) |
Jun
(8) |
Jul
(5) |
Aug
(13) |
Sep
(8) |
Oct
(13) |
Nov
(11) |
Dec
(27) |
2016 |
Jan
(32) |
Feb
(28) |
Mar
(11) |
Apr
(15) |
May
(22) |
Jun
(35) |
Jul
(20) |
Aug
(25) |
Sep
(7) |
Oct
(43) |
Nov
(60) |
Dec
|
2017 |
Jan
(17) |
Feb
(30) |
Mar
(15) |
Apr
(20) |
May
(27) |
Jun
(3) |
Jul
(7) |
Aug
(10) |
Sep
(19) |
Oct
(24) |
Nov
(54) |
Dec
(54) |
2018 |
Jan
(36) |
Feb
(18) |
Mar
(64) |
Apr
(38) |
May
(2) |
Jun
(7) |
Jul
(3) |
Aug
(10) |
Sep
(2) |
Oct
(9) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(9) |
Feb
|
Mar
|
Apr
(8) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
From: Gerecke, J. <kil...@gm...> - 2019-12-23 03:04:39
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 A new release of the X11 driver is now available for download. This is a relatively minor release which primarily fixes an issue with some AES pens being treated as erasers on buggy kernel versions. Additionally there is some new hardware support and a fix for an issue that could affect users of old serial tablets. This release has been signed with a new key: 0x5B4EA609784983CA. While the tag cannot be cross-signed with both the old and new key, I have signed this message with both keys to provide a degree of key continuity. The new key itself is also signed by the old key as well. Please ensure that everything continues to validate correctly. Key Details: pub ed25519/0x5B4EA609784983CA 2019-12-20 [SC] [expires: 2021-02-01] Key fingerprint = FBE0 7878 1106 933D 3DDC F93E 5B4E A609 7849 83CA uid [ultimate] Jason Gerecke <jas...@wa...> uid [ultimate] Jason Gerecke <kil...@gm...> sub cv25519/0x8EE1B70A92763609 2019-12-20 [E] [expires: 2021-02-01] Jason Gerecke (4): tools: Fix potential buffer overflow when reading from serial tablet Ignore ABS_MISC as a source of device type information for AES pens Recognize new MobileStudio Pro PID wacom 0.39.0 git tag: xf86-input-wacom-0.39.0 https://github.com/linuxwacom/xf86-input-wacom/releases/download/xf86-input-wacom-0.39.0/xf86-input-wacom-0.39.0.tar.bz2 MD5: 9ee7bf6969002d6cfe9301354a72d7b0 xf86-input-wacom-0.39.0.tar.bz2 SHA1: eddbbc3eb97318875985344a5dd2c480aa75246b xf86-input-wacom-0.39.0.tar.bz2 SHA256: 12bf826e21bb61a9569be434e04cb1fcc68f7d8185a847ce899163f3152a1387 xf86-input-wacom-0.39.0.tar.bz2 PGP: https://github.com/linuxwacom/xf86-input-wacom/releases/download/xf86-input-wacom-0.39.0/xf86-input-wacom-0.39.0.tar.bz2.sig -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQT74Hh4EQaTPT3c+T5bTqYJeEmDygUCXgAtoAAKCRBbTqYJeEmD yhNkAP4hr1pzDvhli/oZuddPZppXPIP/JzgRX5e5p1reHFW3xAEAsr9SnXpvQcZV YR/mLwHudmGWd6NwUVxasH8l8oW2hAGJATMEAQEIAB0WIQRvJndk+EgT9HYbBHoN rZ1sYNkkrAUCXgAtoAAKCRANrZ1sYNkkrIP+B/9V5KogrFHf8QOtQLyLA2TjCld6 Dp+BvA+Aed1Wd5P6asgqmZtrCDJsJZC10rEvK/jL0d+LrTZvdLgY0CLJbbN165U1 HR956q43I2CetnOC2ymQdjpm3IMapMtNBv/tMJqCUYkNKRTseZSQmpF05hO3Rdbr s0YLaFMssENI7bfXS0E9zq2yzPTkbfivhYteUUwHslX6lZiFOo0FVhMRluKr6W5p +uyVVAo69Ko6rMz8CwAYPN4R42FrD/1LYkIiU4u4HvGbeami+WV//LgJnLW0ajYF UYN5IZIoQEv8tBwn1IuwPFFgmFBEh2ncGOGP2yj8ezcHs6/jTGmADk90+lsX =gDAY -----END PGP SIGNATURE----- |
From: Gerecke, J. <kil...@gm...> - 2019-12-23 03:04:21
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 A new release of our backported input-wacom kernel driver just before the end of 2019. This release primarily fixes two widespread issues: a kernel panic for some users when rebooting with a "One by Wacom" plugged in, and the reporting of bad serial number information for tablet PC AES pens. In addition to these fixes we also include support for new hardware. This release has been signed with a new key: 0x5B4EA609784983CA. While the tag cannot be cross-signed with both the old and new key, I have signed this message with both keys to provide a degree of key continuity. The new key itself is also signed by the old key as well. Please ensure that everything continues to validate correctly. Key Details: pub ed25519/0x5B4EA609784983CA 2019-12-20 [SC] [expires: 2021-02-01] Key fingerprint = FBE0 7878 1106 933D 3DDC F93E 5B4E A609 7849 83CA uid [ultimate] Jason Gerecke <jas...@wa...> uid [ultimate] Jason Gerecke <kil...@gm...> sub cv25519/0x8EE1B70A92763609 2019-12-20 [E] [expires: 2021-02-01] Aaron Armstrong Skomra (2): backport: HID: wacom: Don't add ghost interface as shared data backport: HID: wacom: call _query_tablet_data() for BAMBOO_TOUCH Jason Gerecke (6): Error out if the build path has a space in it HID: wacom: generic: Treat serial number and related fields as unsigned backport: HID: wacom: generic: Treat serial number and related fields as unsigned HID: wacom: Recognize new MobileStudio Pro PID backport: HID: wacom: Recognize new MobileStudio Pro PID input-wacom 0.45.0 git tag: input-wacom-0.45.0 https://github.com/linuxwacom/input-wacom/releases/download/input-wacom-0.45.0/input-wacom-0.45.0.tar.bz2 MD5: 19ff3bf7fc3123691924baa4d5a6dd61 input-wacom-0.45.0.tar.bz2 SHA1: fd98dd07820c22028743b1a793c7d81934bedd52 input-wacom-0.45.0.tar.bz2 SHA256: a4ca0d959acd5094716f796de849ccf81a9ab5b2cbdc092e4f35892386ea8929 input-wacom-0.45.0.tar.bz2 PGP: https://github.com/linuxwacom/input-wacom/releases/download/input-wacom-0.45.0/input-wacom-0.45.0.tar.bz2.sig -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQT74Hh4EQaTPT3c+T5bTqYJeEmDygUCXgAszgAKCRBbTqYJeEmD yqbLAQC4AsxbFGfSOG6dC5U86QurliEo0KMAyJDl0I4qfclETwEAm2xFqLc3SS9v AvSEOkOnSK9EsbbNv7jILWZBGGqXvAaJATMEAQEIAB0WIQRvJndk+EgT9HYbBHoN rZ1sYNkkrAUCXgAs1gAKCRANrZ1sYNkkrK6LCACT/Ec2bD/9NPrtXQDXX/YbQcVA oeECtKKeY4EFxPpChokhO2Z4Zbvywmy9b96Wlf0M2EYyJIHWeI1/AOdRI09P6hPh XqMoSRifjDojw35yzAjba4scwRovVPEVF7Mlxg8khQBxio+1IOnTqIWx6+oyTzC4 zV1vu4Afx0U78cojRTnGauSnsMpmJgLPUz0ZQ2TEumAaHOqbPLlI8ST6U0zntLZc 9lPc/aUSob3D/jOGocgZGZiQ19PDuL9PeFajNohvORNRMU5SBI+vLqg2AugCbEtx XM3gYeacixM+Z0di1xrmqHNT/8Ytb6P2c1NasGfUSv9yshvN3pDvWu5aLV0i =Fy1i -----END PGP SIGNATURE----- |
From: Aaron A. S. <sk...@gm...> - 2019-06-06 21:55:56
|
The linuxwacom project has moved from Sourceforge to Github. Development is now done using Github pull requests. As such this list is no longer necessary and is being closed. The archive of this list will remain available here: https://sourceforge.net/p/linuxwacom/mailman/linuxwacom-devel/ |
From: Aaron A. S. <sk...@gm...> - 2019-05-14 22:32:31
|
Signed-off-by: Aaron Armstrong Skomra <aar...@wa...> --- 2.6.32/wacom_sys.c | 6 ++++-- 2.6.32/wacom_wac.c | 13 +++++++++++++ 2.6.32/wacom_wac.h | 1 + 2.6.38/wacom_sys.c | 6 ++++-- 2.6.38/wacom_wac.c | 13 +++++++++++++ 2.6.38/wacom_wac.h | 1 + 3.7/wacom_sys.c | 6 ++++-- 3.7/wacom_wac.c | 13 +++++++++++++ 3.7/wacom_wac.h | 1 + 9 files changed, 54 insertions(+), 6 deletions(-) diff --git a/2.6.32/wacom_sys.c b/2.6.32/wacom_sys.c index 84f9d0d04a8e..3ec15802bd84 100644 --- a/2.6.32/wacom_sys.c +++ b/2.6.32/wacom_sys.c @@ -223,7 +223,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi switch (data) { case HID_USAGE_WT_X: features->device_type = BTN_TOOL_TRIPLETAP; - if (features->type == INTUOSP2) { + if (features->type == INTUOSP2 || + features->type == INTUOSP2S) { features->pktlen = WACOM_PKGLEN_INTUOSP2T; features->unit = report[i+4]; features->unitExpo = report[i+6]; @@ -233,7 +234,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi break; case HID_USAGE_WT_Y: - if (features->type == INTUOSP2) { + if (features->type == INTUOSP2 || + features->type == INTUOSP2S) { features->y_phy = get_unaligned_le16(&report[i + 4]); features->y_max = get_unaligned_le16(&report[i + 7]); } diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c index 3aa3940eb011..4c846f870f6c 100644 --- a/2.6.32/wacom_wac.c +++ b/2.6.32/wacom_wac.c @@ -1025,6 +1025,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom) bytes_header = 3; break; case INTUOSP2: + case INTUOSP2S: current_num_contacts = data[1]; contacts_per_packet = 5; bytes_per_packet = WACOM_BYTES_PER_INTUOSP2_PACKET; @@ -1071,6 +1072,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom) break; case INTUOSP2: + case INTUOSP2S: contact_id = data[offset]; prox = data[offset + 1] & 0x01; x = get_unaligned_le16(&data[offset + 2]); @@ -1700,6 +1702,11 @@ static int wacom_mspro_pad_irq(struct wacom_wac *wacom) ring = le16_to_cpup((__le16 *)&data[4]); keys = 0; break; + case 7: + buttons = (data[1]) | (data[3] << 6); + ring = le16_to_cpup((__le16 *)&data[4]); + keys = 0; + break; case 0: buttons = 0; ring = WACOM_INTUOSP2_RING_UNTOUCHED; /* No ring */ @@ -1937,6 +1944,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case INTUOSP2S: case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) @@ -2306,6 +2314,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, break; case INTUOSP2: + case INTUOSP2S: if (features->device_type == BTN_TOOL_TRIPLETAP) { for (i = 0; i < 10; i++) wacom_wac->slots[i] = -1; @@ -3072,6 +3081,9 @@ static const struct wacom_features wacom_features_0x390 = WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, .oVid = USB_VENDOR_ID_WACOM }; +static const struct wacom_features wacom_features_0x392 = + { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOSP2, 31920, 19950, 8191, 63, + INTUOSP2S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 10 }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3258,6 +3270,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, + { USB_DEVICE_DETAILED(0x392, USB_CLASS_HID, 0, 0) }, #ifndef RHEL6_RELEASE { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, diff --git a/2.6.32/wacom_wac.h b/2.6.32/wacom_wac.h index 45e865bbf5ac..6b4a9fd84d33 100755 --- a/2.6.32/wacom_wac.h +++ b/2.6.32/wacom_wac.h @@ -129,6 +129,7 @@ enum { WACOM_MSPROT, DTH1152T, INTUOSP2, + INTUOSP2S, INTUOSHT3, TABLETPC, /* add new TPC below */ TABLETPCE, diff --git a/2.6.38/wacom_sys.c b/2.6.38/wacom_sys.c index 496f40751dfb..cce702479307 100644 --- a/2.6.38/wacom_sys.c +++ b/2.6.38/wacom_sys.c @@ -359,7 +359,8 @@ static int wacom_parse_hid(struct usb_interface *intf, case HID_USAGE_WT_X: if (finger) features->device_type = BTN_TOOL_FINGER; - if (features->type == INTUOSP2) { + if (features->type == INTUOSP2 || + features->type == INTUOSP2S) { features->touch_max = 10; features->pktlen = WACOM_PKGLEN_INTUOSP2T; features->unit = report[i+4]; @@ -370,7 +371,8 @@ static int wacom_parse_hid(struct usb_interface *intf, break; case HID_USAGE_WT_Y: - if (features->type == INTUOSP2) { + if (features->type == INTUOSP2 || + features->type == INTUOSP2S) { features->y_phy = get_unaligned_le16(&report[i + 4]); features->y_max = get_unaligned_le16(&report[i + 7]); } diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c index 032e0701b616..a0afc2f4513c 100644 --- a/2.6.38/wacom_wac.c +++ b/2.6.38/wacom_wac.c @@ -1250,6 +1250,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom) bytes_header = 3; break; case INTUOSP2: + case INTUOSP2S: current_num_contacts = data[1]; contacts_per_packet = 5; bytes_per_packet = WACOM_BYTES_PER_INTUOSP2_PACKET; @@ -1306,6 +1307,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom) break; case INTUOSP2: + case INTUOSP2S: contact_id = data[offset]; prox = data[offset + 1] & 0x01; x = get_unaligned_le16(&data[offset + 2]); @@ -1904,6 +1906,11 @@ static int wacom_mspro_pad_irq(struct wacom_wac *wacom) ring = le16_to_cpup((__le16 *)&data[4]); keys = 0; break; + case 7: + buttons = (data[1]) | (data[3] << 6); + ring = le16_to_cpup((__le16 *)&data[4]); + keys = 0; + break; case 0: buttons = 0; ring = WACOM_INTUOSP2_RING_UNTOUCHED; /* No ring */ @@ -2141,6 +2148,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case INTUOSP2S: case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) @@ -2563,6 +2571,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, break; case INTUOSP2: + case INTUOSP2S: if (features->device_type == BTN_TOOL_PEN) { __set_bit(BTN_STYLUS3, input_dev->keybit); wacom_wac->previous_ring = WACOM_INTUOSP2_RING_UNTOUCHED; @@ -3421,6 +3430,9 @@ static const struct wacom_features wacom_features_0x390 = WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, .oVid = USB_VENDOR_ID_WACOM }; +static const struct wacom_features wacom_features_0x392 = + { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOSP2, 31920, 19950, 8191, 63, + INTUOSP2S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 10 }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3611,6 +3623,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, + { USB_DEVICE_DETAILED(0x392, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/2.6.38/wacom_wac.h b/2.6.38/wacom_wac.h index c2e337d41427..81729d268af3 100644 --- a/2.6.38/wacom_wac.h +++ b/2.6.38/wacom_wac.h @@ -143,6 +143,7 @@ enum { WACOM_MSPROT, DTH1152T, INTUOSP2, + INTUOSP2S, INTUOSHT3, WIRELESS, REMOTE, diff --git a/3.7/wacom_sys.c b/3.7/wacom_sys.c index 4e5288d1571c..2e10783a527a 100644 --- a/3.7/wacom_sys.c +++ b/3.7/wacom_sys.c @@ -359,7 +359,8 @@ static int wacom_parse_hid(struct usb_interface *intf, case HID_USAGE_WT_X: if (finger) features->device_type = BTN_TOOL_FINGER; - if (features->type == INTUOSP2) { + if (features->type == INTUOSP2 || + features->type == INTUOSP2S) { features->touch_max = 10; features->pktlen = WACOM_PKGLEN_INTUOSP2T; features->unit = report[i+4]; @@ -370,7 +371,8 @@ static int wacom_parse_hid(struct usb_interface *intf, break; case HID_USAGE_WT_Y: - if (features->type == INTUOSP2) { + if (features->type == INTUOSP2 || + features->type == INTUOSP2S) { features->y_phy = get_unaligned_le16(&report[i + 4]); features->y_max = get_unaligned_le16(&report[i + 7]); } diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c index 3eacf483aac2..f2e191debeda 100644 --- a/3.7/wacom_wac.c +++ b/3.7/wacom_wac.c @@ -1230,6 +1230,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom) bytes_header = 3; break; case INTUOSP2: + case INTUOSP2S: current_num_contacts = data[1]; contacts_per_packet = 5; bytes_per_packet = WACOM_BYTES_PER_INTUOSP2_PACKET; @@ -1286,6 +1287,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom) break; case INTUOSP2: + case INTUOSP2S: contact_id = data[offset]; prox = data[offset + 1] & 0x01; x = get_unaligned_le16(&data[offset + 2]); @@ -1886,6 +1888,11 @@ static int wacom_mspro_pad_irq(struct wacom_wac *wacom) ring = le16_to_cpup((__le16 *)&data[4]); keys = 0; break; + case 7: + buttons = (data[1]) | (data[3] << 6); + ring = le16_to_cpup((__le16 *)&data[4]); + keys = 0; + break; case 0: buttons = 0; ring = WACOM_INTUOSP2_RING_UNTOUCHED; /* No ring */ @@ -2123,6 +2130,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case INTUOSP2S: case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) @@ -2534,6 +2542,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, break; case INTUOSP2: + case INTUOSP2S: if (features->device_type == BTN_TOOL_PEN) { __set_bit(BTN_STYLUS3, input_dev->keybit); wacom_wac->previous_ring = WACOM_INTUOSP2_RING_UNTOUCHED; @@ -3351,6 +3360,9 @@ static const struct wacom_features wacom_features_0x390 = WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, .oVid = USB_VENDOR_ID_WACOM }; +static const struct wacom_features wacom_features_0x392 = + { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOSP2, 31920, 19950, 8191, 63, + INTUOSP2S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 10 }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3541,6 +3553,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, + { USB_DEVICE_DETAILED(0x392, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/3.7/wacom_wac.h b/3.7/wacom_wac.h index da7387a3bee2..b25b41fd7f37 100644 --- a/3.7/wacom_wac.h +++ b/3.7/wacom_wac.h @@ -143,6 +143,7 @@ enum { WACOM_MSPROT, DTH1152T, INTUOSP2, + INTUOSP2S, INTUOSHT3, WIRELESS, REMOTE, -- 2.7.4 |
From: Jason G. <kil...@gm...> - 2019-04-10 16:11:50
|
I don't think so. rEFInd isn't installed by default with any of the default distributions that I'm aware of; users install it manually as an alternative to GRUB. I think a note on the Secure Boot wiki page would be sufficient to let people who use rEFInd know that they should explicitly check for its keys before making their own. Jason --- Now instead of four in the eights place / you’ve got three, ‘Cause you added one / (That is to say, eight) to the two, / But you can’t take seven from three, / So you look at the sixty-fours.... On Tue, Apr 9, 2019 at 9:18 PM Ping Cheng <pin...@gm...> wrote: > > On Tue, Apr 9, 2019 at 3:17 PM Gerecke, Jason <kil...@gm...> wrote: >> >> From: Jason Gerecke <jas...@wa...> >> >> Previously we would only automatically discover Ubuntu's shim MOK if one >> had been created. We now also try to use the kernel's autogenerated key >> if present, and the key generated by rEFInd (though this may be inside >> a directory that only root can read from). > > > Does this mean we should prompt users to compile input-wacom under root? > > It’s quite a lot of work. Thank you for your effort, Jason! > > Acked-by: Ping Cheng <pin...@wa...> for the whole set. > > Cheers, > Ping > >> >> >> Signed-off-by: Jason Gerecke <jas...@wa...> >> --- >> configure.ac | 52 ++++++++++++++++++++++++++++++++-------------------- >> 1 file changed, 32 insertions(+), 20 deletions(-) >> >> diff --git a/configure.ac b/configure.ac >> index fa88ade..5353705 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -248,6 +248,25 @@ dnl ======================================================= >> dnl Module signing >> AC_DEFUN([WACOM_LINUX_READ_CONFIG], [grep -sh '^$1=' $WCM_KERNEL_DIR/.config /boot/config-$MODUTS | head -n1 | cut -d= -f2- | sed -e 's/^"\(.*\)"$/\1/']) >> >> +AC_DEFUN([WACOM_LINUX_FILE_IF_EXISTS], [test -f "$1" && readlink -e "$1"]) >> + >> +AC_DEFUN([WACOM_LINUX_CHECK_KEYCERT], >> +if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then >> + AC_MSG_CHECKING(for $1 key at $2) >> + KEYFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$2])) >> + RESULT=$(test -z "$KEYFILE" && echo "no" || echo "yes") >> + AC_MSG_RESULT([$RESULT]) >> + AC_MSG_CHECKING(for $1 cert at $3) >> + CERTFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$3])) >> + RESULT=$(test -z "$CERTFILE" && echo "no" || echo "yes") >> + AC_MSG_RESULT([$RESULT]) >> + if test -n "$KEYFILE" -a -n "$CERTFILE"; then >> + MODSIGN_PRIVFILE="$KEYFILE" >> + MODSIGN_CERTFILE="$CERTFILE"; >> + fi >> +fi) >> + >> + >> MODSIGN_ENABLE=default >> MODSIGN_HASHALGO= >> MODSIGN_PRIVFILE= >> @@ -290,20 +309,6 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then >> >> >> >> - # There is no standard location for storing kernel signing keys >> - # and certificates. The kernel itself has CONFIG_MODULE_SIG_KEY >> - # (which contains a key and cert) which likely points to a file >> - # that doesn't exist unless you built the kernel yourself. Most >> - # distributions use the "shim" bootloader which allows "machine >> - # owner keys" (MOK) to be enrolled by the end-user, but only >> - # Ubuntu provides a tool to automatically generate these keys >> - # (`update-secureboot-policy --new-key`); other distros rely on >> - # the user generating the key/cert themselves and keeping it in a >> - # suitably-safe location. >> - # >> - # The kernel should automatically try to sign modules as part of >> - # the `make modules_install` step, so that covers the first case. >> - # In the second case the best we can do is try Ubuntu's location. >> AC_ARG_WITH(signing-key, >> AS_HELP_STRING([--with-signing-key=<trusted.priv>], [Specify module signing key location]), >> [MODSIGN_PRIVFILE="$withval"]) >> @@ -311,12 +316,19 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then >> AS_HELP_STRING([--with-signing-cert=<trusted.der>], [Specify module signing cert location]), >> [MODSIGN_CERTFILE="$withval"]) >> >> - if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then >> - MODSIGN_PRIVFILE=$(ls /var/lib/shim-signed/mok/MOK.priv 2>/dev/null || echo "$MODSIGN_PRIVFILE") >> - fi >> - if test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE"; then >> - MODSIGN_CERTFILE=$(ls /var/lib/shim-signed/mok/MOK.der 2>/dev/null || echo "$MODSIGN_CERTFILE") >> - fi >> + HASPRIVFILE=$(test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE" && echo 0 || echo 1) >> + HASCERTFILE=$(test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE" && echo 0 || echo 1) >> + if test "$HASPRIVFILE" -ne "$HASCERTFILE"; then >> + AC_MSG_ERROR([Options '--with-signing-key' and '--with-signing-cert' must either both be set or both be unset.]) >> + elif test "$HASPRIVFILE" -eq 1; then >> + # Try to get absolute path, if possible >> + MODSIGN_PRIVFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$MODSIGN_PRIVFILE]) || echo "$MODSIGN_PRIVFILE") >> + MODSIGN_CERTFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$MODSIGN_CERTFILE]) || echo "$MODSIGN_PRIVFILE") >> + else >> + WACOM_LINUX_CHECK_KEYCERT([kernel autogenerated], $WCM_KERNEL_DIR/$(WACOM_LINUX_READ_CONFIG([CONFIG_MODULE_SIG_KEY])), [$WCM_KERNEL_DIR/certs/signing_key.x509]) >> + WACOM_LINUX_CHECK_KEYCERT([shim MOK], [/var/lib/shim-signed/mok/MOK.priv], [/var/lib/shim-signed/mok/MOK.der]) >> + WACOM_LINUX_CHECK_KEYCERT([rEFInd MOK], [/etc/refind.d/keys/refind_local.key], [/etc/refind.d/keys/refind_local.cer]) >> + fi >> >> AC_MSG_CHECKING(for module signing key) >> AC_MSG_RESULT([$MODSIGN_PRIVFILE]) >> -- >> 2.21.0 >> |
From: Ping C. <pin...@gm...> - 2019-04-10 04:18:50
|
On Tue, Apr 9, 2019 at 3:17 PM Gerecke, Jason <kil...@gm...> wrote: > From: Jason Gerecke <jas...@wa...> > > Previously we would only automatically discover Ubuntu's shim MOK if one > had been created. We now also try to use the kernel's autogenerated key > if present, and the key generated by rEFInd (though this may be inside > a directory that only root can read from). Does this mean we should prompt users to compile input-wacom under root? It’s quite a lot of work. Thank you for your effort, Jason! Acked-by: Ping Cheng <pin...@wa...> for the whole set. Cheers, Ping > > Signed-off-by: Jason Gerecke <jas...@wa...> > --- > configure.ac | 52 ++++++++++++++++++++++++++++++++-------------------- > 1 file changed, 32 insertions(+), 20 deletions(-) > > diff --git a/configure.ac b/configure.ac > index fa88ade..5353705 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -248,6 +248,25 @@ dnl > ======================================================= > dnl Module signing > AC_DEFUN([WACOM_LINUX_READ_CONFIG], [grep -sh '^$1=' > $WCM_KERNEL_DIR/.config /boot/config-$MODUTS | head -n1 | cut -d= -f2- | > sed -e 's/^"\(.*\)"$/\1/']) > > +AC_DEFUN([WACOM_LINUX_FILE_IF_EXISTS], [test -f "$1" && readlink -e "$1"]) > + > +AC_DEFUN([WACOM_LINUX_CHECK_KEYCERT], > +if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then > + AC_MSG_CHECKING(for $1 key at $2) > + KEYFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$2])) > + RESULT=$(test -z "$KEYFILE" && echo "no" || echo "yes") > + AC_MSG_RESULT([$RESULT]) > + AC_MSG_CHECKING(for $1 cert at $3) > + CERTFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$3])) > + RESULT=$(test -z "$CERTFILE" && echo "no" || echo "yes") > + AC_MSG_RESULT([$RESULT]) > + if test -n "$KEYFILE" -a -n "$CERTFILE"; then > + MODSIGN_PRIVFILE="$KEYFILE" > + MODSIGN_CERTFILE="$CERTFILE"; > + fi > +fi) > + > + > MODSIGN_ENABLE=default > MODSIGN_HASHALGO= > MODSIGN_PRIVFILE= > @@ -290,20 +309,6 @@ if test "$MODSIGN_ENABLE" = "yes" -o > "$MODSIGN_ENABLE" = "default"; then > > > > - # There is no standard location for storing kernel signing keys > - # and certificates. The kernel itself has CONFIG_MODULE_SIG_KEY > - # (which contains a key and cert) which likely points to a file > - # that doesn't exist unless you built the kernel yourself. Most > - # distributions use the "shim" bootloader which allows "machine > - # owner keys" (MOK) to be enrolled by the end-user, but only > - # Ubuntu provides a tool to automatically generate these keys > - # (`update-secureboot-policy --new-key`); other distros rely on > - # the user generating the key/cert themselves and keeping it in a > - # suitably-safe location. > - # > - # The kernel should automatically try to sign modules as part of > - # the `make modules_install` step, so that covers the first case. > - # In the second case the best we can do is try Ubuntu's location. > AC_ARG_WITH(signing-key, > AS_HELP_STRING([--with-signing-key=<trusted.priv>], > [Specify module signing key location]), > [MODSIGN_PRIVFILE="$withval"]) > @@ -311,12 +316,19 @@ if test "$MODSIGN_ENABLE" = "yes" -o > "$MODSIGN_ENABLE" = "default"; then > AS_HELP_STRING([--with-signing-cert=<trusted.der>], > [Specify module signing cert location]), > [MODSIGN_CERTFILE="$withval"]) > > - if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then > - MODSIGN_PRIVFILE=$(ls /var/lib/shim-signed/mok/MOK.priv > 2>/dev/null || echo "$MODSIGN_PRIVFILE") > - fi > - if test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE"; then > - MODSIGN_CERTFILE=$(ls /var/lib/shim-signed/mok/MOK.der > 2>/dev/null || echo "$MODSIGN_CERTFILE") > - fi > + HASPRIVFILE=$(test "$MODSIGN_PRIVFILE" = "yes" -o -z > "$MODSIGN_PRIVFILE" && echo 0 || echo 1) > + HASCERTFILE=$(test "$MODSIGN_CERTFILE" = "yes" -o -z > "$MODSIGN_CERTFILE" && echo 0 || echo 1) > + if test "$HASPRIVFILE" -ne "$HASCERTFILE"; then > + AC_MSG_ERROR([Options '--with-signing-key' and > '--with-signing-cert' must either both be set or both be unset.]) > + elif test "$HASPRIVFILE" -eq 1; then > + # Try to get absolute path, if possible > + > MODSIGN_PRIVFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$MODSIGN_PRIVFILE]) || echo > "$MODSIGN_PRIVFILE") > + > MODSIGN_CERTFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$MODSIGN_CERTFILE]) || echo > "$MODSIGN_PRIVFILE") > + else > + WACOM_LINUX_CHECK_KEYCERT([kernel autogenerated], > $WCM_KERNEL_DIR/$(WACOM_LINUX_READ_CONFIG([CONFIG_MODULE_SIG_KEY])), > [$WCM_KERNEL_DIR/certs/signing_key.x509]) > + WACOM_LINUX_CHECK_KEYCERT([shim MOK], > [/var/lib/shim-signed/mok/MOK.priv], [/var/lib/shim-signed/mok/MOK.der]) > + WACOM_LINUX_CHECK_KEYCERT([rEFInd MOK], > [/etc/refind.d/keys/refind_local.key], > [/etc/refind.d/keys/refind_local.cer]) > + fi > > AC_MSG_CHECKING(for module signing key) > AC_MSG_RESULT([$MODSIGN_PRIVFILE]) > -- > 2.21.0 > > |
From: Gerecke, J. <kil...@gm...> - 2019-04-09 22:17:24
|
From: Jason Gerecke <jas...@wa...> Previously we would rely on the 'mokutil' command to tell us if module signing was required, but the check (seeing if secure boot was enabled) isn't strictly correct and the utility may not exist anyway. This patch has us read through the kernel config to see what module signing options are enabled and reading the secure boot flag through a few interfaces that may be available. This should give us a more correct view of if module signing is actually required or not. Signed-off-by: Jason Gerecke <jas...@wa...> --- configure.ac | 59 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index 5353705..8a57293 100644 --- a/configure.ac +++ b/configure.ac @@ -277,17 +277,40 @@ AC_ARG_ENABLE(module-signing, [MODSIGN_ENABLE="$enableval"]) if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then - AC_MSG_CHECKING(kernel sig_enforce parameter) - SIG_KERNEL=$(cat /sys/module/module/parameters/sig_enforce 2>/dev/null || echo "(unknown)") - AC_MSG_RESULT([$SIG_KERNEL]) - - AC_MSG_CHECKING(mokutil sb-state) - SIG_MOK=$(mokutil --sb-state 2>/dev/null || echo "(unknown)") - AC_MSG_RESULT([$SIG_MOK]) - - SIG_REQUIRED=$(( $(echo "$SIG_KERNEL" | grep -q "Y" && echo "1" || echo "0") + \ - $(echo "$SIG_MOK" | grep -q "enabled" && echo "1" || echo "0") \ - )) + AC_MSG_CHECKING(CONFIG_MODULE_SIG) + MODSIGN_VERIFY=$(WACOM_LINUX_READ_CONFIG([CONFIG_MODULE_SIG])) + AC_MSG_RESULT([$MODSIGN_VERIFY]) + + AC_MSG_CHECKING(CONFIG_MODULE_SIG_FORCE) + MODSIGN_ENFORCE=$(WACOM_LINUX_READ_CONFIG([CONFIG_MODULE_SIG_FORCE])) + AC_MSG_RESULT([$MODSIGN_ENFORCE]) + + AC_MSG_CHECKING(CONFIG_LOCK_DOWN_KERNEL) + MODSIGN_LOCKDOWN=$(WACOM_LINUX_READ_CONFIG([CONFIG_LOCK_DOWN_KERNEL])) + AC_MSG_RESULT([$MODSIGN_LOCKDOWN]) + + AC_MSG_CHECKING(CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT) + MODSIGN_LOCKDOWN_EFI=$(WACOM_LINUX_READ_CONFIG([CONFIG_LOCK_DOWN_KERNEL_IN_EFI_SECURE_BOOT])) + AC_MSG_RESULT([$MODSIGN_LOCKDOWN_EFI]) + + AC_MSG_CHECKING(secure boot state) + SECUREBOOT_STATE="0" + test "$SECUREBOOT_STATE" = "1" || SECUREBOOT_STATE=$(efivar -d -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot 2>/dev/null) + test "$SECUREBOOT_STATE" = "1" || SECUREBOOT_STATE=$(hexdump -e '1/4 "%d"' /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c 2>/dev/null | tail -c1) + test "$SECUREBOOT_STATE" = "1" || SECUREBOOT_STATE=$(bootctl status 2>/dev/null | sed -n 's/\s*Secure Boot: enabled/1/p; s/\s*Secure Boot: disabled/0/p') + test "$SECUREBOOT_STATE" = "1" || SECUREBOOT_STATE=$(mokutil --sb-state 2>/dev/null | sed -n 's/SecureBoot enabled/1/p; s/SecureBoot disabled/0/p') + test "$SECUREBOOT_STATE" = "1" && SECUREBOOT_STATE="on" || SECUREBOOT_STATE="off" + AC_MSG_RESULT([$SECUREBOOT_STATE]) + + AC_MSG_CHECKING(if modules must be signed) + MODSIGN_REQUIRED="no" + if test "$MODSIGN_VERIFY" = "y" -o "$MODSIGN_LOCKDOWN" = "y" -o "$MODSIGN_LOCKDOWN_EFI"; then + MODSIGN_REQUIRED="recommended" + fi + if test "$MODSIGN_ENFORCE" = "y" -o \( "$MODSIGN_LOCKDOWN_EFI" = "y" -a "$SECUREBOOT_STATE" = "on" \); then + MODSIGN_REQUIRED="yes" + fi + AC_MSG_RESULT([$MODSIGN_REQUIRED]) @@ -335,14 +358,12 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then AC_MSG_CHECKING(for module signing certificate) AC_MSG_RESULT([$MODSIGN_CERTFILE]) - if test ! -f "$MODSIGN_PRIVFILE" -o ! -f "$MODSIGN_CERTFILE"; then - AC_MSG_WARN([Module signing key and/or certificate missing.]) - + if test -z "$MODSIGN_PRIVFILE" -o -z "$MODSIGN_CERTFILE"; then if test "$MODSIGN_ENABLE" = "yes"; then AC_MSG_ERROR([Unable to honor explicit request for module signing.]) fi - if test "$SIG_REQUIRED" -gt 0; then + if test "$MODSIGN_REQUIRED" = "yes"; then AC_MSG_ERROR([Kernel is configured to only load dnl signed modules but we are unable to produce a signed module. Either (1) dnl re-run configure with the options '--with-signing-key=<key>' and dnl @@ -350,7 +371,15 @@ re-run configure with the options '--with-signing-key=<key>' and dnl yourself by re-running configure with the '--disable-module-signing' dnl option set, or (3) disable the kernel's signed module requirement (e.g. dnl disable secure boot).]) + elif test "$MODSIGN_REQUIRED" = "recommended"; then + AC_MSG_WARN([Kernel module signing is recommended dnl +but we are unable to find signing keys. Consider re-running configure dnl +with the options '--with-signing-key=<key>' and dnl +'--with-signing-cert=<cert>' set.]) fi + elif test ! -f "$MODSIGN_PRIVFILE" -o ! -f "$MODSIGN_CERTFILE"; then + AC_MSG_WARN([Unable to read signing key or certificate. dnl +Please be sure the files exist before running "make install".]) fi fi -- 2.21.0 |
From: Gerecke, J. <kil...@gm...> - 2019-04-09 22:17:23
|
From: Jason Gerecke <jas...@wa...> The kernel will have a preferred signing algorithm that is defined in its config file. If none has been provided by the user, try to figure out what it is rather than just assuming sha512. Signed-off-by: Jason Gerecke <jas...@wa...> --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index bbcddaa..fa88ade 100644 --- a/configure.ac +++ b/configure.ac @@ -246,6 +246,7 @@ fi dnl ======================================================= dnl Module signing +AC_DEFUN([WACOM_LINUX_READ_CONFIG], [grep -sh '^$1=' $WCM_KERNEL_DIR/.config /boot/config-$MODUTS | head -n1 | cut -d= -f2- | sed -e 's/^"\(.*\)"$/\1/']) MODSIGN_ENABLE=default MODSIGN_HASHALGO= @@ -275,6 +276,11 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then AS_HELP_STRING([--with-hash-algorithm=<alg>], [Specify module signing hash algorithm]), [MODSIGN_HASHALGO="$withval"]) + if test "$MODSIGN_HASHALGO" = "yes" -o -z "$MODSIGN_HASHALGO"; then + AC_MSG_CHECKING(CONFIG_MODULE_SIG_HASH) + MODSIGN_HASHALGO=$(WACOM_LINUX_READ_CONFIG([CONFIG_MODULE_SIG_HASH])) + AC_MSG_RESULT([$MODSIGN_HASHALGO]) + fi if test "$MODSIGN_HASHALGO" = "yes" -o -z "$MODSIGN_HASHALGO"; then MODSIGN_HASHALGO="sha512" fi -- 2.21.0 |
From: Gerecke, J. <kil...@gm...> - 2019-04-09 22:17:23
|
From: Jason Gerecke <jas...@wa...> Previously we would only automatically discover Ubuntu's shim MOK if one had been created. We now also try to use the kernel's autogenerated key if present, and the key generated by rEFInd (though this may be inside a directory that only root can read from). Signed-off-by: Jason Gerecke <jas...@wa...> --- configure.ac | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index fa88ade..5353705 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,25 @@ dnl ======================================================= dnl Module signing AC_DEFUN([WACOM_LINUX_READ_CONFIG], [grep -sh '^$1=' $WCM_KERNEL_DIR/.config /boot/config-$MODUTS | head -n1 | cut -d= -f2- | sed -e 's/^"\(.*\)"$/\1/']) +AC_DEFUN([WACOM_LINUX_FILE_IF_EXISTS], [test -f "$1" && readlink -e "$1"]) + +AC_DEFUN([WACOM_LINUX_CHECK_KEYCERT], +if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then + AC_MSG_CHECKING(for $1 key at $2) + KEYFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$2])) + RESULT=$(test -z "$KEYFILE" && echo "no" || echo "yes") + AC_MSG_RESULT([$RESULT]) + AC_MSG_CHECKING(for $1 cert at $3) + CERTFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$3])) + RESULT=$(test -z "$CERTFILE" && echo "no" || echo "yes") + AC_MSG_RESULT([$RESULT]) + if test -n "$KEYFILE" -a -n "$CERTFILE"; then + MODSIGN_PRIVFILE="$KEYFILE" + MODSIGN_CERTFILE="$CERTFILE"; + fi +fi) + + MODSIGN_ENABLE=default MODSIGN_HASHALGO= MODSIGN_PRIVFILE= @@ -290,20 +309,6 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then - # There is no standard location for storing kernel signing keys - # and certificates. The kernel itself has CONFIG_MODULE_SIG_KEY - # (which contains a key and cert) which likely points to a file - # that doesn't exist unless you built the kernel yourself. Most - # distributions use the "shim" bootloader which allows "machine - # owner keys" (MOK) to be enrolled by the end-user, but only - # Ubuntu provides a tool to automatically generate these keys - # (`update-secureboot-policy --new-key`); other distros rely on - # the user generating the key/cert themselves and keeping it in a - # suitably-safe location. - # - # The kernel should automatically try to sign modules as part of - # the `make modules_install` step, so that covers the first case. - # In the second case the best we can do is try Ubuntu's location. AC_ARG_WITH(signing-key, AS_HELP_STRING([--with-signing-key=<trusted.priv>], [Specify module signing key location]), [MODSIGN_PRIVFILE="$withval"]) @@ -311,12 +316,19 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then AS_HELP_STRING([--with-signing-cert=<trusted.der>], [Specify module signing cert location]), [MODSIGN_CERTFILE="$withval"]) - if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then - MODSIGN_PRIVFILE=$(ls /var/lib/shim-signed/mok/MOK.priv 2>/dev/null || echo "$MODSIGN_PRIVFILE") - fi - if test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE"; then - MODSIGN_CERTFILE=$(ls /var/lib/shim-signed/mok/MOK.der 2>/dev/null || echo "$MODSIGN_CERTFILE") - fi + HASPRIVFILE=$(test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE" && echo 0 || echo 1) + HASCERTFILE=$(test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE" && echo 0 || echo 1) + if test "$HASPRIVFILE" -ne "$HASCERTFILE"; then + AC_MSG_ERROR([Options '--with-signing-key' and '--with-signing-cert' must either both be set or both be unset.]) + elif test "$HASPRIVFILE" -eq 1; then + # Try to get absolute path, if possible + MODSIGN_PRIVFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$MODSIGN_PRIVFILE]) || echo "$MODSIGN_PRIVFILE") + MODSIGN_CERTFILE=$(WACOM_LINUX_FILE_IF_EXISTS([$MODSIGN_CERTFILE]) || echo "$MODSIGN_PRIVFILE") + else + WACOM_LINUX_CHECK_KEYCERT([kernel autogenerated], $WCM_KERNEL_DIR/$(WACOM_LINUX_READ_CONFIG([CONFIG_MODULE_SIG_KEY])), [$WCM_KERNEL_DIR/certs/signing_key.x509]) + WACOM_LINUX_CHECK_KEYCERT([shim MOK], [/var/lib/shim-signed/mok/MOK.priv], [/var/lib/shim-signed/mok/MOK.der]) + WACOM_LINUX_CHECK_KEYCERT([rEFInd MOK], [/etc/refind.d/keys/refind_local.key], [/etc/refind.d/keys/refind_local.cer]) + fi AC_MSG_CHECKING(for module signing key) AC_MSG_RESULT([$MODSIGN_PRIVFILE]) -- 2.21.0 |
From: Gerecke, J. <kil...@gm...> - 2019-04-09 22:17:22
|
From: Jason Gerecke <jas...@wa...> Move most of the logic related to module signing inside of the relevant 'if' block. Explicitly disbling module signing should now skip these checks. Signed-off-by: Jason Gerecke <jas...@wa...> --- configure.ac | 57 ++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index 125589a..bbcddaa 100644 --- a/configure.ac +++ b/configure.ac @@ -247,18 +247,6 @@ fi dnl ======================================================= dnl Module signing -AC_MSG_CHECKING(kernel sig_enforce parameter) -SIG_KERNEL=$(cat /sys/module/module/parameters/sig_enforce 2>/dev/null || echo "(unknown)") -AC_MSG_RESULT([$SIG_KERNEL]) - -AC_MSG_CHECKING(mokutil sb-state) -SIG_MOK=$(mokutil --sb-state 2>/dev/null || echo "(unknown)") -AC_MSG_RESULT([$SIG_MOK]) - -SIG_REQUIRED=$(( $(echo "$SIG_KERNEL" | grep -q "Y" && echo "1" || echo "0") + \ - $(echo "$SIG_MOK" | grep -q "enabled" && echo "1" || echo "0") \ - )) - MODSIGN_ENABLE=default MODSIGN_HASHALGO= MODSIGN_PRIVFILE= @@ -267,21 +255,35 @@ MODSIGN_CERTFILE= AC_ARG_ENABLE(module-signing, AS_HELP_STRING([--disable-module-signing], [Disable automatic module signing]), [MODSIGN_ENABLE="$enableval"]) -AC_ARG_WITH(hash-algorithm, - AS_HELP_STRING([--with-hash-algorithm=<alg>], [Specify module signing hash algorithm]), - [MODSIGN_HASHALGO="$withval"]) -AC_ARG_WITH(signing-key, - AS_HELP_STRING([--with-signing-key=<trusted.priv>], [Specify module signing key location]), - [MODSIGN_PRIVFILE="$withval"]) -AC_ARG_WITH(signing-cert, - AS_HELP_STRING([--with-signing-cert=<trusted.der>], [Specify module signing cert location]), - [MODSIGN_CERTFILE="$withval"]) if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then + AC_MSG_CHECKING(kernel sig_enforce parameter) + SIG_KERNEL=$(cat /sys/module/module/parameters/sig_enforce 2>/dev/null || echo "(unknown)") + AC_MSG_RESULT([$SIG_KERNEL]) + + AC_MSG_CHECKING(mokutil sb-state) + SIG_MOK=$(mokutil --sb-state 2>/dev/null || echo "(unknown)") + AC_MSG_RESULT([$SIG_MOK]) + + SIG_REQUIRED=$(( $(echo "$SIG_KERNEL" | grep -q "Y" && echo "1" || echo "0") + \ + $(echo "$SIG_MOK" | grep -q "enabled" && echo "1" || echo "0") \ + )) + + + + AC_ARG_WITH(hash-algorithm, + AS_HELP_STRING([--with-hash-algorithm=<alg>], [Specify module signing hash algorithm]), + [MODSIGN_HASHALGO="$withval"]) + if test "$MODSIGN_HASHALGO" = "yes" -o -z "$MODSIGN_HASHALGO"; then MODSIGN_HASHALGO="sha512" fi + AC_MSG_CHECKING(for module signing hash algorithm) + AC_MSG_RESULT([$MODSIGN_HASHALGO]) + + + # There is no standard location for storing kernel signing keys # and certificates. The kernel itself has CONFIG_MODULE_SIG_KEY # (which contains a key and cert) which likely points to a file @@ -296,6 +298,12 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then # The kernel should automatically try to sign modules as part of # the `make modules_install` step, so that covers the first case. # In the second case the best we can do is try Ubuntu's location. + AC_ARG_WITH(signing-key, + AS_HELP_STRING([--with-signing-key=<trusted.priv>], [Specify module signing key location]), + [MODSIGN_PRIVFILE="$withval"]) + AC_ARG_WITH(signing-cert, + AS_HELP_STRING([--with-signing-cert=<trusted.der>], [Specify module signing cert location]), + [MODSIGN_CERTFILE="$withval"]) if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then MODSIGN_PRIVFILE=$(ls /var/lib/shim-signed/mok/MOK.priv 2>/dev/null || echo "$MODSIGN_PRIVFILE") @@ -304,8 +312,6 @@ if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then MODSIGN_CERTFILE=$(ls /var/lib/shim-signed/mok/MOK.der 2>/dev/null || echo "$MODSIGN_CERTFILE") fi - AC_MSG_CHECKING(for module signing hash algorithm) - AC_MSG_RESULT([$MODSIGN_HASHALGO]) AC_MSG_CHECKING(for module signing key) AC_MSG_RESULT([$MODSIGN_PRIVFILE]) AC_MSG_CHECKING(for module signing certificate) @@ -328,11 +334,6 @@ option set, or (3) disable the kernel's signed module requirement (e.g. dnl disable secure boot).]) fi fi -else - # Make sure we don't pass these along via AC_SUBST - MODSIGN_HASHALGO= - MODSIGN_PRIVFILE= - MODSIGN_CERTFILE= fi -- 2.21.0 |
From: Gerecke, J. <kil...@gm...> - 2019-04-09 22:17:19
|
From: Jason Gerecke <jas...@wa...> The kernel tries to sign files as part of 'make modules_install', so we might as well go along with the flow and let it handle things. Some users get confused by the error messages that it produces when signing fails (e.g. because there is no key), so we short-circuit its signing command when signing is not possible. Signed-off-by: Jason Gerecke <jas...@wa...> --- 3.17/Makefile.in | 19 +++++++++++++------ 3.7/Makefile.in | 19 +++++++++++++------ 4.5/Makefile.in | 19 +++++++++++++------ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/3.17/Makefile.in b/3.17/Makefile.in index 7077d8c..b25b2a1 100644 --- a/3.17/Makefile.in +++ b/3.17/Makefile.in @@ -33,6 +33,15 @@ MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ +MODSIGN_COMMAND := +ifneq ($(strip $(MODSIGN_HASHALGO)),) +ifneq ($(strip $(MODSIGN_PRIVFILE)),) +ifneq ($(strip $(MODSIGN_CERTFILE)),) +MODSIGN_COMMAND := "$(WCM_KERNEL_DIR)/scripts/sign-file" "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" +endif +endif +endif + all: @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) kernel.' $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) @@ -41,13 +50,11 @@ clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean signature: all - if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ - fi + $(MODSIGN_COMMAND) wacom.ko + $(MODSIGN_COMMAND) wacom_w8001.ko -install modules_install: signature - $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install +install modules_install: + $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mod_sign_cmd='$(MODSIGN_COMMAND)' mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS) diff --git a/3.7/Makefile.in b/3.7/Makefile.in index 7b3290a..a623d6d 100644 --- a/3.7/Makefile.in +++ b/3.7/Makefile.in @@ -25,6 +25,15 @@ MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ +MODSIGN_COMMAND := +ifneq ($(strip $(MODSIGN_HASHALGO)),) +ifneq ($(strip $(MODSIGN_PRIVFILE)),) +ifneq ($(strip $(MODSIGN_CERTFILE)),) +MODSIGN_COMMAND := "$(WCM_KERNEL_DIR)/scripts/sign-file" "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" +endif +endif +endif + all: @echo ' Building input-wacom drivers for $(WCM_VERSION_VER) kernel.' $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) @@ -33,13 +42,11 @@ clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean signature: all - if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ - fi + $(MODSIGN_COMMAND) wacom.ko + $(MODSIGN_COMMAND) wacom_w8001.ko -install modules_install: signature - $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install +install modules_install: + $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mod_sign_cmd='$(MODSIGN_COMMAND)' mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS) diff --git a/4.5/Makefile.in b/4.5/Makefile.in index dd89344..987cc40 100644 --- a/4.5/Makefile.in +++ b/4.5/Makefile.in @@ -26,6 +26,15 @@ MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ +MODSIGN_COMMAND := +ifneq ($(strip $(MODSIGN_HASHALGO)),) +ifneq ($(strip $(MODSIGN_PRIVFILE)),) +ifneq ($(strip $(MODSIGN_CERTFILE)),) +MODSIGN_COMMAND := "$(WCM_KERNEL_DIR)/scripts/sign-file" "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" +endif +endif +endif + all: @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) kernel.' $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) @@ -34,13 +43,11 @@ clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean signature: all - if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ - fi + $(MODSIGN_COMMAND) wacom.ko + $(MODSIGN_COMMAND) wacom_w8001.ko -install modules_install: signature - $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install +install modules_install: + $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mod_sign_cmd='$(MODSIGN_COMMAND)' mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS) -- 2.21.0 |
From: Gerecke, J. <kil...@gm...> - 2019-04-09 22:17:17
|
From: Jason Gerecke <jas...@wa...> The upstream Linux kernel did not support module signing (or have the "sign-file" utility) until verison 3.7. RHEL 6 does support signing, but uses a non-standard method involving signing with GPG keys that we do not support. Signed-off-by: Jason Gerecke <jas...@wa...> --- 2.6.32/Makefile.in | 8 +------- 2.6.38/Makefile.in | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in index 43ae05a..ff3d4ef 100644 --- a/2.6.32/Makefile.in +++ b/2.6.32/Makefile.in @@ -38,13 +38,7 @@ all: clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean -signature: all - if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ - fi - -install modules_install: signature +install modules_install: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf diff --git a/2.6.38/Makefile.in b/2.6.38/Makefile.in index 4779420..8e68915 100644 --- a/2.6.38/Makefile.in +++ b/2.6.38/Makefile.in @@ -31,13 +31,7 @@ all: clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean -signature: all - if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ - $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ - fi - -install modules_install: signature +install modules_install: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf -- 2.21.0 |
From: Jason G. <kil...@gm...> - 2019-01-24 18:18:25
|
Commit 260ee967a0 added a call to the "AM_EXTRA_RECURSIVE_TARGETS" macro in order to add "signature" as a recursive makefile target. This allows users to run `make signature` from the top-level directory rather than requring them to first change into the build directory for their kernel. Unfortunately, "AM_EXTRA_RECURSIVE_TARGETS" is not available on RHEL 6 since it requires Automake 1.13. This prevents our driver from building from a git checkout on the OS (the tarball continues to work fine). To address this, we now only conditionally use the macro. If a RHEL 6 user builds from git (not a tarball), the `make signature` step will not work unless they first change into the 2.6.32 directory. Fixes: 260ee967a0 ("Add support for kernel module signing and enforcement") Signed-off-by: Jason Gerecke <jas...@wa...> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1830b75..125589a 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign]) -AM_EXTRA_RECURSIVE_TARGETS([signature]) +m4_ifdef([AM_EXTRA_RECURSIVE], AM_EXTRA_RECURSIVE_TARGETS([signature])) AM_MAINTAINER_MODE AC_PROG_CC -- 2.20.1 |
From: Jason G. <kil...@gm...> - 2019-01-14 18:28:39
|
From: Ping Cheng <pin...@wa...> Update configure.ac to include them into RHEL 6.10+ and 7.4+ paths. Signed-off-by: Ping Cheng <pin...@wa...> Signed-off-by: Jason Gerecke <jas...@wa...> --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 5ea344c..1830b75 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,7 @@ WCM_ENV_KERNEL="yes" dnl Check for RedHat entreprise Linux >= 6.9 AC_MSG_CHECKING(RHEL6 minor release) -RHEL6_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise Linux\|CentOS\) .*release 6.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] +RHEL6_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise Linux\|Scientific Linux\|CentOS\) .*release 6.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] dnl RHEL6_RELEASE="" if test "$RHEL6_RELEASE" = ""; then RHEL6_RELEASE="0" @@ -120,7 +120,7 @@ AC_MSG_RESULT([$RHEL6_RELEASE]) dnl Check for RedHat entreprise Linux >= 7.4 AC_MSG_CHECKING(RHEL7 minor release) -RHEL7_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise\|CentOS\) Linux .*release 7.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] +RHEL7_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise\|Scientific\|CentOS\) Linux .*release 7.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] dnl RHEL7_RELEASE="" if test "$RHEL7_RELEASE" = ""; then RHEL7_RELEASE="0" -- 2.20.1 |
From: Jason G. <kil...@gm...> - 2019-01-14 18:28:37
|
From: Ping Cheng <pin...@wa...> The driver included with RHEL 6.10 includes support for a few devices that aren't supported by this input-wacom driver and vice-versa. For example, RHEL supports the EKR but not the Cintiq Pro 32 while input-wacom supports the 32 but not the EKR. This is a problem if you want to use both the 32 and the EKR (or other combination of devices that aren't both supported by one of the drivers). As a workaround, we will have input-wacom install as a driver named "wacom-ot" rather than "wacom" when a RHEL 6.10 system is detected. This driver will *only* support devices that aren't already supported by the existing RHEL driver. This isn't ideal, but the proper fix (backporting EKR and others) is more work than we're prepared to undertake at this point in time. Signed-off-by: Ping Cheng <pin...@wa...> Signed-off-by: Jason Gerecke <jas...@wa...> --- 2.6.32/Makefile.in | 14 ++++++++++---- 2.6.32/wacom_sys.c | 7 ++++++- 2.6.32/wacom_wac.c | 10 ++++++++++ configure.ac | 12 ++++++++++++ 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in index 6290771..43ae05a 100644 --- a/2.6.32/Makefile.in +++ b/2.6.32/Makefile.in @@ -4,11 +4,18 @@ ifneq ($(KERNELRELEASE),) # Do NOT indent stuff in this part! It has to be like this to make the # $(error ... ) stuff work +RHEL6_RELEASE := @RHEL6_RELEASE@ +WCM_OT_NAME := "" + ifneq ($(CONFIG_USB_WACOM),y) WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen) ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) -wacom-objs := wacom_wac.o wacom_sys.o -obj-m += wacom.o + ifeq ($(RHEL6_RELEASE),10) + WCM_OT_NAME := -ot + ccflags-y += -DRHEL6_RELEASE + endif # RHEL6_RELEASE +wacom$(WCM_OT_NAME)-objs := wacom_wac.o wacom_sys.o +obj-m += wacom$(WCM_OT_NAME).o obj-m += wacom_w8001.o else $(error You requested to build wacom with configure, but wacom is configured as built-in in your kernel config) @@ -48,8 +55,7 @@ uninstall: @# which causes trouble for tools like 'rm' which don't @# see the path how you might think. As a workaround, @# first cd into the directory and then remove. - cd $(WCM_KERNEL_DIR)/../extra; rm wacom.ko* - cd $(WCM_KERNEL_DIR)/../extra; rm wacom_w8001.ko* + cd $(WCM_KERNEL_DIR)/../extra; rm wacom*.ko* rm -f /etc/depmod.d/input-wacom.conf PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS) diff --git a/2.6.32/wacom_sys.c b/2.6.32/wacom_sys.c index 5ca4c61..4a1fb70 100644 --- a/2.6.32/wacom_sys.c +++ b/2.6.32/wacom_sys.c @@ -39,6 +39,11 @@ #define HID_COLLECTION_END 0xc0 #define HID_LONGITEM 0xfc +#ifdef RHEL6_RELEASE +#define wacom_driver_name "wacom-ot" +#else +#define wacom_driver_name "wacom" +#endif enum { WCM_UNDEFINED = 0, @@ -1088,7 +1093,7 @@ static int wacom_reset_resume(struct usb_interface *intf) } static struct usb_driver wacom_driver = { - .name = "wacom", + .name = wacom_driver_name, .id_table = wacom_ids, .probe = wacom_probe, .disconnect = wacom_disconnect, diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c index c4705f8..dfb4ed3 100644 --- a/2.6.32/wacom_wac.c +++ b/2.6.32/wacom_wac.c @@ -2484,6 +2484,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, wacom_setup_numbered_buttons(input_dev, numbered_buttons); } +#ifndef RHEL6_RELEASE static const struct wacom_features wacom_features_0x00 = { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, 0, PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; @@ -2966,6 +2967,7 @@ static const struct wacom_features wacom_features_0x34E = WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34B }; +#endif /* RHEL6_RELEASE */ static const struct wacom_features wacom_features_0x34F = { "Wacom Cintiq Pro 13 FHD", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63, WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, @@ -3031,12 +3033,14 @@ static const struct wacom_features wacom_features_0x376 = static const struct wacom_features wacom_features_0x378 = { "Intuos BT M", WACOM_PKGLEN_INTUOSP2, 21600, 13500, 4095, 63, INTUOSHT3, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; +#ifndef RHEL6_RELEASE static const struct wacom_features wacom_features_0x37A = { "Wacom One by Wacom S", WACOM_PKGLEN_BBPEN, 15200, 9500, 2047, 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; static const struct wacom_features wacom_features_0x37B = { "Wacom One by Wacom M", WACOM_PKGLEN_BBPEN, 21600, 13500, 2047, 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; +#endif /* RHEL6_RELEASE */ static const struct wacom_features wacom_features_0x37C = { "Wacom Cintiq Pro 24", WACOM_PKGLEN_MSPRO, 105286, 59574, 8191, 63, /* Pen-only */ WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, @@ -3072,6 +3076,7 @@ static const struct wacom_features wacom_features_0x382 = .driver_info = (kernel_ulong_t)&wacom_features_##prod const struct usb_device_id wacom_ids[] = { +#ifndef RHEL6_RELEASE { USB_DEVICE_WACOM(0x00) }, { USB_DEVICE_WACOM(0x03) }, { USB_DEVICE_WACOM(0x10) }, @@ -3215,6 +3220,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x34B) }, { USB_DEVICE_WACOM(0x34D) }, { USB_DEVICE_WACOM(0x34E) }, +#endif /* RHEL6_RELEASE */ { USB_DEVICE_WACOM(0x34F) }, { USB_DEVICE_WACOM(0x350) }, { USB_DEVICE_WACOM(0x351) }, @@ -3232,12 +3238,15 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x375) }, { USB_DEVICE_WACOM(0x376) }, { USB_DEVICE_WACOM(0x378) }, +#ifndef RHEL6_RELEASE { USB_DEVICE_WACOM(0x37A) }, { USB_DEVICE_WACOM(0x37B) }, +#endif /* RHEL6_RELEASE */ { USB_DEVICE_WACOM(0x37C) }, { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, +#ifndef RHEL6_RELEASE { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, @@ -3248,6 +3257,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x5048) }, { USB_DEVICE_WACOM(0x5090) }, { USB_DEVICE_LENOVO(0x6004) }, +#endif /* RHEL6_RELEASE */ { } }; MODULE_DEVICE_TABLE(usb, wacom_ids); diff --git a/configure.ac b/configure.ac index 52386d5..5ea344c 100644 --- a/configure.ac +++ b/configure.ac @@ -107,6 +107,17 @@ package and try again.]) fi WCM_ENV_KERNEL="yes" +dnl Check for RedHat entreprise Linux >= 6.9 +AC_MSG_CHECKING(RHEL6 minor release) +RHEL6_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise Linux\|CentOS\) .*release 6.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] +dnl RHEL6_RELEASE="" +if test "$RHEL6_RELEASE" = ""; then + RHEL6_RELEASE="0" +elif test "$RHEL6_RELEASE" -ge "9"; then + RHEL6_RELEASE="10" +fi +AC_MSG_RESULT([$RHEL6_RELEASE]) + dnl Check for RedHat entreprise Linux >= 7.4 AC_MSG_CHECKING(RHEL7 minor release) RHEL7_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise\|CentOS\) Linux .*release 7.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] @@ -331,6 +342,7 @@ echo WCM_SRC_SUBDIRS=". $WCM_KERNEL_VER" AC_SUBST(WCM_KERNEL_DIR) AC_SUBST(WCM_KERNEL_VER) +AC_SUBST(RHEL6_RELEASE) AC_SUBST(RHEL7_RELEASE) AC_SUBST(MODUTS) AC_SUBST(MODSIGN_HASHALGO) -- 2.20.1 |
From: Jason G. <kil...@gm...> - 2019-01-14 18:28:36
|
From: Ping Cheng <pin...@wa...> Add missed .touch_max = 10 to their feature structure. Signed-off-by: Ping Cheng <pin...@wa...> Signed-off-by: Jason Gerecke <jas...@wa...> --- 2.6.32/wacom_wac.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c index dfb4ed3..7df47fb 100644 --- a/2.6.32/wacom_wac.c +++ b/2.6.32/wacom_wac.c @@ -2951,10 +2951,10 @@ static const struct wacom_features wacom_features_0x343 = WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; static const struct wacom_features wacom_features_0x34A = { "Wacom MobileStudio Pro 13 Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, /* Touch */ - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D }; + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D, .touch_max = 10 }; static const struct wacom_features wacom_features_0x34B = { "Wacom MobileStudio Pro 16 Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, /* Touch */ - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E }; + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E, .touch_max = 10 }; static const struct wacom_features wacom_features_0x34D = { "Wacom MobileStudio Pro 13", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63, WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11, @@ -2994,10 +2994,10 @@ static const struct wacom_features wacom_features_0x352 = .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x356 }; static const struct wacom_features wacom_features_0x353 = { "Wacom Cintiq Pro 13FHD Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f }; /* Touch */ + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f, .touch_max = 10 }; /* Touch */ static const struct wacom_features wacom_features_0x354 = { "Wacom Cintiq Pro 16UHD Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350 }; /* Touch */ + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350, .touch_max = 10 }; /* Touch */ static const struct wacom_features wacom_features_0x355 = { "Wacom Cintiq Pro 24 Touch", WACOM_PKGLEN_27QHDT, .type = WACOM_27QHDT, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x351, .touch_max = 10 }; /* Touch */ -- 2.20.1 |
From: Peter H. <pet...@wh...> - 2019-01-11 03:19:25
|
On Thu, Jan 10, 2019 at 10:40:15AM -0800, Aaron Armstrong Skomra wrote: > Signed-off-by: Aaron Skomra <aar...@wa...> > Reviewed-by: Ping Cheng <pin...@wa...> pushed, thanks Cheers, Peter > --- > data/cintiq-16.tablet | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > create mode 100644 data/cintiq-16.tablet > > diff --git a/data/cintiq-16.tablet b/data/cintiq-16.tablet > new file mode 100644 > index 000000000000..e9abbf2771a3 > --- /dev/null > +++ b/data/cintiq-16.tablet > @@ -0,0 +1,20 @@ > +# Wacom > +# Cintiq 16 > +# DTK-1660 > + > +[Device] > +Name=Wacom Cintiq 16 > +Class=Cintiq > +DeviceMatch=usb:056a:0390 > +Width=14 > +Height=8 > +# No pad buttons, so no layout > +Styli=0x842;0x84a;0x160802;0x16080a;0x100802;0x10080a;0x140802;0x14080a;0x120802;0x100804;0x10080c;0x100902;0x10090a;0x80842 > +IntegratedIn=Display > + > +[Features] > +Stylus=true > +Reversible=false > +Touch=false > +Ring=false > +Buttons=0 > -- > 2.7.4 > > > > _______________________________________________ > Linuxwacom-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel |
From: Aaron A. S. <sk...@gm...> - 2019-01-10 18:40:30
|
Signed-off-by: Aaron Skomra <aar...@wa...> Reviewed-by: Ping Cheng <pin...@wa...> --- data/cintiq-16.tablet | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 data/cintiq-16.tablet diff --git a/data/cintiq-16.tablet b/data/cintiq-16.tablet new file mode 100644 index 000000000000..e9abbf2771a3 --- /dev/null +++ b/data/cintiq-16.tablet @@ -0,0 +1,20 @@ +# Wacom +# Cintiq 16 +# DTK-1660 + +[Device] +Name=Wacom Cintiq 16 +Class=Cintiq +DeviceMatch=usb:056a:0390 +Width=14 +Height=8 +# No pad buttons, so no layout +Styli=0x842;0x84a;0x160802;0x16080a;0x100802;0x10080a;0x140802;0x14080a;0x120802;0x100804;0x10080c;0x100902;0x10090a;0x80842 +IntegratedIn=Display + +[Features] +Stylus=true +Reversible=false +Touch=false +Ring=false +Buttons=0 -- 2.7.4 |
From: Aaron A. S. <sk...@gm...> - 2019-01-10 18:13:13
|
Signed-off-by: Aaron Armstrong Skomra <aar...@wa...> Reviewed-by: Ping Cheng <pin...@wa...> --- 2.6.32/wacom_wac.c | 12 +++++++++++- 2.6.32/wacom_wac.h | 1 + 2.6.38/wacom_wac.c | 12 +++++++++++- 2.6.38/wacom_wac.h | 1 + 3.7/wacom_wac.c | 12 +++++++++++- 3.7/wacom_wac.h | 1 + 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c index c4705f839173..c5744573b085 100644 --- a/2.6.32/wacom_wac.c +++ b/2.6.32/wacom_wac.c @@ -1935,6 +1935,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) sync = wacom_multitouch_generic(wacom_wac); @@ -2232,10 +2233,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, break; case WACOM_MSPRO: + case CINTIQ_16: input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); __set_bit(BTN_STYLUS3, input_dev->keybit); - if (features->numbered_buttons == 0) { /* Cintiq Pro */ + if (features->type == WACOM_MSPRO && + features->numbered_buttons == 0) { /* Cintiq Pro */ __set_bit(KEY_CONTROLPANEL, input_dev->keybit); __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); @@ -3057,6 +3060,12 @@ static const struct wacom_features wacom_features_0x382 = 0, DTK2451, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; +static const struct wacom_features wacom_features_0x390 = + { "Wacom Cintiq 16", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63, + CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + .oVid = USB_VENDOR_ID_WACOM }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3238,6 +3247,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, + { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/2.6.32/wacom_wac.h b/2.6.32/wacom_wac.h index 56dcea362f13..45e865bbf5ac 100755 --- a/2.6.32/wacom_wac.h +++ b/2.6.32/wacom_wac.h @@ -115,6 +115,7 @@ enum { DTK, WACOM_24HD, WACOM_MSPRO, + CINTIQ_16, CINTIQ, WACOM_BEE, WACOM_13HD, diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c index 2e090cf9a06f..a985a21c6c07 100644 --- a/2.6.38/wacom_wac.c +++ b/2.6.38/wacom_wac.c @@ -2139,6 +2139,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) sync = wacom_multitouch_generic(wacom_wac); @@ -2479,11 +2480,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, break; case WACOM_MSPRO: + case CINTIQ_16: input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); __set_bit(BTN_STYLUS3, input_dev->keybit); __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); - if (features->numbered_buttons == 0) { /* Cintiq Pro */ + if (features->type == WACOM_MSPRO && + features->numbered_buttons == 0) { /* Cintiq Pro */ __set_bit(KEY_CONTROLPANEL, input_dev->keybit); __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); @@ -3410,6 +3413,12 @@ static const struct wacom_features wacom_features_0x382 = 0, DTK2451, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; +static const struct wacom_features wacom_features_0x390 = + { "Wacom Cintiq 16", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63, + CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + .oVid = USB_VENDOR_ID_WACOM }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3599,6 +3608,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, + { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/2.6.38/wacom_wac.h b/2.6.38/wacom_wac.h index 08e826143050..c2e337d41427 100644 --- a/2.6.38/wacom_wac.h +++ b/2.6.38/wacom_wac.h @@ -130,6 +130,7 @@ enum { CINTIQ_HYBRID, CINTIQ_COMPANION_2, WACOM_MSPRO, + CINTIQ_16, CINTIQ, WACOM_BEE, WACOM_13HD, diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c index f255f8cfabf5..8dbb9eac513d 100644 --- a/3.7/wacom_wac.c +++ b/3.7/wacom_wac.c @@ -2121,6 +2121,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) sync = wacom_multitouch_generic(wacom_wac); @@ -2450,11 +2451,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, break; case WACOM_MSPRO: + case CINTIQ_16: input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); __set_bit(BTN_STYLUS3, input_dev->keybit); __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); - if (features->numbered_buttons == 0) { /* Cintiq Pro */ + if (features->type == WACOM_MSPRO && + features->numbered_buttons == 0) { /* Cintiq Pro */ __set_bit(KEY_CONTROLPANEL, input_dev->keybit); __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); @@ -3340,6 +3343,12 @@ static const struct wacom_features wacom_features_0x382 = 0, DTK2451, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; +static const struct wacom_features wacom_features_0x390 = + { "Wacom Cintiq 16", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63, + CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + .oVid = USB_VENDOR_ID_WACOM }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3529,6 +3538,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, + { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/3.7/wacom_wac.h b/3.7/wacom_wac.h index 1a8714f9febe..da7387a3bee2 100644 --- a/3.7/wacom_wac.h +++ b/3.7/wacom_wac.h @@ -130,6 +130,7 @@ enum { CINTIQ_HYBRID, CINTIQ_COMPANION_2, WACOM_MSPRO, + CINTIQ_16, CINTIQ, WACOM_BEE, WACOM_13HD, -- 2.7.4 |
From: Aaron A. S. <sk...@gm...> - 2019-01-10 18:06:35
|
Signed-off-by: Aaron Armstrong Skomra <aar...@wa...> Reviewed-by: Ping Cheng <pin...@wa...> --- 2.6.32/wacom_wac.c | 12 +++++++++++- 2.6.32/wacom_wac.h | 1 + 2.6.38/wacom_wac.c | 12 +++++++++++- 2.6.38/wacom_wac.h | 1 + 3.7/wacom_wac.c | 12 +++++++++++- 3.7/wacom_wac.h | 1 + 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c index c4705f839173..c5744573b085 100644 --- a/2.6.32/wacom_wac.c +++ b/2.6.32/wacom_wac.c @@ -1935,6 +1935,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) sync = wacom_multitouch_generic(wacom_wac); @@ -2232,10 +2233,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, break; case WACOM_MSPRO: + case CINTIQ_16: input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); __set_bit(BTN_STYLUS3, input_dev->keybit); - if (features->numbered_buttons == 0) { /* Cintiq Pro */ + if (features->type == WACOM_MSPRO && + features->numbered_buttons == 0) { /* Cintiq Pro */ __set_bit(KEY_CONTROLPANEL, input_dev->keybit); __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); @@ -3057,6 +3060,12 @@ static const struct wacom_features wacom_features_0x382 = 0, DTK2451, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; +static const struct wacom_features wacom_features_0x390 = + { "Wacom Cintiq 16", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63, + CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + .oVid = USB_VENDOR_ID_WACOM }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3238,6 +3247,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, + { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/2.6.32/wacom_wac.h b/2.6.32/wacom_wac.h index 56dcea362f13..45e865bbf5ac 100755 --- a/2.6.32/wacom_wac.h +++ b/2.6.32/wacom_wac.h @@ -115,6 +115,7 @@ enum { DTK, WACOM_24HD, WACOM_MSPRO, + CINTIQ_16, CINTIQ, WACOM_BEE, WACOM_13HD, diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c index 2e090cf9a06f..a985a21c6c07 100644 --- a/2.6.38/wacom_wac.c +++ b/2.6.38/wacom_wac.c @@ -2139,6 +2139,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) sync = wacom_multitouch_generic(wacom_wac); @@ -2479,11 +2480,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, break; case WACOM_MSPRO: + case CINTIQ_16: input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); __set_bit(BTN_STYLUS3, input_dev->keybit); __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); - if (features->numbered_buttons == 0) { /* Cintiq Pro */ + if (features->type == WACOM_MSPRO && + features->numbered_buttons == 0) { /* Cintiq Pro */ __set_bit(KEY_CONTROLPANEL, input_dev->keybit); __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); @@ -3410,6 +3413,12 @@ static const struct wacom_features wacom_features_0x382 = 0, DTK2451, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; +static const struct wacom_features wacom_features_0x390 = + { "Wacom Cintiq 16", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63, + CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + .oVid = USB_VENDOR_ID_WACOM }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3599,6 +3608,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, + { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/2.6.38/wacom_wac.h b/2.6.38/wacom_wac.h index 08e826143050..c2e337d41427 100644 --- a/2.6.38/wacom_wac.h +++ b/2.6.38/wacom_wac.h @@ -130,6 +130,7 @@ enum { CINTIQ_HYBRID, CINTIQ_COMPANION_2, WACOM_MSPRO, + CINTIQ_16, CINTIQ, WACOM_BEE, WACOM_13HD, diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c index f255f8cfabf5..8dbb9eac513d 100644 --- a/3.7/wacom_wac.c +++ b/3.7/wacom_wac.c @@ -2121,6 +2121,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) case WACOM_MSPRO: case INTUOSP2: + case CINTIQ_16: if (len == WACOM_PKGLEN_INTUOSP2T && wacom_wac->data[0] == WACOM_REPORT_VENDOR_DEF_TOUCH) sync = wacom_multitouch_generic(wacom_wac); @@ -2450,11 +2451,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, break; case WACOM_MSPRO: + case CINTIQ_16: input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); __set_bit(BTN_STYLUS3, input_dev->keybit); __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); - if (features->numbered_buttons == 0) { /* Cintiq Pro */ + if (features->type == WACOM_MSPRO && + features->numbered_buttons == 0) { /* Cintiq Pro */ __set_bit(KEY_CONTROLPANEL, input_dev->keybit); __set_bit(KEY_ONSCREEN_KEYBOARD, input_dev->keybit); __set_bit(KEY_BUTTONCONFIG, input_dev->keybit); @@ -3340,6 +3343,12 @@ static const struct wacom_features wacom_features_0x382 = 0, DTK2451, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; +static const struct wacom_features wacom_features_0x390 = + { "Wacom Cintiq 16", WACOM_PKGLEN_MSPRO, 69632, 39518, 8191, 63, + CINTIQ_16, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, + .oVid = USB_VENDOR_ID_WACOM }; #define USB_DEVICE_WACOM(prod) \ USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ @@ -3529,6 +3538,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, + { USB_DEVICE_DETAILED(0x390, USB_CLASS_HID, 0, 0) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/3.7/wacom_wac.h b/3.7/wacom_wac.h index 1a8714f9febe..da7387a3bee2 100644 --- a/3.7/wacom_wac.h +++ b/3.7/wacom_wac.h @@ -130,6 +130,7 @@ enum { CINTIQ_HYBRID, CINTIQ_COMPANION_2, WACOM_MSPRO, + CINTIQ_16, CINTIQ, WACOM_BEE, WACOM_13HD, -- 2.7.4 |
From: Jason G. <kil...@gm...> - 2019-01-02 22:59:09
|
Looks good, but I have a few requests: On Wed, Dec 12, 2018 at 5:05 PM Ping Cheng <pin...@gm...> wrote: > > Make those devices not supported by RHEL 6.10 into wacom-ot.ko so > both drivers can live happily together ;). > > Signed-off-by: Ping Cheng <pin...@wa...> > --- > 2.6.32/Makefile.in | 17 ++++++++++++----- > 2.6.32/wacom_sys.c | 7 ++++++- > 2.6.32/wacom_wac.c | 18 ++++++++++++++---- > configure.ac | 12 ++++++++++++ > 4 files changed, 44 insertions(+), 10 deletions(-) > > diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in > index 6290771..4a331d6 100644 > --- a/2.6.32/Makefile.in > +++ b/2.6.32/Makefile.in > @@ -4,11 +4,19 @@ ifneq ($(KERNELRELEASE),) > # Do NOT indent stuff in this part! It has to be like this to make the > # $(error ... ) stuff work > > +RHEL6_RELEASE := @RHEL6_RELEASE@ > +WCM_OT_NAME := "" > + > ifneq ($(CONFIG_USB_WACOM),y) > WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen) > -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) > -wacom-objs := wacom_wac.o wacom_sys.o > -obj-m += wacom.o > + ifeq ($(RHEL6_RELEASE),10) > + WCM_OT_NAME := -ot > + ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) -DRHEL6_RELEASE > + else > + ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) > + endif # RHEL6_RELEASE To keep things cleaner, I'd leave the definition of "ccflags-y" alone but add `ccflags-y += -DRHEL6_RELEASE` to the "ifeq" block. > +wacom$(WCM_OT_NAME)-objs := wacom_wac.o wacom_sys.o > +obj-m += wacom$(WCM_OT_NAME).o > obj-m += wacom_w8001.o > else > $(error You requested to build wacom with configure, but wacom is configured as built-in in your kernel config) > @@ -48,8 +56,7 @@ uninstall: > @# which causes trouble for tools like 'rm' which don't > @# see the path how you might think. As a workaround, > @# first cd into the directory and then remove. > - cd $(WCM_KERNEL_DIR)/../extra; rm wacom.ko* > - cd $(WCM_KERNEL_DIR)/../extra; rm wacom_w8001.ko* > + cd $(WCM_KERNEL_DIR)/../extra; rm wacom*.ko* > rm -f /etc/depmod.d/input-wacom.conf > PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS) > > diff --git a/2.6.32/wacom_sys.c b/2.6.32/wacom_sys.c > index 5ca4c61..4a1fb70 100644 > --- a/2.6.32/wacom_sys.c > +++ b/2.6.32/wacom_sys.c > @@ -39,6 +39,11 @@ > #define HID_COLLECTION_END 0xc0 > #define HID_LONGITEM 0xfc > > +#ifdef RHEL6_RELEASE > +#define wacom_driver_name "wacom-ot" > +#else > +#define wacom_driver_name "wacom" > +#endif > > enum { > WCM_UNDEFINED = 0, > @@ -1088,7 +1093,7 @@ static int wacom_reset_resume(struct usb_interface *intf) > } > > static struct usb_driver wacom_driver = { > - .name = "wacom", > + .name = wacom_driver_name, > .id_table = wacom_ids, > .probe = wacom_probe, > .disconnect = wacom_disconnect, > diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c > index c4705f8..9a5fe39 100644 > --- a/2.6.32/wacom_wac.c > +++ b/2.6.32/wacom_wac.c > @@ -2484,6 +2484,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, > wacom_setup_numbered_buttons(input_dev, numbered_buttons); > } > > +#ifndef RHEL6_RELEASE > static const struct wacom_features wacom_features_0x00 = > { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, 0, > PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; > @@ -2950,10 +2951,10 @@ static const struct wacom_features wacom_features_0x343 = > WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; > static const struct wacom_features wacom_features_0x34A = > { "Wacom MobileStudio Pro 13 Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, /* Touch */ > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D }; > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D, .touch_max = 10 }; All of these touch_max modifications should go into their own patch. > static const struct wacom_features wacom_features_0x34B = > { "Wacom MobileStudio Pro 16 Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, /* Touch */ > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E }; > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E, .touch_max = 10 }; > static const struct wacom_features wacom_features_0x34D = > { "Wacom MobileStudio Pro 13", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63, > WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11, > @@ -2966,6 +2967,7 @@ static const struct wacom_features wacom_features_0x34E = > WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, > WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, > .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34B }; > +#endif /* Wacom Out-of-tree check */ > static const struct wacom_features wacom_features_0x34F = > { "Wacom Cintiq Pro 13 FHD", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63, > WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, > @@ -2992,10 +2994,10 @@ static const struct wacom_features wacom_features_0x352 = > .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x356 }; > static const struct wacom_features wacom_features_0x353 = > { "Wacom Cintiq Pro 13FHD Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f }; /* Touch */ > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f, .touch_max = 10 }; /* Touch */ > static const struct wacom_features wacom_features_0x354 = > { "Wacom Cintiq Pro 16UHD Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350 }; /* Touch */ > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350, .touch_max = 10 }; /* Touch */ > static const struct wacom_features wacom_features_0x355 = > { "Wacom Cintiq Pro 24 Touch", WACOM_PKGLEN_27QHDT, .type = WACOM_27QHDT, > .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x351, .touch_max = 10 }; /* Touch */ > @@ -3031,12 +3033,14 @@ static const struct wacom_features wacom_features_0x376 = > static const struct wacom_features wacom_features_0x378 = > { "Intuos BT M", WACOM_PKGLEN_INTUOSP2, 21600, 13500, 4095, > 63, INTUOSHT3, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; > +#ifndef RHEL6_RELEASE > static const struct wacom_features wacom_features_0x37A = > { "Wacom One by Wacom S", WACOM_PKGLEN_BBPEN, 15200, 9500, 2047, 63, > BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; > static const struct wacom_features wacom_features_0x37B = > { "Wacom One by Wacom M", WACOM_PKGLEN_BBPEN, 21600, 13500, 2047, 63, > BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; > +#endif > static const struct wacom_features wacom_features_0x37C = > { "Wacom Cintiq Pro 24", WACOM_PKGLEN_MSPRO, 105286, 59574, 8191, 63, /* Pen-only */ > WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, > @@ -3072,6 +3076,7 @@ static const struct wacom_features wacom_features_0x382 = > .driver_info = (kernel_ulong_t)&wacom_features_##prod > > const struct usb_device_id wacom_ids[] = { > +#ifndef RHEL6_RELEASE > { USB_DEVICE_WACOM(0x00) }, > { USB_DEVICE_WACOM(0x03) }, > { USB_DEVICE_WACOM(0x10) }, > @@ -3215,6 +3220,7 @@ const struct usb_device_id wacom_ids[] = { > { USB_DEVICE_WACOM(0x34B) }, > { USB_DEVICE_WACOM(0x34D) }, > { USB_DEVICE_WACOM(0x34E) }, > +#endif Could you add /* RHEL6_RELEASE */ after these statements to make it clear where they begin? > { USB_DEVICE_WACOM(0x34F) }, > { USB_DEVICE_WACOM(0x350) }, > { USB_DEVICE_WACOM(0x351) }, > @@ -3232,12 +3238,15 @@ const struct usb_device_id wacom_ids[] = { > { USB_DEVICE_WACOM(0x375) }, > { USB_DEVICE_WACOM(0x376) }, > { USB_DEVICE_WACOM(0x378) }, > +#ifndef RHEL6_RELEASE > { USB_DEVICE_WACOM(0x37A) }, > { USB_DEVICE_WACOM(0x37B) }, > +#endif > { USB_DEVICE_WACOM(0x37C) }, > { USB_DEVICE_WACOM(0x37D) }, > { USB_DEVICE_WACOM(0x37E) }, > { USB_DEVICE_WACOM(0x382) }, > +#ifndef RHEL6_RELEASE > { USB_DEVICE_WACOM(0x4001) }, > { USB_DEVICE_WACOM(0x4004) }, > { USB_DEVICE_WACOM(0x5000) }, > @@ -3248,6 +3257,7 @@ const struct usb_device_id wacom_ids[] = { > { USB_DEVICE_WACOM(0x5048) }, > { USB_DEVICE_WACOM(0x5090) }, > { USB_DEVICE_LENOVO(0x6004) }, > +#endif > { } > }; > MODULE_DEVICE_TABLE(usb, wacom_ids); > diff --git a/configure.ac b/configure.ac > index 52386d5..5ea344c 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -107,6 +107,17 @@ package and try again.]) > fi > WCM_ENV_KERNEL="yes" > > +dnl Check for RedHat entreprise Linux >= 6.9 > +AC_MSG_CHECKING(RHEL6 minor release) > +RHEL6_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise Linux\|CentOS\) .*release 6.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] This one's optional, but we could/should have a third patch which modifies this sed one-liner (and RHEL7_RELEASE as well) to also handle the "Scientific Linux" fork of RHEL. The /etc/redhat-release strings for that fork are e.g. "Scientific Linux release 6.10 (Carbon)" and "Scientific Linux release 7.6 (Nitrogen)". Jason --- Now instead of four in the eights place / you’ve got three, ‘Cause you added one / (That is to say, eight) to the two, / But you can’t take seven from three, / So you look at the sixty-fours.... > +dnl RHEL6_RELEASE="" > +if test "$RHEL6_RELEASE" = ""; then > + RHEL6_RELEASE="0" > +elif test "$RHEL6_RELEASE" -ge "9"; then > + RHEL6_RELEASE="10" > +fi > +AC_MSG_RESULT([$RHEL6_RELEASE]) > + > dnl Check for RedHat entreprise Linux >= 7.4 > AC_MSG_CHECKING(RHEL7 minor release) > RHEL7_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise\|CentOS\) Linux .*release 7.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] > @@ -331,6 +342,7 @@ echo > WCM_SRC_SUBDIRS=". $WCM_KERNEL_VER" > AC_SUBST(WCM_KERNEL_DIR) > AC_SUBST(WCM_KERNEL_VER) > +AC_SUBST(RHEL6_RELEASE) > AC_SUBST(RHEL7_RELEASE) > AC_SUBST(MODUTS) > AC_SUBST(MODSIGN_HASHALGO) > -- > 2.7.4 > |
From: Ping C. <pin...@gm...> - 2018-12-13 01:05:49
|
Make those devices not supported by RHEL 6.10 into wacom-ot.ko so both drivers can live happily together ;). Signed-off-by: Ping Cheng <pin...@wa...> --- 2.6.32/Makefile.in | 17 ++++++++++++----- 2.6.32/wacom_sys.c | 7 ++++++- 2.6.32/wacom_wac.c | 18 ++++++++++++++---- configure.ac | 12 ++++++++++++ 4 files changed, 44 insertions(+), 10 deletions(-) diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in index 6290771..4a331d6 100644 --- a/2.6.32/Makefile.in +++ b/2.6.32/Makefile.in @@ -4,11 +4,19 @@ ifneq ($(KERNELRELEASE),) # Do NOT indent stuff in this part! It has to be like this to make the # $(error ... ) stuff work +RHEL6_RELEASE := @RHEL6_RELEASE@ +WCM_OT_NAME := "" + ifneq ($(CONFIG_USB_WACOM),y) WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen) -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) -wacom-objs := wacom_wac.o wacom_sys.o -obj-m += wacom.o + ifeq ($(RHEL6_RELEASE),10) + WCM_OT_NAME := -ot + ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) -DRHEL6_RELEASE + else + ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) + endif # RHEL6_RELEASE +wacom$(WCM_OT_NAME)-objs := wacom_wac.o wacom_sys.o +obj-m += wacom$(WCM_OT_NAME).o obj-m += wacom_w8001.o else $(error You requested to build wacom with configure, but wacom is configured as built-in in your kernel config) @@ -48,8 +56,7 @@ uninstall: @# which causes trouble for tools like 'rm' which don't @# see the path how you might think. As a workaround, @# first cd into the directory and then remove. - cd $(WCM_KERNEL_DIR)/../extra; rm wacom.ko* - cd $(WCM_KERNEL_DIR)/../extra; rm wacom_w8001.ko* + cd $(WCM_KERNEL_DIR)/../extra; rm wacom*.ko* rm -f /etc/depmod.d/input-wacom.conf PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS) diff --git a/2.6.32/wacom_sys.c b/2.6.32/wacom_sys.c index 5ca4c61..4a1fb70 100644 --- a/2.6.32/wacom_sys.c +++ b/2.6.32/wacom_sys.c @@ -39,6 +39,11 @@ #define HID_COLLECTION_END 0xc0 #define HID_LONGITEM 0xfc +#ifdef RHEL6_RELEASE +#define wacom_driver_name "wacom-ot" +#else +#define wacom_driver_name "wacom" +#endif enum { WCM_UNDEFINED = 0, @@ -1088,7 +1093,7 @@ static int wacom_reset_resume(struct usb_interface *intf) } static struct usb_driver wacom_driver = { - .name = "wacom", + .name = wacom_driver_name, .id_table = wacom_ids, .probe = wacom_probe, .disconnect = wacom_disconnect, diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c index c4705f8..9a5fe39 100644 --- a/2.6.32/wacom_wac.c +++ b/2.6.32/wacom_wac.c @@ -2484,6 +2484,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, wacom_setup_numbered_buttons(input_dev, numbered_buttons); } +#ifndef RHEL6_RELEASE static const struct wacom_features wacom_features_0x00 = { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, 0, PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; @@ -2950,10 +2951,10 @@ static const struct wacom_features wacom_features_0x343 = WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; static const struct wacom_features wacom_features_0x34A = { "Wacom MobileStudio Pro 13 Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, /* Touch */ - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D }; + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D, .touch_max = 10 }; static const struct wacom_features wacom_features_0x34B = { "Wacom MobileStudio Pro 16 Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, /* Touch */ - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E }; + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E, .touch_max = 10 }; static const struct wacom_features wacom_features_0x34D = { "Wacom MobileStudio Pro 13", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63, WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11, @@ -2966,6 +2967,7 @@ static const struct wacom_features wacom_features_0x34E = WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34B }; +#endif /* Wacom Out-of-tree check */ static const struct wacom_features wacom_features_0x34F = { "Wacom Cintiq Pro 13 FHD", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, 63, WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, @@ -2992,10 +2994,10 @@ static const struct wacom_features wacom_features_0x352 = .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x356 }; static const struct wacom_features wacom_features_0x353 = { "Wacom Cintiq Pro 13FHD Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f }; /* Touch */ + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f, .touch_max = 10 }; /* Touch */ static const struct wacom_features wacom_features_0x354 = { "Wacom Cintiq Pro 16UHD Touch", WACOM_PKGLEN_MSPROT, .type = WACOM_MSPROT, - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350 }; /* Touch */ + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350, .touch_max = 10 }; /* Touch */ static const struct wacom_features wacom_features_0x355 = { "Wacom Cintiq Pro 24 Touch", WACOM_PKGLEN_27QHDT, .type = WACOM_27QHDT, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x351, .touch_max = 10 }; /* Touch */ @@ -3031,12 +3033,14 @@ static const struct wacom_features wacom_features_0x376 = static const struct wacom_features wacom_features_0x378 = { "Intuos BT M", WACOM_PKGLEN_INTUOSP2, 21600, 13500, 4095, 63, INTUOSHT3, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; +#ifndef RHEL6_RELEASE static const struct wacom_features wacom_features_0x37A = { "Wacom One by Wacom S", WACOM_PKGLEN_BBPEN, 15200, 9500, 2047, 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; static const struct wacom_features wacom_features_0x37B = { "Wacom One by Wacom M", WACOM_PKGLEN_BBPEN, 21600, 13500, 2047, 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; +#endif static const struct wacom_features wacom_features_0x37C = { "Wacom Cintiq Pro 24", WACOM_PKGLEN_MSPRO, 105286, 59574, 8191, 63, /* Pen-only */ WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, @@ -3072,6 +3076,7 @@ static const struct wacom_features wacom_features_0x382 = .driver_info = (kernel_ulong_t)&wacom_features_##prod const struct usb_device_id wacom_ids[] = { +#ifndef RHEL6_RELEASE { USB_DEVICE_WACOM(0x00) }, { USB_DEVICE_WACOM(0x03) }, { USB_DEVICE_WACOM(0x10) }, @@ -3215,6 +3220,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x34B) }, { USB_DEVICE_WACOM(0x34D) }, { USB_DEVICE_WACOM(0x34E) }, +#endif { USB_DEVICE_WACOM(0x34F) }, { USB_DEVICE_WACOM(0x350) }, { USB_DEVICE_WACOM(0x351) }, @@ -3232,12 +3238,15 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x375) }, { USB_DEVICE_WACOM(0x376) }, { USB_DEVICE_WACOM(0x378) }, +#ifndef RHEL6_RELEASE { USB_DEVICE_WACOM(0x37A) }, { USB_DEVICE_WACOM(0x37B) }, +#endif { USB_DEVICE_WACOM(0x37C) }, { USB_DEVICE_WACOM(0x37D) }, { USB_DEVICE_WACOM(0x37E) }, { USB_DEVICE_WACOM(0x382) }, +#ifndef RHEL6_RELEASE { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, @@ -3248,6 +3257,7 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_WACOM(0x5048) }, { USB_DEVICE_WACOM(0x5090) }, { USB_DEVICE_LENOVO(0x6004) }, +#endif { } }; MODULE_DEVICE_TABLE(usb, wacom_ids); diff --git a/configure.ac b/configure.ac index 52386d5..5ea344c 100644 --- a/configure.ac +++ b/configure.ac @@ -107,6 +107,17 @@ package and try again.]) fi WCM_ENV_KERNEL="yes" +dnl Check for RedHat entreprise Linux >= 6.9 +AC_MSG_CHECKING(RHEL6 minor release) +RHEL6_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise Linux\|CentOS\) .*release 6.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] +dnl RHEL6_RELEASE="" +if test "$RHEL6_RELEASE" = ""; then + RHEL6_RELEASE="0" +elif test "$RHEL6_RELEASE" -ge "9"; then + RHEL6_RELEASE="10" +fi +AC_MSG_RESULT([$RHEL6_RELEASE]) + dnl Check for RedHat entreprise Linux >= 7.4 AC_MSG_CHECKING(RHEL7 minor release) RHEL7_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise\|CentOS\) Linux .*release 7.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] @@ -331,6 +342,7 @@ echo WCM_SRC_SUBDIRS=". $WCM_KERNEL_VER" AC_SUBST(WCM_KERNEL_DIR) AC_SUBST(WCM_KERNEL_VER) +AC_SUBST(RHEL6_RELEASE) AC_SUBST(RHEL7_RELEASE) AC_SUBST(MODUTS) AC_SUBST(MODSIGN_HASHALGO) -- 2.7.4 |
From: Peter H. <pet...@wh...> - 2018-12-10 01:32:50
|
xsetwacom cannot work under Wayland, even with XWayland because there is no xf86-input-wacom driver. So let's not continue normally and not find any devices because that'll be confusing to the user when the tablet is clearly working. Print an error and exit code of 1. Signed-off-by: Peter Hutterer <pet...@wh...> --- man/xsetwacom.man | 8 ++++++++ tools/xsetwacom.c | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/man/xsetwacom.man b/man/xsetwacom.man index 1c5e445..9674a6b 100644 --- a/man/xsetwacom.man +++ b/man/xsetwacom.man @@ -289,6 +289,14 @@ will require less distance and be more sensitive. Larger values will require more distance and be less sensitive. Default: 1300 or 2600 depending on tablet resolution (corresponds to 13 mm of distance). +.SH WAYLAND SUPPORT + +This tool provides access to the device properties implemented in the +\fBxf86-input-wacom\fR X server input module. It does not work under a +Wayland compositor as the input module is not active. +.TP +See https://github.com/linuxwacom/xf86-input-wacom/wiki/Wayland for details. + .SH "AUTHORS" Peter Hutterer <pet...@re...> diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c index 8b66944..cb5b7f0 100644 --- a/tools/xsetwacom.c +++ b/tools/xsetwacom.c @@ -28,6 +28,7 @@ #include <limits.h> #include <stdio.h> #include <stdarg.h> +#include <stdbool.h> #include <ctype.h> #include <stdlib.h> #include <getopt.h> @@ -2795,6 +2796,24 @@ void argsfromstdin(int *argc, char ***argv) } #endif /* BUILD_FUZZINTERFACE */ +static bool check_for_wayland(Display *dpy) +{ + bool has_xwayland_devices = false; + XDeviceInfo *info; + int ndevices, i; + + info = XListInputDevices(dpy, &ndevices); + for (i = 0; i < ndevices; i++) { + if (strncmp(info[i].name, "xwayland-", 9) == 0) { + has_xwayland_devices = true; + break; + } + } + XFreeDeviceList(info); + + return has_xwayland_devices; +} + int main (int argc, char **argv) { int c; @@ -2880,6 +2899,13 @@ int main (int argc, char **argv) return -1; } + if (check_for_wayland(dpy)) { + fprintf(stderr, + "Wayland devices found but this tool is incompatible with Wayland. See\n" + "https://github.com/linuxwacom/xf86-input-wacom/wiki/Wayland\n"); + return 1; + } + if (!do_list && !do_get && !do_set) { if (optind < argc) -- 2.19.2 |
From: Ping C. <pin...@gm...> - 2018-11-30 22:41:18
|
Looks like a good workaround! Acked-by: Ping Cheng <Pin...@wa...> I assume you had someone tested the patch for you. Can you get a test-by from them? Thank you for your effor. Ping On Fri, Nov 30, 2018 at 10:38 AM Jason Gerecke <kil...@gm...> wrote: > It is becoming more common for systems to only allow signed kernel modules > to be loaded (e.g. because the kernel is in "lockdown mode" due to secure > boot policies). Users who follow the standard configure / make / install > process find that the driver does not work after rebooting and often don't > know what is wrong. > > This commit teaches the configure script and Makefiles a few new tricks: > > * Detection of when module signing is required by the system > * Detection of existing key and cert used for module signing (Ubuntu > only) > * Ability to manually specify key, cert, and hash algorithm to be > used for module signing > * Abort configure if signing is required but not possible > * New makefile target to add the signature prior to installing > > Module signing is opportunistic by default. If a key and cert can be > found (or are provided to the configure script), the modules will be > signed -- even if not otherwise required. If a key and cert aren't > available then we will try to build an unsigned driver instead. If > the system is set up to require signed modules, we will cowardly > error out of the configure script unless the user explicitly requests > the driver to be left unsigned. > > A phony "signature" Makefile target is provided which is called by > `make install` and which is available for developers who want/need > to sign the module without actually installing it. Users can use > `make && sudo make install` while developers can use `make && sudo > make signature`. If module signing is disabled the "signature" > target does nothing. > --- > 2.6.32/Makefile.in | 12 +++++- > 2.6.38/Makefile.in | 12 +++++- > 3.17/Makefile.in | 12 +++++- > 3.7/Makefile.in | 12 +++++- > 4.5/Makefile.in | 12 +++++- > configure.ac | 96 ++++++++++++++++++++++++++++++++++++++++++++++ > 6 files changed, 151 insertions(+), 5 deletions(-) > > diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in > index 38876be..6290771 100644 > --- a/2.6.32/Makefile.in > +++ b/2.6.32/Makefile.in > @@ -20,6 +20,9 @@ PWD := $(shell pwd) > WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ > MODUTS := @MODUTS@ > WCM_KERNEL_VER := @WCM_KERNEL_VER@ > +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ > +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ > +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ > > all: > @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) > kernel.' > @@ -28,7 +31,13 @@ all: > clean: > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean > > -install modules_install: > +signature: all > + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n > "$(MODSIGN_CERTFILE)"; then \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ > + fi > + > +install modules_install: signature > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install > mkdir -p /etc/depmod.d > echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf > @@ -59,5 +68,6 @@ distdir: > > EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info > EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags > ctags mostlyclean maintainer-clean > +EMPTY_AUTOMAKE_TARGETS += signature > .PHONY: $(EMPTY_AUTOMAKE_TARGETS) > $(EMPTY_AUTOMAKE_TARGETS): > diff --git a/2.6.38/Makefile.in b/2.6.38/Makefile.in > index da131dc..4779420 100644 > --- a/2.6.38/Makefile.in > +++ b/2.6.38/Makefile.in > @@ -20,6 +20,9 @@ PWD := $(shell pwd) > WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ > MODUTS := @MODUTS@ > WCM_KERNEL_VER := @WCM_KERNEL_VER@ > +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ > +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ > +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ > > all: > @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) > kernel.' > @@ -28,7 +31,13 @@ all: > clean: > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean > > -install modules_install: > +signature: all > + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n > "$(MODSIGN_CERTFILE)"; then \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ > + fi > + > +install modules_install: signature > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install > mkdir -p /etc/depmod.d > echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf > @@ -59,5 +68,6 @@ distdir: > > EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info > EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags > ctags mostlyclean maintainer-clean > +EMPTY_AUTOMAKE_TARGETS += signature > .PHONY: $(EMPTY_AUTOMAKE_TARGETS) > $(EMPTY_AUTOMAKE_TARGETS): > diff --git a/3.17/Makefile.in b/3.17/Makefile.in > index b3683b7..7077d8c 100644 > --- a/3.17/Makefile.in > +++ b/3.17/Makefile.in > @@ -29,6 +29,9 @@ DRACUT := $(shell command -v dracut 2>/dev/null) > WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ > MODUTS := @MODUTS@ > WCM_KERNEL_VER := @WCM_KERNEL_VER@ > +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ > +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ > +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ > > all: > @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) > kernel.' > @@ -37,7 +40,13 @@ all: > clean: > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean > > -install modules_install: > +signature: all > + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n > "$(MODSIGN_CERTFILE)"; then \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ > + fi > + > +install modules_install: signature > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install > mkdir -p /etc/depmod.d > echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf > @@ -78,5 +87,6 @@ distdir: > > EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info > EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags > ctags mostlyclean maintainer-clean > +EMPTY_AUTOMAKE_TARGETS += signature > .PHONY: $(EMPTY_AUTOMAKE_TARGETS) > $(EMPTY_AUTOMAKE_TARGETS): > diff --git a/3.7/Makefile.in b/3.7/Makefile.in > index f313ca1..7b3290a 100644 > --- a/3.7/Makefile.in > +++ b/3.7/Makefile.in > @@ -21,6 +21,9 @@ DRACUT := $(shell command -v dracut 2>/dev/null) > WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ > MODUTS := @MODUTS@ > WCM_KERNEL_VER := @WCM_KERNEL_VER@ > +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ > +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ > +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ > > all: > @echo ' Building input-wacom drivers for $(WCM_VERSION_VER) > kernel.' > @@ -29,7 +32,13 @@ all: > clean: > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean > > -install modules_install: > +signature: all > + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n > "$(MODSIGN_CERTFILE)"; then \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ > + fi > + > +install modules_install: signature > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install > mkdir -p /etc/depmod.d > echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf > @@ -63,5 +72,6 @@ distdir: > > EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info > EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags > ctags mostlyclean maintainer-clean > +EMPTY_AUTOMAKE_TARGETS += signature > .PHONY: $(EMPTY_AUTOMAKE_TARGETS) > $(EMPTY_AUTOMAKE_TARGETS): > diff --git a/4.5/Makefile.in b/4.5/Makefile.in > index 438229b..dd89344 100644 > --- a/4.5/Makefile.in > +++ b/4.5/Makefile.in > @@ -22,6 +22,9 @@ DRACUT := $(shell command -v dracut 2>/dev/null) > WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ > MODUTS := @MODUTS@ > WCM_KERNEL_VER := @WCM_KERNEL_VER@ > +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ > +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ > +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ > > all: > @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) > kernel.' > @@ -30,7 +33,13 @@ all: > clean: > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean > > -install modules_install: > +signature: all > + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n > "$(MODSIGN_CERTFILE)"; then \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ > + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" > "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ > + fi > + > +install modules_install: signature > $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install > mkdir -p /etc/depmod.d > echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf > @@ -70,5 +79,6 @@ distdir: > > EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info > EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags > ctags mostlyclean maintainer-clean > +EMPTY_AUTOMAKE_TARGETS += signature > .PHONY: $(EMPTY_AUTOMAKE_TARGETS) > $(EMPTY_AUTOMAKE_TARGETS): > diff --git a/configure.ac b/configure.ac > index e4afd11..64413c8 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -6,6 +6,7 @@ AC_CONFIG_SRCDIR([Makefile.am]) > AC_CONFIG_HEADERS([config.h]) > > AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign]) > +AM_EXTRA_RECURSIVE_TARGETS([signature]) > AM_MAINTAINER_MODE > > AC_PROG_CC > @@ -232,6 +233,98 @@ if test "$RHEL7_RELEASE" -ge "4"; then > WCM_KERNEL_VER="3.17" > fi > > +dnl ======================================================= > +dnl Module signing > + > +AC_MSG_CHECKING(kernel sig_enforce parameter) > +SIG_KERNEL=$(cat /sys/module/module/parameters/sig_enforce 2>/dev/null || > echo "(unknown)") > +AC_MSG_RESULT([$SIG_KERNEL]) > + > +AC_MSG_CHECKING(mokutil sb-state) > +SIG_MOK=$(mokutil --sb-state 2>/dev/null || echo "(unknown)") > +AC_MSG_RESULT([$SIG_MOK]) > + > +SIG_REQUIRED=$(( $(echo "$SIG_KERNEL" | grep -q "Y" && echo "1" || echo > "0") + \ > + $(echo "$SIG_MOK" | grep -q "enabled" && echo "1" || > echo "0") \ > + )) > + > +MODSIGN_ENABLE=default > +MODSIGN_HASHALGO= > +MODSIGN_PRIVFILE= > +MODSIGN_CERTFILE= > + > +AC_ARG_ENABLE(module-signing, > + AS_HELP_STRING([--disable-module-signing], [Disable automatic > module signing]), > + [MODSIGN_ENABLE="$enableval"]) > +AC_ARG_WITH(hash-algorithm, > + AS_HELP_STRING([--with-hash-algorithm=<alg>], [Specify module > signing hash algorithm]), > + [MODSIGN_HASHALGO="$withval"]) > +AC_ARG_WITH(signing-key, > + AS_HELP_STRING([--with-signing-key=<trusted.priv>], [Specify > module signing key location]), > + [MODSIGN_PRIVFILE="$withval"]) > +AC_ARG_WITH(signing-cert, > + AS_HELP_STRING([--with-signing-cert=<trusted.der>], [Specify > module signing cert location]), > + [MODSIGN_CERTFILE="$withval"]) > + > +if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then > + if test "$MODSIGN_HASHALGO" = "yes" -o -z "$MODSIGN_HASHALGO"; then > + MODSIGN_HASHALGO="sha512" > + fi > + > + # There is no standard location for storing kernel signing keys > + # and certificates. The kernel itself has CONFIG_MODULE_SIG_KEY > + # (which contains a key and cert) which likely points to a file > + # that doesn't exist unless you built the kernel yourself. Most > + # distributions use the "shim" bootloader which allows "machine > + # owner keys" (MOK) to be enrolled by the end-user, but only > + # Ubuntu provides a tool to automatically generate these keys > + # (`update-secureboot-policy --new-key`); other distros rely on > + # the user generating the key/cert themselves and keeping it in a > + # suitably-safe location. > + # > + # The kernel should automatically try to sign modules as part of > + # the `make modules_install` step, so that covers the first case. > + # In the second case the best we can do is try Ubuntu's location. > + > + if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then > + MODSIGN_PRIVFILE=$(ls /var/lib/shim-signed/mok/MOK.priv > 2>/dev/null || echo "$MODSIGN_PRIVFILE") > + fi > + if test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE"; then > + MODSIGN_CERTFILE=$(ls /var/lib/shim-signed/mok/MOK.der > 2>/dev/null || echo "$MODSIGN_CERTFILE") > + fi > + > + AC_MSG_CHECKING(for module signing hash algorithm) > + AC_MSG_RESULT([$MODSIGN_HASHALGO]) > + AC_MSG_CHECKING(for module signing key) > + AC_MSG_RESULT([$MODSIGN_PRIVFILE]) > + AC_MSG_CHECKING(for module signing certificate) > + AC_MSG_RESULT([$MODSIGN_CERTFILE]) > + > + if test ! -f "$MODSIGN_PRIVFILE" -o ! -f "$MODSIGN_CERTFILE"; then > + AC_MSG_WARN([Module signing key and/or certificate > missing.]) > + > + if test "$MODSIGN_ENABLE" = "yes"; then > + AC_MSG_ERROR([Unable to honor explicit request for > module signing.]) > + fi > + > + if test "$SIG_REQUIRED" -gt 0; then > + AC_MSG_ERROR([Kernel is configured to only load dnl > +signed modules but we are unable to produce a signed module. Either (1) > dnl > +re-run configure with the options '--with-signing-key=<key>' and dnl > +'--with-signing-cert=<cert>' set, (2) indicate you will sign the modules > dnl > +yourself by re-running configure with the '--disable-module-signing' dnl > +option set, or (3) disable the kernel's signed module requirement (e.g. > dnl > +disable secure boot).]) > + fi > + fi > +else > + # Make sure we don't pass these along via AC_SUBST > + MODSIGN_HASHALGO= > + MODSIGN_PRIVFILE= > + MODSIGN_CERTFILE= > +fi > + > + > dnl Separate test output from file-generation output > echo > > @@ -240,6 +333,9 @@ AC_SUBST(WCM_KERNEL_DIR) > AC_SUBST(WCM_KERNEL_VER) > AC_SUBST(RHEL7_RELEASE) > AC_SUBST(MODUTS) > +AC_SUBST(MODSIGN_HASHALGO) > +AC_SUBST(MODSIGN_PRIVFILE) > +AC_SUBST(MODSIGN_CERTFILE) > > AC_CONFIG_FILES([Makefile > 2.6.32/Makefile > -- > 2.19.2 > > |
From: Jason G. <kil...@gm...> - 2018-11-30 18:38:56
|
It is becoming more common for systems to only allow signed kernel modules to be loaded (e.g. because the kernel is in "lockdown mode" due to secure boot policies). Users who follow the standard configure / make / install process find that the driver does not work after rebooting and often don't know what is wrong. This commit teaches the configure script and Makefiles a few new tricks: * Detection of when module signing is required by the system * Detection of existing key and cert used for module signing (Ubuntu only) * Ability to manually specify key, cert, and hash algorithm to be used for module signing * Abort configure if signing is required but not possible * New makefile target to add the signature prior to installing Module signing is opportunistic by default. If a key and cert can be found (or are provided to the configure script), the modules will be signed -- even if not otherwise required. If a key and cert aren't available then we will try to build an unsigned driver instead. If the system is set up to require signed modules, we will cowardly error out of the configure script unless the user explicitly requests the driver to be left unsigned. A phony "signature" Makefile target is provided which is called by `make install` and which is available for developers who want/need to sign the module without actually installing it. Users can use `make && sudo make install` while developers can use `make && sudo make signature`. If module signing is disabled the "signature" target does nothing. --- 2.6.32/Makefile.in | 12 +++++- 2.6.38/Makefile.in | 12 +++++- 3.17/Makefile.in | 12 +++++- 3.7/Makefile.in | 12 +++++- 4.5/Makefile.in | 12 +++++- configure.ac | 96 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 151 insertions(+), 5 deletions(-) diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in index 38876be..6290771 100644 --- a/2.6.32/Makefile.in +++ b/2.6.32/Makefile.in @@ -20,6 +20,9 @@ PWD := $(shell pwd) WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ MODUTS := @MODUTS@ WCM_KERNEL_VER := @WCM_KERNEL_VER@ +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ all: @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) kernel.' @@ -28,7 +31,13 @@ all: clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean -install modules_install: +signature: all + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ + fi + +install modules_install: signature $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf @@ -59,5 +68,6 @@ distdir: EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags ctags mostlyclean maintainer-clean +EMPTY_AUTOMAKE_TARGETS += signature .PHONY: $(EMPTY_AUTOMAKE_TARGETS) $(EMPTY_AUTOMAKE_TARGETS): diff --git a/2.6.38/Makefile.in b/2.6.38/Makefile.in index da131dc..4779420 100644 --- a/2.6.38/Makefile.in +++ b/2.6.38/Makefile.in @@ -20,6 +20,9 @@ PWD := $(shell pwd) WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ MODUTS := @MODUTS@ WCM_KERNEL_VER := @WCM_KERNEL_VER@ +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ all: @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) kernel.' @@ -28,7 +31,13 @@ all: clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean -install modules_install: +signature: all + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ + fi + +install modules_install: signature $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf @@ -59,5 +68,6 @@ distdir: EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags ctags mostlyclean maintainer-clean +EMPTY_AUTOMAKE_TARGETS += signature .PHONY: $(EMPTY_AUTOMAKE_TARGETS) $(EMPTY_AUTOMAKE_TARGETS): diff --git a/3.17/Makefile.in b/3.17/Makefile.in index b3683b7..7077d8c 100644 --- a/3.17/Makefile.in +++ b/3.17/Makefile.in @@ -29,6 +29,9 @@ DRACUT := $(shell command -v dracut 2>/dev/null) WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ MODUTS := @MODUTS@ WCM_KERNEL_VER := @WCM_KERNEL_VER@ +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ all: @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) kernel.' @@ -37,7 +40,13 @@ all: clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean -install modules_install: +signature: all + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ + fi + +install modules_install: signature $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf @@ -78,5 +87,6 @@ distdir: EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags ctags mostlyclean maintainer-clean +EMPTY_AUTOMAKE_TARGETS += signature .PHONY: $(EMPTY_AUTOMAKE_TARGETS) $(EMPTY_AUTOMAKE_TARGETS): diff --git a/3.7/Makefile.in b/3.7/Makefile.in index f313ca1..7b3290a 100644 --- a/3.7/Makefile.in +++ b/3.7/Makefile.in @@ -21,6 +21,9 @@ DRACUT := $(shell command -v dracut 2>/dev/null) WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ MODUTS := @MODUTS@ WCM_KERNEL_VER := @WCM_KERNEL_VER@ +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ all: @echo ' Building input-wacom drivers for $(WCM_VERSION_VER) kernel.' @@ -29,7 +32,13 @@ all: clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean -install modules_install: +signature: all + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ + fi + +install modules_install: signature $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf @@ -63,5 +72,6 @@ distdir: EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags ctags mostlyclean maintainer-clean +EMPTY_AUTOMAKE_TARGETS += signature .PHONY: $(EMPTY_AUTOMAKE_TARGETS) $(EMPTY_AUTOMAKE_TARGETS): diff --git a/4.5/Makefile.in b/4.5/Makefile.in index 438229b..dd89344 100644 --- a/4.5/Makefile.in +++ b/4.5/Makefile.in @@ -22,6 +22,9 @@ DRACUT := $(shell command -v dracut 2>/dev/null) WCM_KERNEL_DIR := @WCM_KERNEL_DIR@ MODUTS := @MODUTS@ WCM_KERNEL_VER := @WCM_KERNEL_VER@ +MODSIGN_HASHALGO := @MODSIGN_HASHALGO@ +MODSIGN_PRIVFILE := @MODSIGN_PRIVFILE@ +MODSIGN_CERTFILE := @MODSIGN_CERTFILE@ all: @echo ' Building input-wacom drivers for $(WCM_KERNEL_VER) kernel.' @@ -30,7 +33,13 @@ all: clean: $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) clean -install modules_install: +signature: all + if test -n "$(MODSIGN_HASHALGO)" -a -n "$(MODSIGN_PRIVFILE)" -a -n "$(MODSIGN_CERTFILE)"; then \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom.ko; \ + $(WCM_KERNEL_DIR)/scripts/sign-file "$(MODSIGN_HASHALGO)" "$(MODSIGN_PRIVFILE)" "$(MODSIGN_CERTFILE)" wacom_w8001.ko; \ + fi + +install modules_install: signature $(MAKE) -C $(WCM_KERNEL_DIR) M=$(PWD) modules_install mkdir -p /etc/depmod.d echo "override wacom * extra" > /etc/depmod.d/input-wacom.conf @@ -70,5 +79,6 @@ distdir: EMPTY_AUTOMAKE_TARGETS = install-data install-exec uninstall install-info EMPTY_AUTOMAKE_TARGETS += installdirs check dvi pdf ps info html tags ctags mostlyclean maintainer-clean +EMPTY_AUTOMAKE_TARGETS += signature .PHONY: $(EMPTY_AUTOMAKE_TARGETS) $(EMPTY_AUTOMAKE_TARGETS): diff --git a/configure.ac b/configure.ac index e4afd11..64413c8 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,7 @@ AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign]) +AM_EXTRA_RECURSIVE_TARGETS([signature]) AM_MAINTAINER_MODE AC_PROG_CC @@ -232,6 +233,98 @@ if test "$RHEL7_RELEASE" -ge "4"; then WCM_KERNEL_VER="3.17" fi +dnl ======================================================= +dnl Module signing + +AC_MSG_CHECKING(kernel sig_enforce parameter) +SIG_KERNEL=$(cat /sys/module/module/parameters/sig_enforce 2>/dev/null || echo "(unknown)") +AC_MSG_RESULT([$SIG_KERNEL]) + +AC_MSG_CHECKING(mokutil sb-state) +SIG_MOK=$(mokutil --sb-state 2>/dev/null || echo "(unknown)") +AC_MSG_RESULT([$SIG_MOK]) + +SIG_REQUIRED=$(( $(echo "$SIG_KERNEL" | grep -q "Y" && echo "1" || echo "0") + \ + $(echo "$SIG_MOK" | grep -q "enabled" && echo "1" || echo "0") \ + )) + +MODSIGN_ENABLE=default +MODSIGN_HASHALGO= +MODSIGN_PRIVFILE= +MODSIGN_CERTFILE= + +AC_ARG_ENABLE(module-signing, + AS_HELP_STRING([--disable-module-signing], [Disable automatic module signing]), + [MODSIGN_ENABLE="$enableval"]) +AC_ARG_WITH(hash-algorithm, + AS_HELP_STRING([--with-hash-algorithm=<alg>], [Specify module signing hash algorithm]), + [MODSIGN_HASHALGO="$withval"]) +AC_ARG_WITH(signing-key, + AS_HELP_STRING([--with-signing-key=<trusted.priv>], [Specify module signing key location]), + [MODSIGN_PRIVFILE="$withval"]) +AC_ARG_WITH(signing-cert, + AS_HELP_STRING([--with-signing-cert=<trusted.der>], [Specify module signing cert location]), + [MODSIGN_CERTFILE="$withval"]) + +if test "$MODSIGN_ENABLE" = "yes" -o "$MODSIGN_ENABLE" = "default"; then + if test "$MODSIGN_HASHALGO" = "yes" -o -z "$MODSIGN_HASHALGO"; then + MODSIGN_HASHALGO="sha512" + fi + + # There is no standard location for storing kernel signing keys + # and certificates. The kernel itself has CONFIG_MODULE_SIG_KEY + # (which contains a key and cert) which likely points to a file + # that doesn't exist unless you built the kernel yourself. Most + # distributions use the "shim" bootloader which allows "machine + # owner keys" (MOK) to be enrolled by the end-user, but only + # Ubuntu provides a tool to automatically generate these keys + # (`update-secureboot-policy --new-key`); other distros rely on + # the user generating the key/cert themselves and keeping it in a + # suitably-safe location. + # + # The kernel should automatically try to sign modules as part of + # the `make modules_install` step, so that covers the first case. + # In the second case the best we can do is try Ubuntu's location. + + if test "$MODSIGN_PRIVFILE" = "yes" -o -z "$MODSIGN_PRIVFILE"; then + MODSIGN_PRIVFILE=$(ls /var/lib/shim-signed/mok/MOK.priv 2>/dev/null || echo "$MODSIGN_PRIVFILE") + fi + if test "$MODSIGN_CERTFILE" = "yes" -o -z "$MODSIGN_CERTFILE"; then + MODSIGN_CERTFILE=$(ls /var/lib/shim-signed/mok/MOK.der 2>/dev/null || echo "$MODSIGN_CERTFILE") + fi + + AC_MSG_CHECKING(for module signing hash algorithm) + AC_MSG_RESULT([$MODSIGN_HASHALGO]) + AC_MSG_CHECKING(for module signing key) + AC_MSG_RESULT([$MODSIGN_PRIVFILE]) + AC_MSG_CHECKING(for module signing certificate) + AC_MSG_RESULT([$MODSIGN_CERTFILE]) + + if test ! -f "$MODSIGN_PRIVFILE" -o ! -f "$MODSIGN_CERTFILE"; then + AC_MSG_WARN([Module signing key and/or certificate missing.]) + + if test "$MODSIGN_ENABLE" = "yes"; then + AC_MSG_ERROR([Unable to honor explicit request for module signing.]) + fi + + if test "$SIG_REQUIRED" -gt 0; then + AC_MSG_ERROR([Kernel is configured to only load dnl +signed modules but we are unable to produce a signed module. Either (1) dnl +re-run configure with the options '--with-signing-key=<key>' and dnl +'--with-signing-cert=<cert>' set, (2) indicate you will sign the modules dnl +yourself by re-running configure with the '--disable-module-signing' dnl +option set, or (3) disable the kernel's signed module requirement (e.g. dnl +disable secure boot).]) + fi + fi +else + # Make sure we don't pass these along via AC_SUBST + MODSIGN_HASHALGO= + MODSIGN_PRIVFILE= + MODSIGN_CERTFILE= +fi + + dnl Separate test output from file-generation output echo @@ -240,6 +333,9 @@ AC_SUBST(WCM_KERNEL_DIR) AC_SUBST(WCM_KERNEL_VER) AC_SUBST(RHEL7_RELEASE) AC_SUBST(MODUTS) +AC_SUBST(MODSIGN_HASHALGO) +AC_SUBST(MODSIGN_PRIVFILE) +AC_SUBST(MODSIGN_CERTFILE) AC_CONFIG_FILES([Makefile 2.6.32/Makefile -- 2.19.2 |