Add --all-initrd-modules option to copy all kernel modules into initrd/ramfs. This is useful for netboot images

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@587 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Andrew Gaffney 17 years ago
parent 6c98ac18d3
commit 050a1da1d2

@ -2,6 +2,11 @@
# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
03 Feb 2008; Andrew Gaffney <agaffney@gentoo.org> gen_cmdline.sh,
gen_determineargs.sh, gen_moddeps.sh:
Add --all-initrd-modules option to copy all kernel modules into
initrd/ramfs. This is useful for netboot images
03 Feb 2008; Andrew Gaffney <agaffney@gentoo.org> generic/initrd.scripts,
generic/linuxrc:
Add setup_hotplug() function that runs before the modules are loaded to

@ -40,6 +40,7 @@ longusage() {
echo " --symlink Manage symlinks in /boot for installed images"
echo " --no-symlink Do not manage symlinks"
echo " --no-initrdmodules Don't copy any modules to the initrd"
echo " --all-initrd-modules Copy all kernel modules to the initrd"
echo " --callback=<...> Run the specified arguments after the"
echo " kernel and modules have been compiled"
echo " --static Build a static (monolithic kernel)."
@ -368,6 +369,10 @@ parse_cmdline() {
CMD_NOINITRDMODULES=1
print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
;;
--all-initrd-modules)
CMD_ALLINITRDMODULES=1
print_info 2 "CMD_ALLINITRDMODULES: ${CMD_ALLINITRDMODULES}"
;;
--callback=*)
CMD_CALLBACK=`parse_opt "$*"`
print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"

@ -99,6 +99,7 @@ determine_real_args() {
set_config_with_override 2 MODULESPACKAGE CMD_MODULESPACKAGE
set_config_with_override 2 KERNCACHE CMD_KERNCACHE
set_config_with_override 1 NOINITRDMODULES CMD_NOINITRDMODULES
set_config_with_override 1 ALLINITRDMODULES CMD_ALLINITRDMODULES
set_config_with_override 2 INITRAMFS_OVERLAY CMD_INITRAMFS_OVERLAY
set_config_with_override 1 MOUNTBOOT CMD_MOUNTBOOT
set_config_with_override 1 BUILD_STATIC CMD_STATIC

@ -1,6 +1,6 @@
#!/bin/bash
modules_dep_list()
modules_kext()
{
if [ "${PAT}" -gt "4" ]
then
@ -8,6 +8,12 @@ modules_dep_list()
else
KEXT=".o"
fi
echo ${KEXT}
}
modules_dep_list()
{
KEXT=$(modules_kext)
if [ -f ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep ]
then
cat ${INSTALL_MOD_PATH}/lib/modules/${KV}/modules.dep | grep ${1}${KEXT}\: | cut -d\: -f2
@ -54,16 +60,20 @@ gen_deps()
gen_dep_list()
{
local group_modules
rm -f ${TEMP}/moddeps > /dev/null
if [ "${ALLINITRDMODULES}" = "1" ]; then
strip_mod_paths $(find "${INSTALL_MOD_PATH}/lib/modules/${KV}" -name "*$(modules_kext)") | sort
else
local group_modules
rm -f ${TEMP}/moddeps > /dev/null
for group_modules in ${!MODULES_*}; do
gen_deps ${!group_modules}
done
for group_modules in ${!MODULES_*}; do
gen_deps ${!group_modules}
done
# Only list each module once
if [ -f ${TEMP}/moddeps ]
then
cat ${TEMP}/moddeps | sort | uniq
# Only list each module once
if [ -f ${TEMP}/moddeps ]
then
cat ${TEMP}/moddeps | sort | uniq
fi
fi
}

Loading…
Cancel
Save