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
diff --git a/snapcraft.yaml b/snapcraft.yaml
index 68d01f7..fca7888 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -14,7 +14,7 @@ grade: stable
14apps:14apps:
15 bluetoothctl:15 bluetoothctl:
16 command: usr/bin/bluetoothctl16 command: usr/bin/bluetoothctl
17 plugs: [client]17 plugs: [client, uhid]
18 aliases:18 aliases:
19 - bluetoothctl19 - bluetoothctl
20 obexctl:20 obexctl:
@@ -26,6 +26,7 @@ apps:
26 command: "usr/lib/bluetooth/bluetoothd -E"26 command: "usr/lib/bluetooth/bluetoothd -E"
27 daemon: simple27 daemon: simple
28 slots: [service]28 slots: [service]
29 plugs: [uhid]
29 obex:30 obex:
30 command: "usr/lib/bluetooth/obexd"31 command: "usr/lib/bluetooth/obexd"
31 daemon: simple32 daemon: simple
diff --git a/tests/lib/utilities.sh b/tests/lib/utilities.sh
index ff2cef8..d2cc716 100644
--- a/tests/lib/utilities.sh
+++ b/tests/lib/utilities.sh
@@ -22,10 +22,11 @@ install_snap_under_test() {
22 snap install --$SNAP_CHANNEL $SNAP_NAME22 snap install --$SNAP_CHANNEL $SNAP_NAME
23 fi23 fi
24 else24 else
25 # Install first from store to avoid error when performing the connection25 # Install first from store to avoid error when performing the connection
26 snap install $SNAP_NAME26 snap install $SNAP_NAME
27 # Install prebuilt snap27 # Install prebuilt snap
28 snap install --dangerous ${PROJECT_PATH}/${SNAP_NAME}_*_${SNAP_ARCH}.snap28 snap install --dangerous ${PROJECT_PATH}/${SNAP_NAME}_*_${SNAP_ARCH}.snap
29 snap connect bluez:uhid :uhid
29 if [ -n "$SNAP_AUTO_ALIASES" ]; then30 if [ -n "$SNAP_AUTO_ALIASES" ]; then
30 for alias in $SNAP_AUTO_ALIASES ; do31 for alias in $SNAP_AUTO_ALIASES ; do
31 snap alias $SNAP_NAME $alias32 snap alias $SNAP_NAME $alias
diff --git a/tests/main/installation/task.yaml b/tests/main/installation/task.yaml
index 0fb2fb6..8b0fb36 100644
--- a/tests/main/installation/task.yaml
+++ b/tests/main/installation/task.yaml
@@ -6,3 +6,4 @@ execute: |
66
7 # Ensure all necessary plugs/slots are connected7 # Ensure all necessary plugs/slots are connected
8 snap interfaces | grep -Pzq "bluez:service +bluez:client"8 snap interfaces | grep -Pzq "bluez:service +bluez:client"
9 snap interfaces | grep -Pzq ":uhid +bluez"

Subscribers

People subscribed via source and target branches