Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp313445pxb; Mon, 8 Nov 2021 14:09:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfQNmShNo4hdr6FvaxFU46svAOO752Tjbwdu6mvqjdD7bCYfz+CkCg4dAa2ditRteq8TFJ X-Received: by 2002:a05:6402:4246:: with SMTP id g6mr3320604edb.112.1636409352936; Mon, 08 Nov 2021 14:09:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636409352; cv=none; d=google.com; s=arc-20160816; b=0CeB7vUkIUJ0j+m59mb2cSOpnM7JKx9csTtGW/PGuRH4s4LfqvBPe0wTuQsU5MgA4o mVYQrRS40BVjpkRmpFcYhC6Xsnx5bWZD5W5sy+9aqPNFDLGnbnHpuuEjTnsn6re1jrgz ThkZhBdT873pT1B8ZJrBBGNl7s95kRCk45wZYizuQC/L7PhC7LviWGrGpfLPQ2jy9l2V jjaS+u71CUHeTKGdz8yKsRHOmc1ym8ZcZAt29Weoy/hSy30wW7iW3vl0VCAKG2v+9Ufz ls5K7iX3CXOyqqlEx2XeWHf4oZTsjgh3yVCUa/rwpWKeyb3PdqiPSASZq8WPYJWLuSfO zFNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r/ShGrEofE0Mbw2TFmkCF7bLCRcIj6mRckK1sCNH6PE=; b=V9cmd8Ix3be26tRf3Q/4KIkRZcmEr+hdia+Z7/RFgV0N6V5XJ5Lsvp3GffxLqU6JsP e/W2FvXlHnLiUh7fKuPYbw2I87Hf12Y0JtupoxyxmI71vuyVUabJCmjMoEj1+YLn6kJ0 CaS6XthPqEvZc6Cp8oRt9oWBYGvhg9ckwsBoq4UoQbmvJQx0T4BjDL2I2s6b+qU1Hwom Niy7jadGeX5dAuHZm0kF7dZfAbiFCyYpwcIxKNSO91ovI7daL+W3GYkJD/b/6dY3Shld jhzZOpG9uw7LesmfnJFyHexu2EFOCJJfwQD7uUVX1IJBsQK839A1N/k/YmF6QRYPaF45 doYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CoTNrkZJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du5si38401862ejc.89.2021.11.08.14.08.15; Mon, 08 Nov 2021 14:09:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CoTNrkZJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238230AbhKHRUw (ORCPT + 99 others); Mon, 8 Nov 2021 12:20:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:47206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbhKHRUu (ORCPT ); Mon, 8 Nov 2021 12:20:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB03561178; Mon, 8 Nov 2021 17:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636391885; bh=+WDW4Be1suFht0zC3mnSmRz2BI/lIZxA1DEVipn0jzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CoTNrkZJiQlpeviY6tGp3e5GWNP7KNc97k2QyQDqg35TBz8y/PK0L3YL081iiqBAY butJEI+4dLSVU/GECdZV5rXaUI75wzsePyA3fHXuFgCuiSDbmpGcReMfhhUU2mo1bw s6cbLIXKK56SfdC4x6msRS9IteklY4t0CnseprObx4pL3WI6mC71zNMVWDNNEvt1Dm 4Ikhj1M0tntxhdGBmH8Q296XT0trXsJvp3+WXZA/Wmow72WOHuHwG1NsQnzKgMnO7u 5K3OkhB48m9LP2l2EenViUUFzRGDiK1OIfCHCfr5MVN1NOZiN9sMkbMNS8qGTwL/ls 1jM45q9DTO/Eg== Date: Mon, 8 Nov 2021 09:18:05 -0800 From: "Darrick J. Wong" To: Lukas Czerner Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org, tytso@mit.edu, guan@eryu.me Subject: Re: [PATCH 1/2] common/rc: add _require_kernel_config and _has_kernel_config Message-ID: <20211108171805.GJ24282@magnolia> References: <20211108151916.27845-1-lczerner@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211108151916.27845-1-lczerner@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Nov 08, 2021 at 04:19:15PM +0100, Lukas Czerner wrote: > Add _require_kernel_config() and _has_kernel_config() helpers to check > whether a specific kernel configuration is enabled on the kernel. > > Signed-off-by: Lukas Czerner > --- > common/config | 1 + > common/rc | 29 +++++++++++++++++++++++++++++ > 2 files changed, 30 insertions(+) > > diff --git a/common/config b/common/config > index 164381b7..e0a5c5df 100644 > --- a/common/config > +++ b/common/config > @@ -226,6 +226,7 @@ export OPENSSL_PROG="$(type -P openssl)" > export ACCTON_PROG="$(type -P accton)" > export E2IMAGE_PROG="$(type -P e2image)" > export BLKZONE_PROG="$(type -P blkzone)" > +export GZIP_PROG="$(type -P gzip)" > > # use 'udevadm settle' or 'udevsettle' to wait for lv to be settled. > # newer systems have udevadm command but older systems like RHEL5 don't. > diff --git a/common/rc b/common/rc > index 0d261184..84154868 100644 > --- a/common/rc > +++ b/common/rc > @@ -4703,6 +4703,35 @@ _require_names_are_bytes() { > esac > } > > +_has_kernel_config() > +{ > + option=$1 > + uname=$(uname -r) > + config_list="$KCONFIG_PATH This new KCONFIG_PATH variable should be documented in the README. Otherwise, the logic looks solid. --D > + /proc/config.gz > + /lib/modules/$uname/build/.config > + /boot/config-$uname > + /lib/kernel/config-$uname" > + > + for config in $config_list; do > + [ ! -f $config ] && continue > + [ $config = "/proc/config.gz" ] && break > + grep -qE "^${option}=[my]" $config > + return > + done > + > + [ ! -f $config ] && _notrun "Could not locate kernel config file" > + > + # We can only get here with /proc/config.gz > + _require_command "$GZIP_PROG" gzip > + $GZIP_PROG -cd $config | grep -qE "^${option}=[my]" > +} > + > +_require_kernel_config() > +{ > + _has_kernel_config $1 || _notrun "Installed kernel not built with $1" > +} > + > init_rc > > ################################################################################ > -- > 2.31.1 >