From patchwork Fri Mar 20 23:35:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1259267 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=c1BuDvod; 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 48kgC74cDJz9sPk for ; Sat, 21 Mar 2020 10:36:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2102489379; Fri, 20 Mar 2020 23:36:17 +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 0Ml-mJwUT2WN; Fri, 20 Mar 2020 23:36:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 87FAF8937E; Fri, 20 Mar 2020 23:36:16 +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 E2A421BF9BD for ; Fri, 20 Mar 2020 23:36:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DEE6886BC5 for ; Fri, 20 Mar 2020 23:36:11 +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 IzSl4IuE-uMV for ; Fri, 20 Mar 2020 23:36:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3FE848855D for ; Fri, 20 Mar 2020 23:36:11 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id 10so6616183qtp.1 for ; Fri, 20 Mar 2020 16:36:11 -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:in-reply-to:references; bh=UD/esOlEzxqYMMR527xgf56vxPDxYhKageEl1pcOwJg=; b=c1BuDvod9CJFGpE07HvGL6sgYgHvH2iIXhtaRN96aMLpMbbUjK7Nr455LT//zPHjtv rlTAQUAFrdC81FSZKVjtik/GyIJW8K5q7vgg+x9CFc/fb8Iez0Z7N7tijW5qcf44J/ub +jjQtvxyhlHi9o+mOuBWAHdeViH8MdVbV4NLta//WYVAU1Ve4FSqCfD0k+Lze6iNIxxM FNPX2HOyLBeFDX3zWNBGzpKIHhDGNGc8Ujo9gCO5TAGUrrmeCTYcmBMVuNFiDxQUX1bn G8Lmp3WZBk6xBAq07m8pduOVfjeNbZomn6rw9yRDJqLxISg2I1tVsVURthfQGV8RPV0l ZGwg== 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=UD/esOlEzxqYMMR527xgf56vxPDxYhKageEl1pcOwJg=; b=mCz6o5ry9ny9jci0zf1P0td1TJrDM0IPYbEHNPU907R8TOThMXDvYAhGkE/NTZBv6w F6A6QrsGIXF88GTPdqbSrIjF2x/eCH2w9xjkF1xm30rE79yT7wPBPIH1VcV+7KXAmgW6 wqS4+mvCaCTBfvle3rzIow+qZI/G7T0eFI4Y16cpQ9uKYicMdr1jum8FdI1wN0y00+ED TcY2j1qli2AwZsci8uV14cXcoJAnh+Nj19PeWpTJejG//ikknxwq88qOUqHGkaJBPy4U ldQTUmqD7Ehf8tKOEHAuttFOu2JKMEaj/mfMIpvlh4xsPFPM7qBY4YXYoQ4AvIRJJG7N PAMw== X-Gm-Message-State: ANhLgQ1gOYPvSmDALpQpg5pjdx/Yg2TJVPhqVY99VIYVnglkeUZz5aXd 2Hp3urVTA1iIXxdCT1/bO/EZG+NZQe8= X-Google-Smtp-Source: ADFU+vuEe61Qk45aThgmce8I2AfEtmAhQta+kZQXZkjRFWlHffEaV87/G0MXtXI4GR132DfEivx4yg== X-Received: by 2002:aed:21bc:: with SMTP id l57mr10806138qtc.218.1584747370011; Fri, 20 Mar 2020 16:36:10 -0700 (PDT) Received: from casantos.remote.com (177.204.229.175.dynamic.adsl.gvt.net.br. [177.204.229.175]) by smtp.gmail.com with ESMTPSA id p38sm6265257qtf.50.2020.03.20.16.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 16:36:09 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Fri, 20 Mar 2020 20:35:46 -0300 Message-Id: <20200320233547.28586-6-unixmania@gmail.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20200320233547.28586-1-unixmania@gmail.com> References: <20200320233547.28586-1-unixmania@gmail.com> Subject: [Buildroot] [[PATCH RFC] 5/6] package/owfs: use modules-load to load the kernel module 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 , Lothar Felten , Adam Duskett MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos This is compatible with BusyBox/sysvinit (via S02modules-load), OpenRC and systemd. It also prevents trying to load the module each time the init script is executed. Signed-off-by: Carlos Santos --- Tested on QEMU with a kernel config with FUSE_FS=m. Only the module loading was tested, since there is no 1-wire device. --- package/owfs/S60owfs | 2 -- package/owfs/owfs.mk | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package/owfs/S60owfs b/package/owfs/S60owfs index feed676f8a..46b7ec775d 100644 --- a/package/owfs/S60owfs +++ b/package/owfs/S60owfs @@ -10,8 +10,6 @@ OWFS_ARGS="" case "$1" in start) printf "Starting ${NAME}: " - # Fuse may be in a module, so try to load it - modprobe -q fuse && printf "[fuse] " mkdir -p ${OWFS_MOUNTPOINT} start-stop-daemon -S -x ${DAEMON} -- \ --pid_file ${PID_F} -m ${OWFS_MOUNTPOINT} ${OWFS_DEVICES} \ diff --git a/package/owfs/owfs.mk b/package/owfs/owfs.mk index ffc0b3098d..a09a4bb37b 100644 --- a/package/owfs/owfs.mk +++ b/package/owfs/owfs.mk @@ -35,6 +35,17 @@ define OWFS_CREATE_MOUNTPOINT mkdir -p $(TARGET_DIR)/dev/1wire endef OWFS_POST_INSTALL_TARGET_HOOKS += OWFS_CREATE_MOUNTPOINT +ifeq ($(BR2_LINUX_KERNEL),y) +define OWFS_GEN_MODULES_CONF + $(INSTALL) -d -m 755 $(TARGET_DIR)/etc/modules-load.d + { \ + find $(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/kernel/fs/fuse -name 'fuse.ko*'; \ + } 2> /dev/null | { \ + sed 's:^.*/::; s:\.ko[^ ]*::'; \ + } > $(TARGET_DIR)/etc/modules-load.d/60-owfs.conf +endef +OWFS_TARGET_FINALIZE_HOOKS += OWFS_GEN_MODULES_CONF +endif else OWFS_CONF_OPTS += --disable-owfs endif