From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.173 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796245665; b=lobGkZoQm1g06wciRIuhFH3VTeOfvLcf5DKhMkpfb8E/d/4Agc4WtAikA4Jl88zrkfGC 4XQVjDsIUofnmadJWZhGxaNXW5q5zOtSsWdMOgoqeHq8z+IIbZVSnCCzKovrNdzGiWxa1 mo41k477FmCEHZuW9sC1aFonWlEaf06ACEoZtHtEqzbL+ORKKWt3xxP13X6Hf/oBcQE4f DOZ2/IQwqjSUHtPgdpy+G3sb/WEYPdRcOchMyLlXnfvq1qlAVcXULk75rjYxlpqLuatFb j51xjZClssn5RvelQuC90BLKNwtc/yFNg7nzm61K9A8vwhV/1IhRWfj7TXmzixQodgw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796245665; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=ExJvkTo+cx6g7U4FDCU5Ea+oCeftN24wLBGnQkXuu+s=; b=gKxnUVPsTFT3m5mFX5iNX8EAwJcnwYs+GbgwEAGi5ViYYcfXjibrnUxpG7QfuhJGVB8t TqT5b82fG2iOyCzWaVVmbRyuVLvmHn3pYOu0o+c2Ax3/UCkt9CYXDyJ0oTkQ+lsPDwBBh 8t+4IgG5BU0Pz1+Wr+LaL4sd8xsdZS0sOx0DeV5lqV8kCq9J3Es90dL5NKBAOuBnXc2rY 2gvOB4wOz6aXdXvRjvuzcbW+ITaBdx5/jIVhjMI4N7JB065RoMqdy14n1yEfws3WK85yw 2DHDcBypwylDUdU/WatCWjqKx8f+rKmTcUNH24ieqFVXSH3rwIpTpXX4YmXsWsBvqYw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Kddqcb3v; arc=none smtp.remote-ip=209.85.167.173 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F18D0606A332 for ; Wed, 2 Dec 2026 21:07:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F18D0606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Kddqcb3v Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-4b28d9537bcso223543b6e.0 for ; Wed, 02 Dec 2026 13:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796245664; x=1796850464; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ExJvkTo+cx6g7U4FDCU5Ea+oCeftN24wLBGnQkXuu+s=; b=Kddqcb3vJphrNOZLON9MdfOYxYfExGJaB2Lui+2m1s4ckx+SYIK22QiSya6IR5doL+ Z1O2CwKFpxGE8bEV8GNMAdmn5lkPVFFPoLJId+GSetfXIElF3g5xHalJuZhmSiLCoRly VdQ8cVSUV6xq8xwgE1H3iYQo7LpW61enfQQw1lTFRPo/m4LHr79j9QXUqmsrD+iT9o8k 1BEgxLXkSFvhHuQrSXPIEPb9nCa+HQCI1cm/6Mi933Adz3fe+v4NYXMt1xD6j+PW4KWR RP+8SLuTG2l3SViq1AenRilrXWheyZFpjMOqg/zQlSeTth7vKZVp3gFEge73AlGpbXBq vokw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796245664; x=1796850464; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ExJvkTo+cx6g7U4FDCU5Ea+oCeftN24wLBGnQkXuu+s=; b=N+h7OIHvyWCOqQjTvGC6PP5bWor1QPpVc2y1wVFuexAtzPxrjBGTOw2DRkYhQapSLV fY3PYuK3V8XNVH4/FOW6WO0nh7BjlJglcrcINZ11A5SqsQtERhjK9kxfqRDtF1QD63+U 48m6UhQgZWyjOgteKpTZ4o1AK27orsT3L2LKuxW9hqPgz72l55RAo/NJ6oECm8YlX7x9 JBb+iLWHouvTiiVjdGpJIophLHuHK43tMfbDLcEzDCqrP+wIWBcS3HcPvYrfNFxU9eU3 QlzVofPVw6BqVaXBeq34Yn+SXgzdFq6jkcc4yPWvjDeko24DYHGfGBu6hABAXZ4UDKk6 II3w== X-Forwarded-Encrypted: i=1; AL+hErEWKiiCN14p+dwsB4R4SnsVb3fQRaQ6oBn3re2KJdwYw/5S52Rg66YdiaW7XUR/PV9a3wai4HlLpcoj@vger.kernel.org X-Gm-Message-State: APuU4Z81REVnI3tbmjP5d19vHuTEG0d0Fy4AhsQTZuUXZkzcUcbh7Xq8 Nqqy2fGOHhLsUYZhyK3uQ2LmSWMGUfi6J0VAD4Dtblp9qlFVXhqFhstp X-Gm-Gg: AZFdTZftlGTjCVCAY1jry1kuzub62s4bxGCfYzJoMzshM693bMRxLAq1awWypxYibKi ZymtS75vt64ylIpH11Kl1SL+xIDznYqfcZIAVyqhItbhlRgp1RW6s26UYyzS4XRFVx57EbZwM7P a+NW6ycNSZLfsxt9fRNb9sa6JeKWA08j6x199rZs12eX5kqqqZVkkBPdIimQM6aT19iBm3e56/g E9J1n/X2YJUVLi4JlPyZxfea7o6W9m8TZKk3Q5U6zHqOK+5dz2KTeSVse7vhEMwRgUlRGwROw2w +6ob4CG83JxB9lsNHKkXx3jYHk5V1djA7ihUH1d9ZmvJV9yfM8istyX390ob6EtLoLDMMqA7ush TnDdUWic8w1MUFyilr8Y3QoCTd9FJWdlK6RuF9zVJTSU5MY8didFSK8L6mqCllWgPTKEFV/SrXE egnOIkFOCiJ/Omj82Wga6SDnPOuB2K+PS8bzkiyer19AQckUTZHOdQGb0Gqn+eRxEOPLboZ5KKi Ljn9pVpm8kbJDhmp9wUVD6sJ6j8Ugyxj+l0E3OIRVzHUOue9SEzjzEHpaeTY8j5J5yzYQTT3I1a RRUBkuhjrrWj/bdO96QShPzMWfzCCNvkZzSeOHXtRnul9ffdVw== X-Received: by 2002:a05:6809:2008:10b0:4c4:a040:958b with SMTP id 5614622812f47-57f071fc9f7mr40147b6e.0.1796245664012; Wed, 02 Dec 2026 13:07:44 -0800 (PST) Received: from [127.0.1.1] ([185.153.204.24]) by smtp.gmail.com with ESMTPSA id 5614622812f47-57a35655a5bsm31659562b6e.13.2026.12.02.13.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 13:07:43 -0800 (PST) From: Payton Fack Date: Wed, 02 Dec 2026 15:06:30 -0600 Subject: [PATCH libgpiod v3 2/2] dbus: add optional D-Bus activation file for gpio-manager X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-master-v3-2-08bbf2ce59b0@gmail.com> References: <20261202-master-v3-0-08bbf2ce59b0@gmail.com> In-Reply-To: <20261202-master-v3-0-08bbf2ce59b0@gmail.com> To: Bartosz Golaszewski , Bartosz Golaszewski , linux-gpio@vger.kernel.org Cc: Vincent Fazio , Payton Fack X-Mailer: b4 0.17-dev Add an io.gpiod1.service D-Bus system-service file whose SystemdService= points at gpio-manager.service, which lets dbus-daemon start the manager through systemd on demand when a client sends a request to io.gpiod1. On-demand activation is not wanted on every system, so gate it behind a new dbus-activation feature option. It defaults to disabled and requires systemd support. When disabled, the activation file is not installed. Signed-off-by: Payton Fack --- dbus/data/io.gpiod1.service | 8 ++++++++ dbus/data/meson.build | 7 +++++++ meson.build | 25 +++++++++++++++++++++++++ meson_options.txt | 6 ++++++ 4 files changed, 46 insertions(+) diff --git a/dbus/data/io.gpiod1.service b/dbus/data/io.gpiod1.service new file mode 100644 index 0000000..893ed74 --- /dev/null +++ b/dbus/data/io.gpiod1.service @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2026 Garmin Ltd. or its subsidiaries + +[D-BUS Service] +Name=io.gpiod1 +Exec=/bin/false +User=gpio-manager +SystemdService=gpio-manager.service diff --git a/dbus/data/meson.build b/dbus/data/meson.build index 8af178b..afe9929 100644 --- a/dbus/data/meson.build +++ b/dbus/data/meson.build @@ -18,6 +18,13 @@ if opt_systemd.allowed() and systemd_dep.found() install_data(gpio_manager_service, install_dir: systemd_unit_dir, ) + + if dbus_activation_enabled + install_data('io.gpiod1.service', + install_dir: system_bus_services_dir, + ) + endif + install_data('90-gpio.rules', install_dir: get_option('libdir') / 'udev' / 'rules.d', ) diff --git a/meson.build b/meson.build index 6eac41e..2648792 100644 --- a/meson.build +++ b/meson.build @@ -56,6 +56,7 @@ opt_bindings_glib = get_option('bindings-glib') opt_dbus = get_option('dbus') opt_introspection = get_option('introspection') opt_systemd = get_option('systemd') +opt_dbus_activation = get_option('dbus-activation') if opt_bindings_cxx.allowed() add_languages('cpp', native: false) @@ -178,6 +179,29 @@ else systemd_enabled = false endif +if opt_dbus_activation.allowed() + dbus_dep = dependency('dbus-1', required: opt_dbus_activation) + if dbus_dep.found() + opt_system_bus_services_dir = get_option('system-bus-services-dir') + if opt_system_bus_services_dir != '' + system_bus_services_dir = opt_system_bus_services_dir + else + system_bus_services_dir = dbus_dep.get_variable('system_bus_services_dir') + endif + endif + + dbus_activation_enabled = dbus_dep.found() +else + dbus_activation_enabled = false +endif + +if opt_dbus_activation.enabled() + assert(systemd_enabled, + 'D-Bus activation requires systemd support, which is disabled or was not found') + assert(dbus_enabled, + 'D-Bus activation requires D-Bus support, which is disabled or was not found') +endif + if opt_bindings_rust.allowed() cargo = find_program('cargo', required: opt_bindings_rust) @@ -323,5 +347,6 @@ summary({ 'gpioset interactive' : libedit_dep.found(), 'GObject introspection' : introspection_enabled, 'systemd' : systemd_enabled, + 'D-Bus activation' : dbus_activation_enabled, 'Profiling' : get_option('profiling'), }, section: 'Features', bool_yn: true) diff --git a/meson_options.txt b/meson_options.txt index 64e3c14..1fb6e00 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -34,8 +34,14 @@ option('introspection', type: 'feature', option('systemd', type: 'feature', description: 'Install systemd unit and udev rules (requires dbus)') +option('dbus-activation', type: 'feature', value: 'disabled', + description: 'Install D-Bus activation file for gpio-manager (requires systemd)') + option('systemd-unit-dir', type: 'string', value: '', description: 'Directory for systemd system unit files (default: from pkg-config)') +option('system-bus-services-dir', type: 'string', value: '', + description: 'Directory for D-Bus system bus service files (default: from pkg-config)') + option('profiling', type: 'boolean', value: false, description: 'Enable gcov profiling on the core library and tests') -- 2.56.1