# 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
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)."
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}/$*"
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
#!/bin/bash
-modules_dep_list()
+modules_kext()
{
if [ "${PAT}" -gt "4" ]
then
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
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
}