From patchwork Mon Aug 30 11:45:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jos=C3=A9_Pekkarinen?= X-Patchwork-Id: 1522210 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=unikie-com.20150623.gappssmtp.com header.i=@unikie-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=e7EZjBqh; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GypRj6NKXz9sT6 for ; Mon, 30 Aug 2021 21:45:53 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 92A4340154; Mon, 30 Aug 2021 11:45:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M73ze4fmNMBF; Mon, 30 Aug 2021 11:45:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id B91414017E; Mon, 30 Aug 2021 11:45:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 5E4F31BF39C for ; Mon, 30 Aug 2021 11:45:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4CA8D401B6 for ; Mon, 30 Aug 2021 11:45:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wswQCWdxcq6G for ; Mon, 30 Aug 2021 11:45:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by smtp2.osuosl.org (Postfix) with ESMTPS id D74564017E for ; Mon, 30 Aug 2021 11:45:36 +0000 (UTC) Received: by mail-lf1-x12f.google.com with SMTP id l2so22508117lfp.2 for ; Mon, 30 Aug 2021 04:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JoiqUXkAlp1sbunSGvnMnC1lzjdv2JBkO9JxcJRNNz4=; b=e7EZjBqhZkSYDos1Hlx91YVjA2p32rB0HYv4bpv2q6MB+mcZFLDgFW6K3c6DVOhs/O Vb345sstTe/3zGZRqwgMmz/Tq6SSvzIhQp7B9TzHqpD6zQDOUYwgb2k4REykBWE7SGYq evgGz0Yf+YsJZKMDB1QlqQpqv8uTrEhe+Wkt0GKTnWyYBJl18bhA3y4vxc7xRSfZObM1 aZgNyoebpur9Jtlk8lggH5V8R5lVFNd4Im3aKeVhqmEom3RrsA9v5toDKmvH5BuxtmLw Xq3XL8Cl4R7L5QNY8A61INJv40+PfEJPPwIj09nIE4X4uuD5BfddtzhywPTDDkfKxkgm B1pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JoiqUXkAlp1sbunSGvnMnC1lzjdv2JBkO9JxcJRNNz4=; b=Lop/0hX5299QrqQtVxj4jIWU0P6fAEn8l917sdJt2OhTcfJ/sBRmRM8t30ngrWUr5w ap3aXDN4jt9G14uQD4NtP9Mj2E1LOdodjfNXmcJPt4ncNCZ3nf4VRCzq/4Yw2Vv3svIy AB96c+slnio8bwEaVUH+RHnwUI9qvShr7cnC2adID2PGgcbMJd7Pp7fBMgDSidz1jPvj aaACH8xq27H0ICIwH9Lp5JW+9Z+rQr1hPyBFDT1dWjzX6tjWk339gROR8y6Vbysjwuzk Fox6hBioB3/asX+Liz9NBi7yr17EhPjE17ea+Of7eIyIKxS+xghwVlTJ238a50O5Q+OZ B3CQ== X-Gm-Message-State: AOAM531P+Bmxo4vauEtBmbLPsz7ChGl2jMSqhL9lFAT7ee6w6aMca5s5 pLEJ8SVwHCTH79LT6hUkhe02IGb8W5FKXoyt X-Google-Smtp-Source: ABdhPJzH2pp/wwtHu50ktNbxwQnQ7NiPHWVJ+E75/zww0/1EotMlKXSTwSilWDBzVp3jpCL/49HZ9Q== X-Received: by 2002:a19:dc09:: with SMTP id t9mr17088117lfg.593.1630323934682; Mon, 30 Aug 2021 04:45:34 -0700 (PDT) Received: from Unikie-T14-Gen-2i.madriguera.foxhound.fi (88-113-104-240.elisa-laajakaista.fi. [88.113.104.240]) by smtp.googlemail.com with ESMTPSA id x13sm957497lfq.262.2021.08.30.04.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 04:45:32 -0700 (PDT) From: =?utf-8?q?Jos=C3=A9_Pekkarinen?= To: buildroot@buildroot.org Date: Mon, 30 Aug 2021 14:45:31 +0300 Message-Id: <20210830114531.2285178-1-jose.pekkarinen@unikie.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/refpolicy: Treat all modules as custom X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Jos=C3=A9_Pekkarinen?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The current processing of the modules doesn't work for custom made policies appended through the extra dir mechanism, since sed won't find a match for custom modules, it will continue without triggering and error. This patch removes all the modules from modules.conf and add them one by one using REFPOLICY_MODULES values. Signed-off-by: José Pekkarinen --- package/refpolicy/refpolicy.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/refpolicy/refpolicy.mk b/package/refpolicy/refpolicy.mk index 0194708b37..1c0a2c3385 100644 --- a/package/refpolicy/refpolicy.mk +++ b/package/refpolicy/refpolicy.mk @@ -85,9 +85,9 @@ endef # In the context of a monolithic policy enabling a piece of the policy as # 'base' or 'module' is equivalent, so we enable them as 'base'. define REFPOLICY_CONFIGURE_MODULES - $(SED) "s/ = module/ = no/g" $(@D)/policy/modules.conf + $(SED) "/ = module/d" $(@D)/policy/modules.conf $(foreach m,$(sort $(REFPOLICY_MODULES)), - $(SED) "/^$(m) =/c\$(m) = base" $(@D)/policy/modules.conf + $(SED) "/^# Module: $(m)/a\$(m) = base" $(@D)/policy/modules.conf ) endef