From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qddxa-00018Z-5C for garchives@archives.gentoo.org; Mon, 04 Jul 2011 07:52:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A02AA21C078; Mon, 4 Jul 2011 07:52:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 597D921C078 for ; Mon, 4 Jul 2011 07:52:42 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AB0661B4023 for ; Mon, 4 Jul 2011 07:52:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id CC1C68003D for ; Mon, 4 Jul 2011 07:52:40 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: init.d/, conf.d/ X-VCS-Repository: proj/openrc X-VCS-Files: conf.d/modules init.d/modules.in X-VCS-Directories: init.d/ conf.d/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: be990b308ae2e7a725852f22f285267dcfeeaa2a Date: Mon, 4 Jul 2011 07:52:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 5f0166267ada40446f3fc692069ba9a0 commit: be990b308ae2e7a725852f22f285267dcfeeaa2a Author: Robin H. Johnson gentoo org> AuthorDate: Mon Jul 4 07:48:51 2011 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Mon Jul 4 07:48:51 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3Dbe990b30 Bug 373808: init.d/modules skipped certain variable combinations The version iteration code missed certain combinations: KV=3D1.2.3.4 skips: 1.2.3, 1 KV=3D1.2.3 skips: 1 Simplify the code to use a loop and build the list of versions directly instead of unique variables per version component. Signed-off-by: Robin H. Johnson gentoo.org> --- conf.d/modules | 10 +++++++--- init.d/modules.in | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/conf.d/modules b/conf.d/modules index c5a3627..a062a62 100644 --- a/conf.d/modules +++ b/conf.d/modules @@ -1,8 +1,10 @@ # You can define a list modules for a specific kernel version, # a released kernel version, a main kernel version or just a list. +# The most specific versioned variable will take precedence. #modules_2_6_23_gentoo_r5=3D"ieee1394 ohci1394" #modules_2_6_23=3D"tun ieee1394" #modules_2_6=3D"tun" +#modules_2=3D"ipv6" #modules=3D"ohci1394" =20 # You can give modules a different name when they load - the new name @@ -10,10 +12,12 @@ #modules=3D"dummy:dummy1" =20 # Give the modules some arguments if needed, per version if necessary. +# Again, the most specific versioned variable will take precedence. #module_ieee1394_args=3D"debug" -#module_ieee1394_args_2_6_23_gentoo_r5=3D"ieee1394 ohci1394" -#module_ieee1394_args_2_6_23=3D"tun ieee1394" -#module_ieee1394_args_2_6=3D"tun" +#module_ieee1394_args_2_6_23_gentoo_r5=3D"debug2" +#module_ieee1394_args_2_6_23=3D"debug3" +#module_ieee1394_args_2_6=3D"debug4" +#module_ieee1394_args_2=3D"debug5" =20 # You should consult your kernel documentation and configuration # for a list of modules and their options. diff --git a/init.d/modules.in b/init.d/modules.in index ee4fdab..631e2e5 100644 --- a/init.d/modules.in +++ b/init.d/modules.in @@ -16,18 +16,21 @@ start() # support compiled in ... [ ! -f /proc/modules ] && return 0 =20 - local KV=3D$(uname -r) - local KV_MAJOR=3D${KV%%.*} - local x=3D${KV#*.} - local KV_MINOR=3D${x%%.*} - x=3D${KV#*.*.} - local KV_MICRO=3D${x%%-*} + local KV x y kv_variant_list + KV=3D$(uname -r) + # full $KV + kv_variant_list=3D"${KV}" + # remove any KV_EXTRA options to just get the full version + x=3D${KV%%-*} + # now slowly strip them + while [ -n "$x" ] && [ "$x" !=3D "$y" ]; do=20 + kv_variant_list=3D"${kv_variant_list} $x" + y=3D$x + x=3D${x%.*} + done=20 =20 local list=3D x=3D xx=3D y=3D args=3D mpargs=3D cnt=3D0 a=3D - for x in "$KV" \ - $KV_MAJOR.$KV_MINOR.$KV_MICRO \ - $KV_MAJOR.$KV_MINOR \ - ; do + for x in $kv_variant_list ; do eval list=3D\$modules_$(shell_var "$x") [ -n "$list" ] && break done @@ -45,10 +48,7 @@ start() fi aa=3D$(shell_var "$a") xx=3D$(shell_var "$x") - for y in "$KV" \ - $KV_MAJOR.$KV_MINOR.$KV_MICRO \ - $KV_MAJOR.$KV_MINOR \ - ; do + for y in $kv_variant_list ; do eval args=3D\$module_${aa}_args_$(shell_var "$y") [ -n "${args}" ] && break eval args=3D\$module_${xx}_args_$(shell_var "$y")