From owner-freebsd-testing@freebsd.org Thu Jun 18 20:57:54 2020 Return-Path: Delivered-To: freebsd-testing@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 80231333D2C for ; Thu, 18 Jun 2020 20:57:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nvQp2f5Zz43rC for ; Thu, 18 Jun 2020 20:57:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 3C30E2B556 for ; Thu, 18 Jun 2020 20:57:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 4529D15F70; Thu, 18 Jun 2020 22:57:52 +0200 (CEST) From: "Kristof Provost" To: freebsd-testing@freebsd.org Subject: Querying kernel features Date: Thu, 18 Jun 2020 22:57:51 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: <6C6C4F2B-CD11-4777-A97C-D249C514DEEA@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 20:57:54 -0000 Say that I have a test for an optional kernel feature (say ALTQ, or TMPFS) is there an elegant way of figuring out at runtime if it’s available? Doing `sysctl kern.conftxt | grep ALTQ` feels a little inelegant, and is begging for issues with incorrect matches. I’m tempted to add a sysctl node for ALTQ, but perhaps there’s a better way. Or perhaps this should be a general feature (so we’d have nodes like kernel.feature.tmpfs=1). Regards, Kristof From owner-freebsd-testing@freebsd.org Thu Jun 18 23:19:54 2020 Return-Path: Delivered-To: freebsd-testing@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 BED99337A5A for ; Thu, 18 Jun 2020 23:19:54 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49nyZd729Jz4Djq; Thu, 18 Jun 2020 23:19:53 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 05INJiLZ022569 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 18 Jun 2020 16:19:45 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 05INJi1Z022568; Thu, 18 Jun 2020 16:19:44 -0700 (PDT) (envelope-from jmg) Date: Thu, 18 Jun 2020 16:19:44 -0700 From: John-Mark Gurney To: Kristof Provost Cc: freebsd-testing@freebsd.org Subject: Re: Querying kernel features Message-ID: <20200618231944.GB4213@funkthat.com> References: <6C6C4F2B-CD11-4777-A97C-D249C514DEEA@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6C6C4F2B-CD11-4777-A97C-D249C514DEEA@FreeBSD.org> X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Thu, 18 Jun 2020 16:19:45 -0700 (PDT) X-Rspamd-Queue-Id: 49nyZd729Jz4Djq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US] X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2020 23:19:54 -0000 Kristof Provost wrote this message on Thu, Jun 18, 2020 at 22:57 +0200: > Say that I have a test for an optional kernel feature (say ALTQ, or > TMPFS) is there an elegant way of figuring out at runtime if it???s > available? > > Doing `sysctl kern.conftxt | grep ALTQ` feels a little inelegant, and is > begging for issues with incorrect matches. > > I???m tempted to add a sysctl node for ALTQ, but perhaps there???s a > better way. Or perhaps this should be a general feature (so we???d have > nodes like kernel.feature.tmpfs=1). Look at kern.features... There's a FEATURE macro to add entries to that, but looks like there isn't any man page for it... sys/geom/eli/g_eli.c:FEATURE(geom_eli, "GEOM crypto module"); -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."