From patchwork Thu Feb 27 12:39:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1245818 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.137; helo=fraxinus.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=fq1Iiy33; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Ssh26sK8z9sRY for ; Thu, 27 Feb 2020 23:40:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7096A86113; Thu, 27 Feb 2020 12:40:01 +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 brvUMkM6GxtZ; Thu, 27 Feb 2020 12:40:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E408586166; Thu, 27 Feb 2020 12:40:00 +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 8B9C71BF378 for ; Thu, 27 Feb 2020 12:39:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 889BF850D6 for ; Thu, 27 Feb 2020 12:39:56 +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 PFlCAc_ZGyv5 for ; Thu, 27 Feb 2020 12:39:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by fraxinus.osuosl.org (Postfix) with ESMTPS id D486F84FFF for ; Thu, 27 Feb 2020 12:39:54 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id 11so2945794qkd.1 for ; Thu, 27 Feb 2020 04:39:54 -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=dtnZ9RUO8bB9XzqX1kIQZdm7p5HQ9iB2WQveSqrJ0yo=; b=fq1Iiy332xxaEe43qj9hwhuWcSxv/74BPYetlhNzEkI6bso91SDBx1gmtsrzwghoAi 7eLy92vydDzfg1EL4ZuN2XXS0hiAKNxicf2TncFxHEDPONbFDBtV4zysG0MQdOGrxnUq S5jFKvgYh5Fv1Ef5fbn3WsZZEO30Q9f+FqCvH/LYZGBUgEJf8S5jRve/Li/ntzstRkx3 DojCLkWp5kdwLvzYiMYgU7CIEBXICO3ru7NyRmcjyV424oegUPmdyWJupqbDqUp/+I8M GLF1CvWhMjyieHzS/xffHgN5VNbRvqeRYx3xmYrU/9cgCAfvJ1a3ENXLi5U1JDgueDk7 ukJQ== 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=dtnZ9RUO8bB9XzqX1kIQZdm7p5HQ9iB2WQveSqrJ0yo=; b=Yq2HCo+47qFG739cqT6QvSYFMCe5sg2EvR1b9gYPJvxWkP10j08af3uvhISXm3g1/b 374jOckTuIkqATjDSKPerS9zM48ujSSWq71KtvCBUznUCFgYhWIwN4Yyy3pVIA0NbBjZ lhxZBTqRADBtG0aircaHd2YcJEQumXFH30Pdlmcu4TZutOemhaghAHpmy8HiP4QklvyQ jS3qfO23RtZY8BZ6H0PaLyWC9P2YFOCEUfd46DDnZq/QkeBOaK4yaJ8ix2ZlqG4OoipT lyMNwpaB92+MN+/OB9CLuGTmAeFjwVe5rVP3xiX9oPc2Nb64jk69U7hFLzY5O4mjpPGA u6TA== X-Gm-Message-State: APjAAAXgx9WWsFY0xc0Q8Iauu9r2edUgOKwaLdwEMZNpojqzRc+mb/Y/ 9CGqdynT8x8WNtOPRgsvZzphGA0v X-Google-Smtp-Source: APXvYqy1fUz66Ycbvd+pgb0cc3NNIXh4dGA+ls07A9CUHZNpQhbZ3ZcM7zT9NjysP7IJM9WXg8UecQ== X-Received: by 2002:ae9:e104:: with SMTP id g4mr4755409qkm.133.1582807193652; Thu, 27 Feb 2020 04:39:53 -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 y190sm2960285qkb.130.2020.02.27.04.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:39:53 -0800 (PST) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Thu, 27 Feb 2020 09:39:37 -0300 Message-Id: <20200227123938.13412-4-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200227123938.13412-1-unixmania@gmail.com> References: <20200227123938.13412-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH 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: Carlos Santos , Adam Duskett , =?utf-8?b?TWljaGHFgiDFgXlzemN6ZWs=?= MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos If kmod tools are not selected, check for the busybox features and adapt the modules script accordingly, since the busybox modprobe does not have a "--first-time" option, "--verbose" is just "-v" and "--use-blacklist" is just "-b". Also the 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 | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/package/openrc/openrc.mk b/package/openrc/openrc.mk index 3f6453cef5..999e34e094 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,30 @@ 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. +ifeq ($(call KCONFIG_GET_OPT,CONFIG_MODPROBE,$(BUSYBOX_BUILD_CONFIG)),y) +ifeq ($(call KCONFIG_GET_OPT,CONFIG_FEATURE_MODPROBE_BLACKLIST,$(BUSYBOX_BUILD_CONFIG)),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