From owner-dev-commits-src-all@freebsd.org Wed Jul 28 23:47:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C91D6671C0 for ; Wed, 28 Jul 2021 23:47:40 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GZr1l6hpfz3vZl for ; Wed, 28 Jul 2021 23:47:39 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f48.google.com with SMTP id j2so4479460wrx.9 for ; Wed, 28 Jul 2021 16:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=g+XWSYKTXh2XO6cRjyonw2GGhcoxUY8KHP+1rShENSo=; b=eNjy6PeQMByI1RWBFN3apngUmB5/3JB9SluWYAbFno9Ixm/DrIZgRT26LpcenA19CO jM8zgRzrUoX6TjCZGunQXc28C78q+CEI02Y1cS0WXvWOkz39Pkij3buUkw2nMRINqpGm nAh22oN8VjpWm+mZ+WIhkqSqp/rsS25E/RzPxtJ9csSkMbY0FFwXjjr9USDvBlpftjZ3 4DHWzk+XfyfX1SjkijXuNE07xQf3jqUEm5LIGaE4q2Pp1E8lmVaHwEv99web4mnWsa9i nF/GvIpWTLAx8EskezZnfM/Qrnj7rjgtSqOfjK4YaTo3Vtv1JbxZYW6kmI6ftmHfNc4G hvnw== X-Gm-Message-State: AOAM531qcCYftwPqGlLvImiqoVshh8D0ceY7P15PvmDszqvkG/50+aMF kMOjMz1cRZMYkuZi9ATW7yMlBg== X-Google-Smtp-Source: ABdhPJzpGaXWoEvlVuBu7DQCNXjFIkEK6sm3dCYk4rpI+nwZyRuFuU2qBqd3Kk/3LqLPW3iD9wQbvA== X-Received: by 2002:adf:eec5:: with SMTP id a5mr1630563wrp.317.1627516052645; Wed, 28 Jul 2021 16:47:32 -0700 (PDT) Received: from smtpclient.apple (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id b15sm1233175wrx.73.2021.07.28.16.47.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jul 2021 16:47:32 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: 07c4b78d0a1d - main - lua loader: Add disable-device to disable a device. From: Jessica Clarke In-Reply-To: <202107282254.16SMs5UV090332@gitrepo.freebsd.org> Date: Thu, 29 Jul 2021 00:47:31 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202107282254.16SMs5UV090332@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GZr1l6hpfz3vZl X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 23:47:40 -0000 On 28 Jul 2021, at 23:54, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D07c4b78d0a1d26b6441cf3e52b917f20= c932b9d0 >=20 > commit 07c4b78d0a1d26b6441cf3e52b917f20c932b9d0 > Author: Warner Losh > AuthorDate: 2021-07-28 22:52:38 +0000 > Commit: Warner Losh > CommitDate: 2021-07-28 22:53:00 +0000 >=20 > lua loader: Add disable-device to disable a device. >=20 > disable-device fooX will set hint.foo.X.disabled=3D1 as a way to = easily > disable a device attaching during boot. >=20 > Reviewed by: tsoome > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D31297 > --- > stand/lua/cli.lua | 15 +++++++++++++++ > stand/lua/cli.lua.8 | 10 ++++++++-- > 2 files changed, 23 insertions(+), 2 deletions(-) >=20 > diff --git a/stand/lua/cli.lua b/stand/lua/cli.lua > index cfdc69a520a0..12f6b57642db 100644 > --- a/stand/lua/cli.lua > +++ b/stand/lua/cli.lua > @@ -240,6 +240,21 @@ cli["show-module-options"] =3D function() > pager.close() > end >=20 > +cli["disable-device"] =3D function(...) > + local _, argv =3D cli.arguments(...) > + local d, u > + > + if #argv =3D=3D 0 then > + print("usage error: disable-device device") > + return > + end > + > + d, u =3D string.match(argv[1], "(%w*%a)(%d+)") > + if d ~=3D nil then > + loader.setenv("hint." .. d .. "." .. u .. ".disabled", = "1") > + end > +end > + > -- Used for splitting cli varargs into cmd_name and the rest of argv > function cli.arguments(...) > local argv =3D {...} > diff --git a/stand/lua/cli.lua.8 b/stand/lua/cli.lua.8 > index 390831d21452..fe1cd0450557 100644 > --- a/stand/lua/cli.lua.8 > +++ b/stand/lua/cli.lua.8 > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 17, 2020 > +.Dd July 24, 2021 > .Dt CLI.LUA 8 > .Os > .Sh NAME > @@ -91,10 +91,12 @@ module provides the following default commands: > .It > .Ic reload-conf > .It > -.Ic enable-module > +.Ic device-disable This is round the wrong way (and repeated below). Jess > .It > .Ic disable-module > .It > +.Ic enable-module > +.It > .Ic toggle-module > .It > .Ic show-module-options > @@ -131,6 +133,10 @@ The > .Ic show-module-options > command will dump the list of modules that loader has been made aware = of and > any applicable options using paged output. > +.Pp > +The > +.Ic device-disable > +command sets the environment variable that disables the device = argument. > .Ss Exported Functions > The following functions are exported from > .Nm :