Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1146593pxp; Wed, 9 Mar 2022 22:41:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJywZMvQF9qXp4sW/dqCVGMFnTHS3+dLrW0Y1ocYx3jNVwE2FbNbewJMXwwztU42uLBFYbsx X-Received: by 2002:a17:902:a703:b0:151:efbf:247e with SMTP id w3-20020a170902a70300b00151efbf247emr3361127plq.166.1646894511158; Wed, 09 Mar 2022 22:41:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646894511; cv=none; d=google.com; s=arc-20160816; b=hlt4yBX6arstz9BXejYqtKYDl0hBO1B6q/Fd0Du2MusJB20tJL5744q8OSuRij/uDT 9gG2wALwN2ghbNTcX41JqMBSwY+2u6UhY/hvoKmyJzwUppTHoShQynnEpyWYAfBoSR0R L+lGGDBJVZdTs7lu+92ACYFo6qkJ/moTCTMHrirqXNV4A6J3Xi3jApTboKRM+O6FZCvi mJVTbvmHQKSCy1ay25zZbu7Iu43pTI1v2tIMBeD2YA+/QCjJzXNIR3I5P3zv5P9jsk/B 4hAw/qi0fzYtjjHgGMjB0zAvM6mtz7EoLfAtaof9mpzS5OfwHqnDI/MTcu4G9svNf3Bt MMFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=es3JyafYzC7vzfeDhYTd934vaAVSW2eJVfxgKVe4lbc=; b=kD3Bs6TUEuQh5gpk7oBA1J9t5HVlSLhp3VhmAPVWai8HP8kD2kHyo/K3AYlWn4ADfM K3S8f1RssV9t30+BCG7pCGiGT2qRYDj4YoLYkbmj/fvYOUHyb3bc9gbHnFq/AmE+J57X HfxXjR+06mi2GjQVopsf8Llkv1THHzd1o51QjQpaQWB6lVP2yasWKamvTBpqdi8QPmCi orsALPxpFvWzUoZeZTiaEcXGc4t55EdhrrP8iQOxdlOGUB6U7IK68Hu02+KF8+gRtoRM CQMWvRXM4EeNqz4H5xUMMtb4oGBgNEMO40Rp9oCLhZk47kBcRLUTnB5pbr3Zt5R9gdcc 2q3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VRpbZnV6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y70-20020a638a49000000b0037db5bbedeesi3975882pgd.557.2022.03.09.22.41.20; Wed, 09 Mar 2022 22:41:51 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VRpbZnV6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238175AbiCIUqJ (ORCPT + 99 others); Wed, 9 Mar 2022 15:46:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237001AbiCIUqI (ORCPT ); Wed, 9 Mar 2022 15:46:08 -0500 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2204F4BB96 for ; Wed, 9 Mar 2022 12:45:09 -0800 (PST) Received: by mail-yb1-xb30.google.com with SMTP id u10so6856969ybd.9 for ; Wed, 09 Mar 2022 12:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=es3JyafYzC7vzfeDhYTd934vaAVSW2eJVfxgKVe4lbc=; b=VRpbZnV6sRZoYzFm7pBnu+1WE4IPaZxA/LZ9oIokh53/iJfhRZwaJHtQXgEKzWBB8n +QSGGcb1bj5yypB+VnPgShNMUe2iX8JbrltYCpYLrV+ZOZLeaehSw5DpVNC4nsPLc2Xg Hlv1bHLhbHmxN1dT/sxtuoHtzoQjJWk893HNYl82rPH9lJIXrQR8/KiLfByJLOsVC7wq 2vHQ1S7btg2mB99DC3v4duwpGUFwfZzIEmjY0APzc2sYnn7CdhDyd3iMtaBz5F9k+ZdF 56Z/7sThNV21WuvYViZWAYkJonL3hyTmpwjZjCiyaMZK4bZGdbsIb1QL3XlsDJvLaOtW 9kyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=es3JyafYzC7vzfeDhYTd934vaAVSW2eJVfxgKVe4lbc=; b=pM7ah60iONFDgj1OmqTv+badoMM5mVStKs+GEMuYfxO+SVOGdWbNKuuFqKOdl13154 IaMSGZcbVzdrl0/ZI90j9PWHVfRvsdx3n5QB8shbTi3AIAw9Kw5FGeAz5yIf5UM70Kov DYv341HLvkpwM5J3CtKRYOvkuLF8FC/51R4oYa6dh+uJyrqmXCiaFA+hV5XRi03vUFk6 3WoDe7wZ0/1LNkcxM5sIMGTeSgHmrG7EQXxnSEOkTddqMe7IxhuWKgazeL0gEtAHpYBV UwkhRyrGQqPvp4PJDfrg6MgvZIVWtwLolCCGRon/6F3tZnq04waQLka57l1Gc8E+NolC p1cQ== X-Gm-Message-State: AOAM533gJaFoloiVM5YTHJ9BBTxJEX2QQwRsa8r2Rib1HRLB7kXOTqKy APDrPFuakFiJoDQPL6saPiEWCnWC8cMD/dRaDow= X-Received: by 2002:a25:9742:0:b0:61d:9526:ebc3 with SMTP id h2-20020a259742000000b0061d9526ebc3mr1363814ybo.578.1646858708204; Wed, 09 Mar 2022 12:45:08 -0800 (PST) MIME-Version: 1.0 References: <6f8f47ceebfbcfd7fa8b04a4df807ae822e2960c.camel@hadess.net> In-Reply-To: From: Luiz Augusto von Dentz Date: Wed, 9 Mar 2022 12:44:57 -0800 Message-ID: Subject: Re: [RFC] Bluetooth: Adding support for /etc/bluetooth/main.conf.d To: Bastien Nocera Cc: Sonny Sasaka , Katherine Lai , BlueZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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, On Wed, Mar 9, 2022 at 4:10 AM Bastien Nocera wrote: > > 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=E2=80=99s keyboard HID tests for only certain Blue= tooth > > > > controllers. These keyboards aren=E2=80=99t 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=E2=80=99s main.c, merge the params for each *.conf file fr= om > > > > /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. Before we start doing this we should check if the devices with problems don't implement Peripheral Preferred Connection Parameters (PPCP) as some of peripherals are not capable of updating the connection parameters themselves they depend on the central reading the PPCP, some years back we got someone attempting to implement PPCP support but the problem was that one needs to load all the devices connection parameters with Peripheral Preferred Connection Parameters management command, anyway it would be great to have support for PPCP even if that means reloading everything or perhaps we introduce something at socket level where the user can set the parameters which then gets saved once the update connection parameters procedure is completed. --=20 Luiz Augusto von Dentz