Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3288802pxp; Tue, 8 Mar 2022 11:08:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9tIbuWvLz8d8ErnT9/Y7t6fJdpOvi/gJYyChUFCe/0EiF0hIyHOnAK9gNHSf+qZOCFTxT X-Received: by 2002:a17:907:9626:b0:6da:6c6f:9825 with SMTP id gb38-20020a170907962600b006da6c6f9825mr14497804ejc.600.1646766526369; Tue, 08 Mar 2022 11:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646766526; cv=none; d=google.com; s=arc-20160816; b=0aJDsvJ0CZphXUoImIJk6TOBHl+3F941WbSfXQXgZm9aBXpgktsOtD95dhdf/3LYLc jU1Ogm9t6EvePPiDT92njmPfUrncKKAT+9N2tMIl0dDBmUkQUuV47u/vg6k1/FpAHC/5 BHRFsl59OIj7zQfSC0IF8M5fag6Cw8DGQfCmcx2zT/bI/hLvttu2pm1PCzuHLnL7P+Jt nvij3i1B4dunHAaUpr9Bo2DW1LtwPGKbWI7zdJVanSZs2MIpO/lUPLNP/Xp7PS/MnT50 XkwpplOoPhUsYEX/TUgiFNw3vsl5/wY0iOSfHz1/AksTp3EzPXYJ2Cx2cMZeI32P1rR6 8usA== 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=shN8wqTJM5UpHB5vpPmuMcIlcLJXAz5mwIR7Hfl9MF8=; b=usvhgUlxPbeECzMtdcZ7Ecm3++5bDEGQLTTBlc+zEzcHqCfQqjsNvs8U6/4ldL5mc5 yDFdWZylyisVSAfqD+Scvg2v1SKDLj+dnt6TTVQY+gugy/r+9ZTiXkMjYYQ70yHM+2Gn Kpbcn0nWJWzHZfbzIHDzFNFzJqTCTFjYFTPmCvSMPCebABJTS0B9YYJqnpjXS/oDc45T 4GxVnDN12fFb3GFa6NU+qDLEl14idSTQIGVFb+/8K4LeIXvvDk/GpymRW4392mpJKhft CtYT5SUhiO3OXo02GLsFHc5OwXgaFszMw6TWA5SvMD/s3ljpzLJgl7hR8tGqoCV586M5 dLNw== 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 bi14-20020a170906a24e00b006b87abe4b4esi10641554ejb.31.2022.03.08.11.08.01; Tue, 08 Mar 2022 11:08:46 -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 S242201AbiCHKPw (ORCPT + 99 others); Tue, 8 Mar 2022 05:15:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345627AbiCHKPv (ORCPT ); Tue, 8 Mar 2022 05:15:51 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1EFA42A18 for ; Tue, 8 Mar 2022 02:14:54 -0800 (PST) Received: (Authenticated sender: hadess@hadess.net) by mail.gandi.net (Postfix) with ESMTPSA id BA62340017; Tue, 8 Mar 2022 10:14:52 +0000 (UTC) Message-ID: <6f8f47ceebfbcfd7fa8b04a4df807ae822e2960c.camel@hadess.net> Subject: Re: [RFC] Bluetooth: Adding support for /etc/bluetooth/main.conf.d From: Bastien Nocera To: Katherine Lai , linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka Date: Tue, 08 Mar 2022 11:14:52 +0100 In-Reply-To: References: 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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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 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. I don't think that making it optional, or have the path changeable is needed, but the rest seems good. Cheers