From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 634BF13832E for ; Tue, 19 Jul 2016 17:37:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3589021C08F; Tue, 19 Jul 2016 17:37:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AC5F621C08F for ; Tue, 19 Jul 2016 17:37:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6C035340CCF for ; Tue, 19 Jul 2016 17:37:32 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8A94678D for ; Tue, 19 Jul 2016 17:37:29 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1468879781.314ae3dc781d7ae8fc26c276a85b0dc6ab6bc326.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/, runlevels/, conf.d/ X-VCS-Repository: proj/openrc X-VCS-Files: conf.d/Makefile conf.d/modules init.d/Makefile init.d/modules.in runlevels/Makefile X-VCS-Directories: init.d/ runlevels/ conf.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 314ae3dc781d7ae8fc26c276a85b0dc6ab6bc326 X-VCS-Branch: master Date: Tue, 19 Jul 2016 17:37:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d2ad848b-9768-4b46-88df-40ffb2479238 X-Archives-Hash: aedad0cd956c443e07abb50b467e4df0 commit: 314ae3dc781d7ae8fc26c276a85b0dc6ab6bc326 Author: William Hubbs gmail com> AuthorDate: Sun Jul 17 19:53:12 2016 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Jul 18 22:09:41 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=314ae3dc modules: add support for FreeBSD This is based on a patch submitted by Joe Maloney gmail.com>. This fixes #91. conf.d/Makefile | 2 +- conf.d/modules | 12 ++++++++---- init.d/Makefile | 4 ++-- init.d/modules.in | 22 +++++++++++++++++++++- runlevels/Makefile | 2 +- 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/conf.d/Makefile b/conf.d/Makefile index b8da0e0..fb54fc5 100644 --- a/conf.d/Makefile +++ b/conf.d/Makefile @@ -13,7 +13,7 @@ endif MK= ../mk include ${MK}/os.mk -CONF-FreeBSD= ipfw moused powerd rarpd savecore syscons +CONF-FreeBSD= ipfw modules moused powerd rarpd savecore syscons CONF-Linux= consolefont devfs dmesg hwclock keymaps killprocs modules mtab \ net-online diff --git a/conf.d/modules b/conf.d/modules index a062a62..c35b9ed 100644 --- a/conf.d/modules +++ b/conf.d/modules @@ -1,18 +1,22 @@ -# You can define a list modules for a specific kernel version, -# a released kernel version, a main kernel version or just a list. +# Linux users can define a list of modules for a specific kernel version, +# a released kernel version, a main kernel version or all kernel versions. # The most specific versioned variable will take precedence. +# FreeBSD users can only use the modules="foo bar" setting. #modules_2_6_23_gentoo_r5="ieee1394 ohci1394" #modules_2_6_23="tun ieee1394" #modules_2_6="tun" #modules_2="ipv6" #modules="ohci1394" -# You can give modules a different name when they load - the new name +# Linux users can give modules a different name when they load - the new name # will also be used to pick arguments below. +# This is not supported on FreeBSD. #modules="dummy:dummy1" -# Give the modules some arguments if needed, per version if necessary. +# Linux users can give the modules some arguments if needed, per version +# if necessary. # Again, the most specific versioned variable will take precedence. +# This is not supported on FreeBSD. #module_ieee1394_args="debug" #module_ieee1394_args_2_6_23_gentoo_r5="debug2" #module_ieee1394_args_2_6_23="debug3" diff --git a/init.d/Makefile b/init.d/Makefile index f256095..55db3d1 100644 --- a/init.d/Makefile +++ b/init.d/Makefile @@ -15,8 +15,8 @@ MK= ../mk include ${MK}/os.mk # Generic BSD scripts -SRCS-FreeBSD= hostid.in moused.in newsyslog.in pf.in rarpd.in rc-enabled.in \ - rpcbind.in savecore.in syslogd.in +SRCS-FreeBSD= hostid.in modules.in moused.in newsyslog.in pf.in rarpd.in \ + rc-enabled.in rpcbind.in savecore.in syslogd.in # These are FreeBSD specific SRCS-FreeBSD+= adjkerntz.in devd.in dumpon.in encswap.in ipfw.in \ mixer.in nscd.in powerd.in syscons.in diff --git a/init.d/modules.in b/init.d/modules.in index 6ff90d6..7a02c3a 100644 --- a/init.d/modules.in +++ b/init.d/modules.in @@ -17,7 +17,18 @@ depend() keyword -openvz -prefix -systemd-nspawn -vserver -lxc } -start() +FreeBSD_modules() +{ + local cnt=0 x + for x in $modules; do + ebegin "Loading module $x" + kldload "$x" + eend $? "Failed to load $x" && : $(( cnt += 1 )) + done + einfo "Autoloaded $cnt module(s)" +} + +Linux_modules() { # Should not fail if kernel do not have module # support compiled in ... @@ -68,3 +79,12 @@ start() done einfo "Autoloaded $cnt module(s)" } + +start() +{ + case "$RC_UNAME" in + FreeBSD|Linux) ${RC_UNAME}_modules ;; + *) ;; + esac + return 0 +} diff --git a/runlevels/Makefile b/runlevels/Makefile index df6b53a..d367147 100644 --- a/runlevels/Makefile +++ b/runlevels/Makefile @@ -32,7 +32,7 @@ SYSINIT-${OS}= BOOT-BSD= hostid newsyslog savecore syslogd swap-blk # Generic BSD stuff -BOOT-FreeBSD+= hostid newsyslog savecore syslogd +BOOT-FreeBSD+= hostid modules newsyslog savecore syslogd # FreeBSD specific stuff BOOT-FreeBSD+= adjkerntz dumpon syscons