kexec-tools/kdump_build_helpers/generate_module_list

30 lines
661 B
Plaintext
Raw Normal View History

2009-05-14 20:09:31 +00:00
#!/bin/sh
BASE_DIR=$1
STAGE_DIR=$BASE_DIR/stage
#This build helper queries the currently loaded modules
#copies them to the initrd, and builds the /etc/module_load_list file
mkdir -p $STAGE_DIR/modules
2009-05-18 13:51:17 +00:00
for i in `/sbin/lsmod | awk '{print $1}' | tail --lines=+2`
2009-05-14 20:09:31 +00:00
do
for j in `/sbin/modprobe --show-depends $i | awk '/^insmod/ {print $2}'`
do
bname=$(basename $j)
cp $j $STAGE_DIR/modules
2009-05-18 01:16:41 +00:00
grep -q $bname $STAGE_DIR/etc/module_load_list 2>/dev/null
2009-05-14 20:09:31 +00:00
# Add the module to the list if its not already there
# or if the list doesn't yet exist
if [ $? -ne 0 ]
then
echo /modules/$bname >> $STAGE_DIR/etc/module_load_list
fi
done
done
2009-05-15 20:23:55 +00:00
exit 0