From patchwork Sat Apr 18 22:14:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1272739 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=gOqtr8yR; 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 494S1M3ngKz9sP7 for ; Sun, 19 Apr 2020 08:14:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9F5B785BE4; Sat, 18 Apr 2020 22:14:23 +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 gdJhUD1eOc73; Sat, 18 Apr 2020 22:14:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 757E485B5B; Sat, 18 Apr 2020 22:14:22 +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 A2A0D1BF577 for ; Sat, 18 Apr 2020 22:14:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 97CB020108 for ; Sat, 18 Apr 2020 22:14:20 +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 BNqdDDE3xldD for ; Sat, 18 Apr 2020 22:14:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by silver.osuosl.org (Postfix) with ESMTPS id E251F20035 for ; Sat, 18 Apr 2020 22:14:18 +0000 (UTC) Received: by mail-qv1-f68.google.com with SMTP id v18so2834146qvx.9 for ; Sat, 18 Apr 2020 15:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=1ZGdanan+ru8cTd9MDNmEa3VbR6mGfGM2pRCHmgnXIk=; b=gOqtr8yRJtDtdcAMbZ+taGLKaVvdOHqoR001g5F8wkvBHT0RSb+442jMqYuHxSALv5 2KOFYI7WkByIh7a6uAVnmvAneNz6xENLmmShFZe4YKVhmFL2CJ5TtsiSnJPmrRqAkjOm /AzVx9BfIj2xdMP4YG6rpjjJcCpItnoJ0XYtAcW2aJtwWM5zdWCx0yC/538+qvErmQtL a1ZaiKggiG+asuipnRdkTkMLCRL2Kgyj4Ez9xkYHduzreP9TwsEoG9ditzBnQg3X6Q4l uVdVIMGzcFXhcFn0y5GitAnK2rpWZrqgtUdirE/6yVTlpINO+Y5MLCQMeu5btaIsiwBF kVyw== 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; bh=1ZGdanan+ru8cTd9MDNmEa3VbR6mGfGM2pRCHmgnXIk=; b=phhceYqUlrThH0IaKAf+2Dt2v1AwT3/F0C2jKPY62q2pfR4n3YmSAqAfjYmWnhbUc7 1Y+lpGB6y/Y9NkGbdS8n+6JDDdpugFaFtdA5FWklgdqlcKEaSoJKeWUqGVn0y/L65EsA vHIEwl19wN1odMJc1Bvcfs3mJJeRTQQ3NPR2jNgnmQSpAraejhDM7Zd1ZdwyWfklXss9 tMJPlo7tQOkBhMHy4USDch+UOq1PPMOeO55N9A5ASoS0vKHAYnMz+x3t6OCz8YoNfi2M xPqVBLPd1J2k8mJYjWHqa9AnaaRMR6rSsx0rdp/KYshV2baZyhx0rFzBDyHeTk6bH97O S40g== X-Gm-Message-State: AGi0PuZvAvvco6NQWetTd1O0bzexiduevG7BpczJluBQdQGWoxnxZ5tq VqqtA+E8cVv8PG6S4M230ZLteMHHjL8= X-Google-Smtp-Source: APiQypKAJOYDM1N8pze6Qeq/0bk6HJ63u/Y6ikWYmzOJSGUO5cR3iRByyvuBiW/9qwcw3Oi+9aeSVQ== X-Received: by 2002:ad4:49c9:: with SMTP id j9mr8806863qvy.147.1587248057578; Sat, 18 Apr 2020 15:14:17 -0700 (PDT) Received: from casantos.remote.csb.com (189.27.141.225.dynamic.adsl.gvt.net.br. [189.27.141.225]) by smtp.gmail.com with ESMTPSA id h3sm5335252qkf.15.2020.04.18.15.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2020 15:14:16 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Sat, 18 Apr 2020 19:14:06 -0300 Message-Id: <20200418221411.1549783-1-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 Subject: [Buildroot] [PATCH v2 0/5] Add a kernel module loading mechanism 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 , Lothar Felten MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Currently there are two ways to load kernel modules in Buildroot: - via systemd (systemd-modules-load.service) - via OpenRC (/etc/init.d/modules) The systemd mechanism uses configuration files, each one containing a list of kernel module names to load, separated by newlines. Empty lines and lines whose first non-whitespace character is # or ; are ignored. Files are loaded in the following order: /etc/modules-load.d/*.conf /run/modules-load.d/*.conf /usr/lib/modules-load.d/*.conf OpenRC uses /etc/modules-load.d/*.conf, only, and does not ignore lines beginning with ';'. In order to provide a compatible mechanism for sysvinit/busybox init systems, this series does the following: Patch #1 adds a S02modules-load init script to kmod (which provides the "modprobe" utility). It roughly mimics the systemd service. Patch #2 adds the S02modules-load init script to Busybox. It's installed only if kmod is not selected and modprobe is included in buildroot. Patchs #3..5 modify packages dmraid, owfs and ti-sgx-km to use the modules-load mechanism. Package ti-gfx should be modified too, but I did not find a board configuration to test it. ABOUT THE REASON OF THIS SERIES Since late 2017 I have been working on porting libvirt to Buildroot, initially as part of my work at DATACOM and since April 2019 as a pet project, using hardware kindly donated by DATCOM[1]. libvirt is a big and complex package that has many build and run time dependencies and requires several kernel modules to work. In previous versions of the package, e.g. [2], the modules were loaded by the S92libvirtd init script. The next patch, however (to be submitted soon) will add support for both OpenRC and systemd init systems, so I needed a commom mechanism to load the modules. That was how the patches for kmod and busybox were born. The ones for dmraid, owfs an ti-sgx-km are just a consequence of my "scratch the itch" syndrome. :-) [1] https://www.datacom.com.br/en/produtos/network-appliance [2] https://patchwork.ozlabs.org/patch/1183162/ --- Carlos Santos (5): package/kmod: add modules-load init script package/busybox: add modules-load init script package/dmraid: use modules-load to load the kernel module package/owfs: use modules-load to load the kernel module package/ti-sgx-km: use modules-load to load the kernel module package/busybox/S11modules-load | 1 + package/busybox/busybox.mk | 12 ++++ package/dmraid/S20dmraid | 3 - package/dmraid/dmraid.mk | 12 ++++ package/kmod/S11modules-load | 115 ++++++++++++++++++++++++++++++++ package/kmod/kmod.mk | 10 +++ package/owfs/S60owfs | 2 - package/owfs/owfs.mk | 11 +++ package/ti-sgx-km/ti-sgx-km.mk | 10 +++ package/ti-sgx-um/S80ti-sgx | 19 +----- 10 files changed, 173 insertions(+), 22 deletions(-) create mode 120000 package/busybox/S11modules-load create mode 100644 package/kmod/S11modules-load