Merge ~kzapalowicz/snappy-hwe-snaps/+git/bluez:feature/use-uhid into ~snappy-hwe-team/snappy-hwe-snaps/+git/bluez:master

Proposed by Konrad Zapałowicz
Status: Merged
Approved by: Simon Fels
Approved revision: d1aea280899be3961db74b1f4eebf91856619240
Merged at revision: cf306c3dd10466d5434e8fe47f7de17d92bbc1d0
Proposed branch: ~kzapalowicz/snappy-hwe-snaps/+git/bluez:feature/use-uhid
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/bluez:master
Diff against target: 48 lines (+6/-3)
3 files modified
snapcraft.yaml (+2/-1)
tests/lib/utilities.sh (+3/-2)
tests/main/installation/task.yaml (+1/-0)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Simon Fels Approve
Jim Hodapp (community) Approve
Review via email: mp+315108@code.launchpad.net

Commit message

Use uhid interface of snapd.

The HoG [HID over GATT] Bluetooth profile interacts with the HID
subsystem through the UHID driver. The HoG traffic is filtered-out
from the other LE traffic in userspace and then injected back to the
kernel. To handle this new traffic a new module called uHID has been
created.

Now, without the access to /dev/uhid it is not possible to use LE (a.k.a Smart) HID devices (keyboards, mice) with Core systems.

This commit makes sure that the bluez snap connects to the UHID slot
of snapd so that UHID can be used.

Fixes: https://bugs.launchpad.net/snappy-hwe-snaps/+bug/1635495

Description of the change

Use uhid interface of snapd.

The HoG [HID over GATT] Bluetooth profile interacts with the HID
subsystem through the UHID driver. The HoG traffic is filtered-out
from the other LE traffic in userspace and then injected back to the
kernel. To handle this new traffic a new module called uHID has been
created.

Now, without the access to /dev/uhid it is not possible to use LE (a.k.a Smart) HID devices (keyboards, mice) with Core systems.

This commit makes sure that the bluez snap connects to the UHID slot
of snapd so that UHID can be used.

Fixes: https://bugs.launchpad.net/snappy-hwe-snaps/+bug/1635495

Fixes: https://bugs.launchpad.net/snappy-hwe-snaps/+bug/1635495

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

This also needs an update of the spread test to verify connection of the plug and an update to the snap-declaration in the store once a new revision is pushed.

review: Needs Fixing
Revision history for this message
Jim Hodapp (jhodapp) wrote :

I'd like to see a better description of this change as to exactly why this is needed.

review: Needs Information
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

The problem with the failing CI here simply is that when the bluez snap is download from the store and the snap-declaration assertion is fetched with it the uhid plug doesn't exist and therefor snapd can't auto connect it. The subsequent --dangerous install of the CI built .snap doesn't trigger the auto-connection as only signed snaps from the store will get those.

Its fine to escape for this by adding a

$ snap connect bluez:uhid

after the snap install --dangerous command in tests/lib/prepare-all.sh

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snapcraft.yaml b/snapcraft.yaml
2index 68d01f7..fca7888 100644
3--- a/snapcraft.yaml
4+++ b/snapcraft.yaml
5@@ -14,7 +14,7 @@ grade: stable
6 apps:
7 bluetoothctl:
8 command: usr/bin/bluetoothctl
9- plugs: [client]
10+ plugs: [client, uhid]
11 aliases:
12 - bluetoothctl
13 obexctl:
14@@ -26,6 +26,7 @@ apps:
15 command: "usr/lib/bluetooth/bluetoothd -E"
16 daemon: simple
17 slots: [service]
18+ plugs: [uhid]
19 obex:
20 command: "usr/lib/bluetooth/obexd"
21 daemon: simple
22diff --git a/tests/lib/utilities.sh b/tests/lib/utilities.sh
23index ff2cef8..d2cc716 100644
24--- a/tests/lib/utilities.sh
25+++ b/tests/lib/utilities.sh
26@@ -22,10 +22,11 @@ install_snap_under_test() {
27 snap install --$SNAP_CHANNEL $SNAP_NAME
28 fi
29 else
30- # Install first from store to avoid error when performing the connection
31- snap install $SNAP_NAME
32+ # Install first from store to avoid error when performing the connection
33+ snap install $SNAP_NAME
34 # Install prebuilt snap
35 snap install --dangerous ${PROJECT_PATH}/${SNAP_NAME}_*_${SNAP_ARCH}.snap
36+ snap connect bluez:uhid :uhid
37 if [ -n "$SNAP_AUTO_ALIASES" ]; then
38 for alias in $SNAP_AUTO_ALIASES ; do
39 snap alias $SNAP_NAME $alias
40diff --git a/tests/main/installation/task.yaml b/tests/main/installation/task.yaml
41index 0fb2fb6..8b0fb36 100644
42--- a/tests/main/installation/task.yaml
43+++ b/tests/main/installation/task.yaml
44@@ -6,3 +6,4 @@ execute: |
45
46 # Ensure all necessary plugs/slots are connected
47 snap interfaces | grep -Pzq "bluez:service +bluez:client"
48+ snap interfaces | grep -Pzq ":uhid +bluez"

Subscribers

People subscribed via source and target branches