Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp340954pxp; Wed, 9 Mar 2022 04:10:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUZ0k7tOf6cejDF3x7g7JZ9WRI9n5IFRtEVgUQanZFcAlEqDQAt4S2p/fI4NjFR9qNyUk+ X-Received: by 2002:a17:90b:344d:b0:1be:f346:e22b with SMTP id lj13-20020a17090b344d00b001bef346e22bmr9884449pjb.14.1646827841837; Wed, 09 Mar 2022 04:10:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646827841; cv=none; d=google.com; s=arc-20160816; b=kxi8r4wNSu/z6bBEzzL/wGY6p8RcgDXmvHjG6aJwi9nQMTV4G86eD1bXI9485bWOW8 RUXgNUk4VMzx5VBx8k22CZ9CsTC5aDBtS833hlxWWu8ahAWESz6+76py8rdLFUOH5K+R f+m8su2EZ+Yux1jsYOjOkogMd+P1lsXJ80TSAwiFueEbb11QsyvIA0Qvwr3dfIpuB5ps Oo1zsJDFVTFiNI59aFqyOXj222eECWHuURp7w2hPX+B+Z1edMm8rmYsVKteZRTeEzTQj J8Qc7I79JUWZAZ+x0aQE9Ue2mR+QYxUaULBWlSaJr25znIyEfa/qSspI9rh86xtpw0Ub A3UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=9YhYrdnH4Fa0gh1Eb0DbawHXjGnoVfEUSn2Ydc0kc/k=; b=VdjwNpAt3XrwKI/HZW35nBRzE/gC+Fud5dA06bD/pV7GXzNNHhO8kOnwuFsaVfUcgk 34iZbh7tW4DyB3WZNBCTFwksB6iVkMb0ElS6rx99BXwJWCi546mqaibf6c6OUTb/oHD8 ymiyn610tNFuRZPQvWXYu6liKsT+blKM19l8vyxPZ/c+mCkPr/k2rmWcajn0VRoU9AFJ eNMsNlYnhmrzro1kKAcu34uJB/0UssvHRe20aYdCXZb6ZM2/TpOuquxDqwVAR5BbZDyZ rvhkY5pj5WMGV8GknptTKoJdsoccvCmhNPXEEfectR+SsW5e3tM91c6fH1p5qXoPYwGx rYtA== 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 y191-20020a638ac8000000b00380caf81d57si270164pgd.290.2022.03.09.04.09.43; Wed, 09 Mar 2022 04:10:41 -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 S231774AbiCIJSk (ORCPT + 99 others); Wed, 9 Mar 2022 04:18:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231935AbiCIJSj (ORCPT ); Wed, 9 Mar 2022 04:18:39 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEB41B7B8 for ; Wed, 9 Mar 2022 01:17:40 -0800 (PST) Received: (Authenticated sender: hadess@hadess.net) by mail.gandi.net (Postfix) with ESMTPSA id 558CB240007; Wed, 9 Mar 2022 09:17:38 +0000 (UTC) Message-ID: Subject: Re: [RFC] Bluetooth: Adding support for /etc/bluetooth/main.conf.d From: Bastien Nocera To: Sonny Sasaka Cc: Katherine Lai , BlueZ Date: Wed, 09 Mar 2022 10:17:37 +0100 In-Reply-To: References: <6f8f47ceebfbcfd7fa8b04a4df807ae822e2960c.camel@hadess.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 On Tue, 2022-03-08 at 14:50 -0800, Sonny Sasaka wrote: > Hi Bastien, > > > On Tue, Mar 8, 2022 at 2:14 AM Bastien Nocera > wrote: > > > > Hey Katherine, > > > > On Mon, 2022-03-07 at 10:57 -0800, Katherine Lai wrote: > > > Background > > > > > > 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 > > > > This isn't quite how the pattern is usually used. With the existing > > patterns, the OS-supplied stock configuration would be in > > /usr/lib/bluetooth/main.conf.d (maybe with the default .conf in the > > same directory as that subdir), with /etc/bluetooth/main.conf.d > > only > > used for the user/admin override the default configuration. > We did a bit of research and found that /etc/X and /etc/X.d is more > common, e.g. the one described in > https://www.redhat.com/sysadmin/etc-configuration-directories. This is documentation for an enterprise distribution, not how the pattern is now used upstream. $ ls -d1 /usr/lib/*.d/ /usr/lib/binfmt.d/ /usr/lib/environment.d/ /usr/lib/modprobe.d/ /usr/lib/modules-load.d/ /usr/lib/motd.d/ /usr/lib/pam.d/ /usr/lib/sysctl.d/ /usr/lib/sysusers.d/ /usr/lib/tmpfiles.d/ $ ls -d1 /usr/lib/*/*.d/ /usr/lib/dracut/dracut.conf.d/ /usr/lib/dracut/modules.d/ /usr/lib/fedora-third-party/conf.d/ /usr/lib/gconv/gconv-modules.d/ /usr/lib/kernel/install.d/ /usr/lib/NetworkManager/conf.d/ /usr/lib/NetworkManager/dispatcher.d/ /usr/lib/rpm/macros.d/ /usr/lib/systemd/ntp-units.d/ /usr/lib/udev/hwdb.d/ /usr/lib/udev/rules.d/ > If some distribution wants to organize the conf files to > /usr/lib/bluetooth (for stock by package managers) and > /etc/bluetooth/main.conf.d (for admin/users), I guess this is where > having a configurable path is useful. > What do you think? I'm saying this isn't the current pattern, especially for OSes where /usr is locked-down. I still think this isn't the right way to implement this feature.