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 # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $ # $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, 03 Feb 2008; Andrew Gaffney <agaffney@gentoo.org> generic/initrd.scripts,
generic/linuxrc: generic/linuxrc:
Add setup_hotplug() function that runs before the modules are loaded to 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 " --symlink Manage symlinks in /boot for installed images"
echo " --no-symlink Do not manage symlinks" echo " --no-symlink Do not manage symlinks"
echo " --no-initrdmodules Don't copy any modules to the initrd" 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 " --callback=<...> Run the specified arguments after the"
echo " kernel and modules have been compiled" echo " kernel and modules have been compiled"
echo " --static Build a static (monolithic kernel)." echo " --static Build a static (monolithic kernel)."
@ -368,6 +369,10 @@ parse_cmdline() {
CMD_NOINITRDMODULES=1 CMD_NOINITRDMODULES=1
print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}" print_info 2 "CMD_NOINITRDMODULES: ${CMD_NOINITRDMODULES}"
;; ;;
--all-initrd-modules)
CMD_ALLINITRDMODULES=1
print_info 2 "CMD_ALLINITRDMODULES: ${CMD_ALLINITRDMODULES}"
;;
--callback=*) --callback=*)
CMD_CALLBACK=`parse_opt "$*"` CMD_CALLBACK=`parse_opt "$*"`
print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*" 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 MODULESPACKAGE CMD_MODULESPACKAGE
set_config_with_override 2 KERNCACHE CMD_KERNCACHE set_config_with_override 2 KERNCACHE CMD_KERNCACHE
set_config_with_override 1 NOINITRDMODULES CMD_NOINITRDMODULES 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 2 INITRAMFS_OVERLAY CMD_INITRAMFS_OVERLAY
set_config_with_override 1 MOUNTBOOT CMD_MOUNTBOOT set_config_with_override 1 MOUNTBOOT CMD_MOUNTBOOT
set_config_with_override 1 BUILD_STATIC CMD_STATIC set_config_with_override 1 BUILD_STATIC CMD_STATIC

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

Loading…
Cancel
Save