Received: by 2002:ac2:48a3:0:0:0:0:0 with SMTP id u3csp628lfg; Thu, 10 Mar 2022 20:36:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNri5eJUgNwzmVJYiATRG9f+cy/Ej8KA7Y1Q3YjgzRQYuscEt4ZbdwiCDXT157RGitDQCr X-Received: by 2002:a17:90b:3e88:b0:1bf:3a96:54c1 with SMTP id rj8-20020a17090b3e8800b001bf3a9654c1mr8730322pjb.244.1646973386986; Thu, 10 Mar 2022 20:36:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646973386; cv=none; d=google.com; s=arc-20160816; b=W5HQmbh4OC/CQaLJ065ETS6jS19+8IcB1p3iyNEKCLrKwTWbJGzx5izrF2IXxSVnh8 tVnoL7cz5ElkWE1XJMyFrmZoNNPLs4O1h3/uuWMN0DNarLxqcWG5AVFqfEyvRTd0aT+1 c60BiyomSDd6KlzzhL2yYr80UH31Bh66aiwHUWJqzgHzotqUcw/ZsslhoIERiXPkXUuU V/IzVFHgtFfCqoz4pcAAd1bjJU0EL/Vs3LmmYq/zcwy10RiuiQMxx+xOw7re6eC2JCl7 8ZuoCWo/ZJFCFq1Ts0jrHUfeaBRyBDyCbMvC5lLxamdxWk3w/IPa3yaX4artL9BHq6Pa eWDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=12W6Frx6UsHG0nSuQ2R3llw5BuJxfbVn9+tw/MJJbSs=; b=I8IG57Kyjl6un3ehZZs7kHIoQZyMH1NEwlplaTTYDKHkdNbi0DO82tJuJ779Rup8+5 33C0+qw0hw1r7L23DF/QHTUDs2p8k7P1a7ecmVfrg6T26hTSwQwCZiPIpVqovw/bG9Ic 0DB9Yfutggxoc9B5UyH2TzP5zSkI0EOuKuFTUNfzLMpug9beAONOV3rTE66zkCVPq+0D cqMrqf+VGT4VG4VkK87f9wmJhg1QDur29YtfdxZpuYAHPWrgsTd3l6pOAMR/SywBQP+P qDsw0dSro/NGFqRaU20hCrLsNvHghzoyf+Jf3BzzKe+GAbxiVaquO5C022P7s85iyUAQ tDvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l63-20020a638842000000b003810c4980a4si647522pgd.519.2022.03.10.20.36.11; Thu, 10 Mar 2022 20:36:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244477AbiCJUF0 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 10 Mar 2022 15:05:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244427AbiCJUF0 (ORCPT ); Thu, 10 Mar 2022 15:05:26 -0500 Received: from mail.holtmann.org (coyote.holtmann.net [212.227.132.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 16422180219 for ; Thu, 10 Mar 2022 12:04:21 -0800 (PST) Received: from smtpclient.apple (p5b3d2183.dip0.t-ipconnect.de [91.61.33.131]) by mail.holtmann.org (Postfix) with ESMTPSA id 0E58ACECE2; Thu, 10 Mar 2022 21:04:21 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Subject: Re: [RFC] Bluetooth: Adding support for /etc/bluetooth/main.conf.d From: Marcel Holtmann In-Reply-To: Date: Thu, 10 Mar 2022 21:04:20 +0100 Cc: Katherine Lai , BlueZ Content-Transfer-Encoding: 8BIT Message-Id: <14A05E77-95D3-4313-B9F6-BC654CD96E01@holtmann.org> References: <3DAED89D-72AC-4D38-A092-D2A52AEEE5BB@holtmann.org> To: Sonny Sasaka X-Mailer: Apple Mail (2.3693.60.0.1.1) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sonny, >>> It was found that a change to the default settings for >>> MinConnectionInterval and MaxConnectionInterval in main.conf broke >>> some of ChromeOS’s keyboard HID tests for only certain Bluetooth >>> controllers. These keyboards aren’t able to connect to the device. >>> Since those connection parameters improve the connection interval for >>> most other chipsets, we want to leave the default values but have a >>> way to have an optional override to address problematic models. >>> >>> >>> Proposed Solution >>> >>> Adding support to bluetoothd for an additional config directory >>> /etc/bluetooth/main.conf.d containing multiple files which will >>> override common params. Override order will be lexically sorted >>> filename order. This pattern is already used by Linux distros, for >>> example there is /etc/sudoers.d which files will override common >>> params in /etc/sudoers. >>> >>> Users can add override config files to /etc/bluetooth/main.conf.d >>> rather than directly editing /etc/bluetooth/main.conf. This is more >>> friendly to package managers since BlueZ package updates won't cause >>> conflict to /etc/bluetooth/main.conf. >>> >>> In bluez’s main.c, merge the params for each *.conf file from >>> /etc/bluetooth/main.conf.d with the existing /etc/bluetooth/main.conf >>> in lexical filename order >>> >>> /etc/bluetooth/main.conf.d will be configurable at build time, e.g. >>> with ./configure --main-conf-dir >> >> actually I rather not do this. Let met try to explain this. In modern distribution layout, the /etc directory is purely for the admin of the system. They can do localized changes. Defaults are meant to be in /usr/lib/ actually. And override is also meant that an /etc file can fully replace an /usr/lib file. >> >> We already structured that /etc/bluetooth/main.conf is optional and that package managers / distros should only install it if they really know what they are doing. If an upgrade of a package overwrites /etc/bluetooth/main.conf then it is doing something wrong (mind you we don’t install it by default). >> >> That said, some time ago I discussed with Alain, that fundamentally you first need an option to identify your controller, what firmware etc. and then can decide what to load. That thread ended and got no further discussion. Based on that identification we wanted to allow tweaking certain set of parameters to add known good parameters / workaround to broken hardware. >> >> If you say, that you already know all of this anyway upfront and your filesystem is specific for a given platform, then use tmpfs for /etc/bluetooth/main.conf or alternatively, we actually introduce support for CONFIGURATION_DIRECTORY. We already have this in iwd and it would make sense to just support it. >> >> The CONFIGURATION_DIRECTORY directory comes from systemd (https://www.freedesktop.org/software/systemd/man/systemd.exec.html), but since it is just an environment variable for the bluetoothd process, you can do with any shell by just setting it. > > If I interpret this correctly, the reason against this proposal isn't > really about the location of the conf (/usr vs /etc), but rather that > BlueZ intends to use the main.conf already as an override (so there is > no need for another override), is that right? that is one of them. The other is that these days overrides are done differently as mentioned above. Regards Marcel