From d41436952735e5622e4243bfbc975a6494bd0d64 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 27 Sep 2026 20:25:53 +0100 Subject: [PATCH] scanner-support: add a package for the scanner group Scanner access is granted per device: a USB scanner is matched by vendor and product id against a database of supported devices, which only the driver package has. There is no device class to write a generic hotplug rule against, and putting every USB device node into a group would grant far more than scanner access. Allocate the scanner group and nothing else, so the id is the same on every image, one package owns it, and scanner userspace has something to depend on. The rule granting access to a particular device stays with the driver package. Signed-off-by: Daniel Golle --- package/system/hardware-support/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/package/system/hardware-support/Makefile b/package/system/hardware-support/Makefile index c5f1252b24c..696e7341c63 100644 --- a/package/system/hardware-support/Makefile +++ b/package/system/hardware-support/Makefile @@ -141,6 +141,24 @@ define Package/printer-support/install $(call InstallFragment,$(1),55-printer.json) endef +define Package/scanner-support + $(call Package/hardware-support/Default) + TITLE:=Scanner device support + USERID:=:scanner=47 +endef + +define Package/scanner-support/description + Feature gate for scanners. Allocates the scanner group, so that the id + is the same on every image and one package owns it. Ships no hotplug + rule: a USB scanner is matched by vendor and product id against a + database of supported devices, which only the driver package has, so + the rule granting access to a particular scanner stays there. +endef + +define Package/scanner-support/install + $(INSTALL_DIR) $(1) +endef + define Build/Prepare endef @@ -157,3 +175,4 @@ $(eval $(call BuildPackage,input-support)) $(eval $(call BuildPackage,dvb-support)) $(eval $(call BuildPackage,kvm-support)) $(eval $(call BuildPackage,printer-support)) +$(eval $(call BuildPackage,scanner-support))