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