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 9DFEE139086 for ; Tue, 3 Jan 2017 05:16:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B824FE0C70; Tue, 3 Jan 2017 05:16:38 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 83B6CE0C70 for ; Tue, 3 Jan 2017 05:16:38 +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 23262341130 for ; Tue, 3 Jan 2017 05:16:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 90CC02521 for ; Tue, 3 Jan 2017 05:16:35 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1483419939.5745d52ff41afb75cca4002db768ed76994cc4ae.robbat2@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: genkernel genkernel.conf X-VCS-Directories: / X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 5745d52ff41afb75cca4002db768ed76994cc4ae X-VCS-Branch: master Date: Tue, 3 Jan 2017 05:16:35 +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: e45d5230-5127-42c7-b31c-6123835323c6 X-Archives-Hash: b802a82d694937b4165577141a0663ae commit: 5745d52ff41afb75cca4002db768ed76994cc4ae Author: Robin H. Johnson gentoo org> AuthorDate: Tue Jan 3 05:05:39 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Tue Jan 3 05:05:39 2017 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=5745d52f Allow complete override of MODULES_* The long-standing but undocumented AMODULES_* options allow adding ADDITIONAL modules during boot, but there was no way to completely override the MODULES_* variables. Add this functionality now, and document it in genkernel.conf. Fixes: https://bugs.gentoo.org/show_bug.cgi?id=186652 Signed-off-by: Robin H. Johnson gentoo.org> genkernel | 20 +++++++++++++++++--- genkernel.conf | 7 +++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/genkernel b/genkernel index eeaf5dd..444c559 100755 --- a/genkernel +++ b/genkernel @@ -105,16 +105,30 @@ echo # Set ${ARCH} get_official_arch -# Read arch-specific config print_info 1 "Using genkernel.conf from ${_GENKERNEL_CONF}" +# Save any customizations of MODULES_* first. +override_module_vars="$(compgen -A variable |grep '^MODULES_')" +for v in $override_module_vars ; do + print_info 1 "Saving $v to override defaults" + newvar=override_$v + eval "${newvar}='${!v}'" +done + +# Read arch-specific config print_info 1 "Sourcing arch-specific config.sh from ${ARCH_CONFIG} .." source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}" _MODULES_LOAD=${GK_SHARE}/arch/${ARCH}/modules_load print_info 1 "Sourcing arch-specific modules_load from ${_MODULES_LOAD} .." source "${_MODULES_LOAD}" || gen_die "Could not read ${_MODULES_LOAD}" -echo -# Merge modules_load from config +# Now apply customizations of MODULES_* +for v in $override_module_vars; do + newvar=override_$v + print_info 1 "Override $v, default (${!v}), new value (${!newvar})" + eval "${v}='${!newvar}'" +done + +# Merge additional modules_load from config for group_modules in ${!AMODULES_*}; do group="$(echo $group_modules | cut -d_ -f2)" eval cmodules="\$$group_modules" diff --git a/genkernel.conf b/genkernel.conf index 9ff7e4f..10a03bc 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -300,6 +300,13 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux" # Use this with caution. #AMODULES_group="module-to-include another-module" +# Override the default modules in the ramdisk, for a given group, as defined by +# /usr/share/genkernel/default/modules_load and the per-arch modules_load +# files. You PROBABLY want to use AMODULES_* above, and NOT MODULES_* here. +# If you use MODULES_* here, the default and per-arch modules will NOT be used. +#MODULES_group1="some-module" +#MODULES_group2="" # Load no modules for this group + # File to output a .tar.bz2'd modules after the # callbacks have run #MODULESPACKAGE="/path/to/file.bz2"