From patchwork Thu Feb 27 20:08:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1246077 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.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=R8TGnqRl; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48T3dd4XRpz9sPK for ; Fri, 28 Feb 2020 07:08:37 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 63AD8230A1; Thu, 27 Feb 2020 20:08:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oy6A9pVqZ01t; Thu, 27 Feb 2020 20:08:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 87A8B230FB; Thu, 27 Feb 2020 20:08:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id E92DE1BF3AF for ; Thu, 27 Feb 2020 20:08:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E630E88031 for ; Thu, 27 Feb 2020 20:08:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VJIUc9pGzM9C for ; Thu, 27 Feb 2020 20:08:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 4988E88002 for ; Thu, 27 Feb 2020 20:08:28 +0000 (UTC) Received: by mail-qv1-f67.google.com with SMTP id bo12so191870qvb.13 for ; Thu, 27 Feb 2020 12:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T958yuoLIu5BIbFt6u8fwIYl1is4Twq3l7ca5XQRAto=; b=R8TGnqRlLf4HQZxbmWwZ2r1T7HJHD6HP6beeLBcwdR8huisWDBxuDdE+AG15HeoRVr /ma/OO8ud/2erTx4yQvT0HJqtGq6Nz83aM/davluCOvND6BnpTKd6A1G8FFYwqzHFXz7 1YYJ9HUT5vY2JYpIa8cnvFItCsDUmxyJtWTqil53CliziKzRdi4PYrCao+ls/ppbooKe RhmFhxHrtqoilWRKGdsV7j0ELk1E4GZgerwK2MFDDtjE71sQdPPzFh2gM80YCqvOG9M8 jO3jfmrmA/i2VukKDE9jWSl1F40zPLL93hTDhd7DYsZiBEvPpUPBGA0LjtrTwtwOjcQz VzyA== 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:in-reply-to :references; bh=T958yuoLIu5BIbFt6u8fwIYl1is4Twq3l7ca5XQRAto=; b=H3tHwGwK25L2NqthvxVtNyvaYkKj3CAG/F1oMkO/GvczK3FooYJlQNe8sQJO5R31cV mBX33kUn/x/tHq+ivUq0ejRi462hH83wZPx4SIGxiEOfXh/Jv3h+Ijr9Y6rbTniITjmw E8BqKR4UDdSgG2hmUO/gaG21C5DKkF8dGzctXcD815r+0mZQiqX+Mvv3D9fIxkQ7R7li hCP5wZIRKnrW0pUSEsq5YJqBWnYdCqTrAmpBxo5+WuyV+D3z2MR7mvEoblKYGvSVabkw rd8/kCxJ+G9+Z4JXDCu0ZANC5fn0AaSbR2FCAT27NNO+4eiqRt5tFz3sGCsTWubWBTr2 6/mA== X-Gm-Message-State: APjAAAWqvBpK8MVueqaqHXS/zT+/KjtiKlkuR5CcXH7ZbF3V0TDKIaNY w+gyGuNoqQPF5Kd16iNxcf/9DSa0V4E= X-Google-Smtp-Source: APXvYqwPH1C72QaHGvocEzZM1luu0qK7UKb+p/RkzkJ+bG6rsMRs0rjJFGvMh0GY5dsiGR/C8wvulw== X-Received: by 2002:ad4:554b:: with SMTP id v11mr691175qvy.0.1582834106877; Thu, 27 Feb 2020 12:08:26 -0800 (PST) Received: from casantos.com (179.178.22.126.dynamic.adsl.gvt.net.br. [179.178.22.126]) by smtp.gmail.com with ESMTPSA id z4sm594599qtm.69.2020.02.27.12.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 12:08:26 -0800 (PST) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Thu, 27 Feb 2020 17:08:12 -0300 Message-Id: <20200227200815.26613-2-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200227200815.26613-1-unixmania@gmail.com> References: <20200227200815.26613-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH v2 1/4] Makefile: add SED_QUIET 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: Eric Le Bihan , Bernd Kuhls , Carlos Santos MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos - Save the sed command full path in HOSTSED - Define SED as "$(HOSTSED) -i -e" - Define SED_QUIET as "$(HOSTSED) -n -e" SED_QUIET will be used by the forthcoming KCONFIG_GET_OPT macro. Signed-off-by: Carlos Santos --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index eb68598059..25285eb5c2 100644 --- a/Makefile +++ b/Makefile @@ -307,7 +307,9 @@ HOSTLN := $(shell which $(HOSTLN) || type -p $(HOSTLN) || echo ln) HOSTNM := $(shell which $(HOSTNM) || type -p $(HOSTNM) || echo nm) HOSTOBJCOPY := $(shell which $(HOSTOBJCOPY) || type -p $(HOSTOBJCOPY) || echo objcopy) HOSTRANLIB := $(shell which $(HOSTRANLIB) || type -p $(HOSTRANLIB) || echo ranlib) -SED := $(shell which sed || type -p sed) -i -e +HOSTSED := $(shell which sed || type -p sed) +SED := $(HOSTSED) -i -e +SED_QUIET := $(HOSTSED) -n -e export HOSTAR HOSTAS HOSTCC HOSTCXX HOSTLD export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE From patchwork Thu Feb 27 20:08:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1246079 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=HshgzeKW; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48T3dk4ST0z9sPK for ; Fri, 28 Feb 2020 07:08:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 71AD7866AB; Thu, 27 Feb 2020 20:08:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lo+kVEj3AYD6; Thu, 27 Feb 2020 20:08:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0286C879FD; Thu, 27 Feb 2020 20:08:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 1FF9B1BF3AF for ; Thu, 27 Feb 2020 20:08:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1AFB8230A1 for ; Thu, 27 Feb 2020 20:08:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UtzrrTj4XfkU for ; Thu, 27 Feb 2020 20:08:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by silver.osuosl.org (Postfix) with ESMTPS id 4713E230FB for ; Thu, 27 Feb 2020 20:08:30 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id p34so265793qtb.6 for ; Thu, 27 Feb 2020 12:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=n+aCV9hq6QSB3A/kSiY7sVUMhDv8mfwDru3mMWXGEnc=; b=HshgzeKW/b9ST2jhbpWjZTTYaZ2JvAFb1DYCH+9BKHrTjSoQgW67PjvGNaaUzDeoES WiD3qCiRz2uuMu+zAL5vmNHPHIF/VT/5kEE0Yq7Y5QehBOGUndWfZg6obQ/7uQ1dM8BS MZi5aIn/Zk3nMYTjpqq6Eob8En/WJ3iRoBvkn+1CTJhv8H0WGEyajcyncQae+eY7mKDM 8RiSCKn/KnmfieTQ3HEAkF0LOEG2G1i5suDOQB4nqdQSbl0IEdC2jLuAVlZt2WQPN/UV 2fj54WssoQDRRLROlC4FVM1uhRuMhUZVaWpQNyElWTiDbERoVOCjpxaoJ7Jc0JAKOJxz x0dg== 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:in-reply-to :references; bh=n+aCV9hq6QSB3A/kSiY7sVUMhDv8mfwDru3mMWXGEnc=; b=MBiyGsyZjHIxkxRk8uPnlRRXCBnShz404w97Qrj6ti9+20yKbjaW5d6Djbcs6VHPZd L/shfT7cz5MTjwvmQ5n33mvKOAbQBx2+Kn+cCVbF9LQLX+t9TENkU1Ucy4GaG2C1f8D7 gNw4pK0lbOWZP6eqipwTEgQbUEXxBU9MJyGRODwhW/3sNoEnK6XqPNhWU958hJPOm6bw ZA/qH3ALPDU0ZehxcfaklBu8gdxrwzKM/H6KIp1BpejDMO+/Xc4itUXpTFakwTOffGHO cKrl0g9i02Qam2bOwdueQI/PHTyvTsnNDH2UOB/UPxf5U2EglSvJLVfKZB+yGejQoJZb RuEg== X-Gm-Message-State: APjAAAWvmJ073QD3tKzKHCWlue+S+Le+pQ4cjDu1/cnEcAuRNiMU8e16 m7SAXa6eSqjXrlKVDrAYBib6LqjFByk= X-Google-Smtp-Source: APXvYqykDGW70lUQUSc9ZAz6LDZN3GbNSDdxI4yKO0YNIphz4lUKGbLvtvvHCtvNevdN80ODAkqGPA== X-Received: by 2002:ac8:7cb0:: with SMTP id z16mr1045098qtv.276.1582834108991; Thu, 27 Feb 2020 12:08:28 -0800 (PST) Received: from casantos.com (179.178.22.126.dynamic.adsl.gvt.net.br. [179.178.22.126]) by smtp.gmail.com with ESMTPSA id z4sm594599qtm.69.2020.02.27.12.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 12:08:28 -0800 (PST) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Thu, 27 Feb 2020 17:08:13 -0300 Message-Id: <20200227200815.26613-3-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200227200815.26613-1-unixmania@gmail.com> References: <20200227200815.26613-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH v2 2/4] package/pkg-utils.mk: add KCONFIG_GET_OPT macro 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: Eric Le Bihan , Bernd Kuhls , Carlos Santos MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Given a config name and a file list, returns the config value if it is set in one of the files, otherwise returns an empty string. Files are searched in the given order and the last value found prevails over the other ones. Signed-off-by: Carlos Santos --- package/pkg-utils.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index d324934dba..6f9693e81a 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -16,6 +16,10 @@ define KCONFIG_ENABLE_OPT # (option, file) echo '$(1)=y' >> $(2) endef +define KCONFIG_GET_OPT # (option, files) +$(shell $(SED_QUIET) '/^\<$(1)\>=/h;$${x;s/$(1)=//p;}' $(2) 2> /dev/null) +endef + define KCONFIG_SET_OPT # (option, value, file) $(SED) "/\\<$(1)\\>/d" $(3) echo '$(1)=$(2)' >> $(3) From patchwork Thu Feb 27 20:08:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1246078 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=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=bqjTUWTV; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48T3dj28Fpz9sPK for ; Fri, 28 Feb 2020 07:08:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A11D988002; Thu, 27 Feb 2020 20:08:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tdyv7TcyNvls; Thu, 27 Feb 2020 20:08:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 03B5888031; Thu, 27 Feb 2020 20:08:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8D68B1BF3AF for ; Thu, 27 Feb 2020 20:08:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8AB8D86E15 for ; Thu, 27 Feb 2020 20:08:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id STed7ugxVHm4 for ; Thu, 27 Feb 2020 20:08:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5A9C0866AB for ; Thu, 27 Feb 2020 20:08:32 +0000 (UTC) Received: by mail-qv1-f67.google.com with SMTP id p2so203943qvo.10 for ; Thu, 27 Feb 2020 12:08:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mdl87JXYkIQahlRmg7MMagLRKTXf7SbDC6DAf8eZh3M=; b=bqjTUWTVGeAbFeLWauUCKPGVNmaTf1VofS2fE8yqawHHJZli467DwIGE1yEiKYyFfL szBVlMwRQc2vOR4Mtd6DwNf18cCur1GqMR+/IjzETR9Zis4a3/W+9L2HrSulP1E7wSVb ntolgkIyK02FdxdXUQHjXsuzZ6R/ltae5VSHdgfJO8xmbfr1bnuobaXiYvMcbIJwaGnv ZXNTa/awYSCny6EwM6mTQK0AfeZeitZtFI175wd42N2MXcloGIUJ3ESvofc8kKiKBeQM CoHaAS60Dw5PSwgHh+4KC5HJxSGtOCqRjJeD2+OaMXjx8FRm2oiF3h3/mH/0ObrOvoXl onyQ== 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:in-reply-to :references; bh=Mdl87JXYkIQahlRmg7MMagLRKTXf7SbDC6DAf8eZh3M=; b=YRgOqTV/tw9c8JzgQ3wMCeSR/jngZnXGYJOAV/gEY19poNOdp/SU60iBV10crXxLMA oYseQQLZS7RkHBzpghT9h1U3WLLQJoE5Eub+EAhk8tcMb+xg+WPOviNaIr83vr2tmCa7 dUbc5u7Hfkb8stjPvrFQ80sG3YHEmby9INHyHyC/+j88YS5cJanJwHAK7hfr9CzJP5/L K3/fTcRqmjL5JacdVLZwsxWhdKk4xQvGCndZXGYRLgea6xjlBcmOGLKEpUVtLJY9kLqY ODc7gfQs0JWjUz1syCeO8AV/faduJtRoiibBsbaGv4Exk1BDwHV+YYPTcHSsikLKM9Ji kO7Q== X-Gm-Message-State: APjAAAX6RF/v9UMp0IzZLPkcBSu3i3Cyqsur6n+Aoh+naRXOZrmWrAJf oYxdffAqdOmX77y99Z2VtgGfuCRtgoE= X-Google-Smtp-Source: APXvYqyio9N9ZG6BxJYqUOFAbS/yIfRMukrWbZoMQpgG9DtJQxYBN/Jd6a22FgnaGbBmgwOezLWLwA== X-Received: by 2002:a0c:f7c3:: with SMTP id f3mr683443qvo.52.1582834111033; Thu, 27 Feb 2020 12:08:31 -0800 (PST) Received: from casantos.com (179.178.22.126.dynamic.adsl.gvt.net.br. [179.178.22.126]) by smtp.gmail.com with ESMTPSA id z4sm594599qtm.69.2020.02.27.12.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 12:08:30 -0800 (PST) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Thu, 27 Feb 2020 17:08:14 -0300 Message-Id: <20200227200815.26613-4-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200227200815.26613-1-unixmania@gmail.com> References: <20200227200815.26613-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH v2 3/4] package/openrc: adapt "modules" init script to busybox "modprobe" 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: Eric Le Bihan , Bernd Kuhls , Carlos Santos MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos If kmod tools are not selected, check the busybox configuration files and adapt the modules script accordingly: - Busybox modprobe does not have a "--first-time" option. - The "--verbose" option is just "-v". - The "--use-blacklist" option is just "-b". Also blacklist support is not selected in the default busybox configuration. If modprobe is not available, do not install the modules script and configuration file. Signed-off-by: Carlos Santos --- package/openrc/openrc.mk | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/package/openrc/openrc.mk b/package/openrc/openrc.mk index 3f6453cef5..0fc87f95b1 100644 --- a/package/openrc/openrc.mk +++ b/package/openrc/openrc.mk @@ -9,7 +9,7 @@ OPENRC_SITE = $(call github,OpenRC,openrc,$(OPENRC_VERSION)) OPENRC_LICENSE = BSD-2-Clause OPENRC_LICENSE_FILES = LICENSE -OPENRC_DEPENDENCIES = ncurses +OPENRC_DEPENDENCIES = ncurses $(if $(BR2_PACKAGE_BUSYBOX),busybox) # set LIBNAME so openrc puts files in proper directories and sets proper # paths in installed files. Since in buildroot /lib64 and /lib32 always @@ -29,9 +29,31 @@ else OPENRC_MAKE_OPTS += MKSTATICLIBS=yes endif -define OPENRC_BUILD_CMDS - $(MAKE) $(OPENRC_MAKE_OPTS) -C $(@D) +# modprobe can be provided by either kmod or busybox +ifeq ($(BR2_PACKAGE_KMOD_TOOLS),) +ifeq ($(BR2_PACKAGE_BUSYBOX),y) +# Busybox modprobe does not have a --first-time option; --verbose is just -v +# and --use-blacklist is just -b. +OPENRC_BB_FILES = $(BUSYBOX_KCONFIG_FILE) $(BUSYBOX_KCONFIG_FRAGMENT_FILES) $(BUSYBOX_BUILD_CONFIG) +ifeq ($(call KCONFIG_GET_OPT,CONFIG_MODPROBE,$(OPENRC_BB_FILES)),y) +ifeq ($(call KCONFIG_GET_OPT,CONFIG_FEATURE_MODPROBE_BLACKLIST,$(OPENRC_BB_FILES)),y) +OPENRC_MODULES_BLACKLIST = s/ --use-blacklist/ -b/ +else +OPENRC_MODULES_BLACKLIST = s/ --use-blacklist// +endif +define OPENRC_MODULES_CLEAN + $(SED) 's/ --first-time//;$(OPENRC_MODULES_BLACKLIST);s/--verbose/-v/' \ + $(@D)/init.d/modules.in +endef +else # BR2_PACKAGE_BUSYBOX +# No modprobe command available. Do not build/install the modules script. +define OPENRC_MODULES_CLEAN + $(SED) 's/ modules//' $(@D)/{conf.d,init.d,runlevels}/Makefile endef +endif # CONFIG_MODPROBE +OPENRC_POST_PATCH_HOOKS += OPENRC_MODULES_CLEAN +endif # BR2_PACKAGE_BUSYBOX +endif # BR2_PACKAGE_KMOD_TOOLS define OPENRC_INSTALL_TARGET_CMDS $(MAKE) $(OPENRC_MAKE_OPTS) DESTDIR=$(TARGET_DIR) -C $(@D) install From patchwork Thu Feb 27 20:08:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1246080 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=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=HcdbxybS; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48T3dl4bvMz9sRJ for ; Fri, 28 Feb 2020 07:08:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A417E88031; Thu, 27 Feb 2020 20:08:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MBIiL+Aqf+HG; Thu, 27 Feb 2020 20:08:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 0953688035; Thu, 27 Feb 2020 20:08:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B42B81BF3AF for ; Thu, 27 Feb 2020 20:08:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B163B86D42 for ; Thu, 27 Feb 2020 20:08:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zRKdGrnxXQFk for ; Thu, 27 Feb 2020 20:08:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 63DE2861C7 for ; Thu, 27 Feb 2020 20:08:34 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id l16so291161qtq.1 for ; Thu, 27 Feb 2020 12:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fm4KXDJp/OekGBzIcCvyDSNVpkwEYswLJmm5WANSKog=; b=HcdbxybSbbUdTdvCbNME2NQ5nIAb9V9Fk/imRLJGOgOEKGv9cnBPr8FzhylMm18M+U DBpExatYX93iWt5Sn/OxKTg/8GISD7uWs81PR/DGBPf64ype1hy/uRnHMlMY8+GNQsyT cc6KrPgM40WPvI4WpsFkQGSXckqLjqZVD1npEbDcRU2DUNofpbgLz1MIAKQuKHXAhPQc 2lxtZLygmtqkm1eWe7MTjcbAkgeZLLfdXs3EHdDh9SkUO966IJPoj9upwsG100ychEhG WC4PRaD0wdDYMYZG+SP/ybtNrb+mS+bbNlFGWzs5RQF41vVGqPFLE/GZ26zRKKIgOHDm s7cw== 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:in-reply-to :references; bh=Fm4KXDJp/OekGBzIcCvyDSNVpkwEYswLJmm5WANSKog=; b=amOxXVJmEIGG61f9cfqTbYdiRvL/mKvdjIRD3sRTMiCFcr7x2y1PphByWwXFj8Lo5W RmHQfhZUjahFHskX0q9fZ786tQapLJCg/nd/SiBqa/oE4il2/wbShWQSiqebENFVhg0R 2YA10HSQJJG53GppqASIM5TdfoaEarIxiYc1w3csTidOMavvVwtBsBCDN6oBpV6LgCbJ 71faeMa56DxJnJPK2s4fZNkVKz9HBIWY24lE29IIC7O/vZXKEWmoV4No0ch7Q+N3SrFT W4w5UO4Mh3sr1ATiN9CA0wCM2v3rXEUy7PrMcztZd3bh0rdsm7mrG094rSr70+5YRz4F fJ3Q== X-Gm-Message-State: APjAAAVLYx1mSFZl3zsTkwYC0gbxTPcqQ1n6IobpAWuClr967hr0mdRY DXOpL0TVEs+bHLNNoT7LtwnBP/hkqrA= X-Google-Smtp-Source: APXvYqywYNDFJsoHiCbCwZmcz44iDUVnuMNJjj7qhnsm1IZzNNFFOZ6mZTsSbQ8CE53xHk4mMG/YYQ== X-Received: by 2002:ac8:42de:: with SMTP id g30mr991303qtm.195.1582834113103; Thu, 27 Feb 2020 12:08:33 -0800 (PST) Received: from casantos.com (179.178.22.126.dynamic.adsl.gvt.net.br. [179.178.22.126]) by smtp.gmail.com with ESMTPSA id z4sm594599qtm.69.2020.02.27.12.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 12:08:32 -0800 (PST) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Thu, 27 Feb 2020 17:08:15 -0300 Message-Id: <20200227200815.26613-5-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200227200815.26613-1-unixmania@gmail.com> References: <20200227200815.26613-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH v2 4/4] package/busybox.mk: document the use of variables in openrc.mk 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: Eric Le Bihan , Bernd Kuhls , Carlos Santos MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Prevent filures if the variables are removed or renamed in the future. Signed-off-by: Carlos Santos --- package/busybox/busybox.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk index 9eeb784d2a..241a488e45 100644 --- a/package/busybox/busybox.mk +++ b/package/busybox/busybox.mk @@ -80,7 +80,9 @@ BUSYBOX_CFLAGS += "`$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`" BUSYBOX_CFLAGS_busybox += "`$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`" endif +# Warning: this is also used in package/openrc/openrc.mk. BUSYBOX_BUILD_CONFIG = $(BUSYBOX_DIR)/.config + # Allows the build system to tweak CFLAGS BUSYBOX_MAKE_ENV = \ $(TARGET_MAKE_ENV) \ @@ -105,8 +107,10 @@ ifndef BUSYBOX_CONFIG_FILE BUSYBOX_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG)) endif +# Warning: these two are also used in package/openrc/openrc.mk. BUSYBOX_KCONFIG_FILE = $(BUSYBOX_CONFIG_FILE) BUSYBOX_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES)) + BUSYBOX_KCONFIG_EDITORS = menuconfig xconfig gconfig BUSYBOX_KCONFIG_OPTS = $(BUSYBOX_MAKE_OPTS)