Browse Source

Improved mkinitramfs to support a MKINITRD_MODULES env variable with an explicit space delimited list of modules to additionally install and mkinitramfs/50-kernel.sh to handle the case where the requested modules don't exist.

git-svn-id: svn://svn.opensde.net/opensde/package/branches/udev@21342 10447126-35f2-4685-b0cf-6dd780d3921f
early
Alejandro Mery 17 years ago
parent
commit
d59e906f10
1 changed files with 23 additions and 8 deletions
  1. +23
    -8
      base/mkinitramfs/files/50-kernel.sh

+ 23
- 8
base/mkinitramfs/files/50-kernel.sh

@ -43,21 +43,34 @@ if [ -n "$moddir" ]; then
module="$1"
source="$( find "$moddir/kernel" -name "$module.ko" | head -n 1 )"
fi
target="lib/modules/$kernelver/${source#$moddir/}"
if [ ! -f $target ]; then
echo -n " $module"
mkdir -p "${target%/*}"
cp "$source" "$target"
if [ -r "$source" ]; then
target="lib/modules/$kernelver/${source#$moddir/}"
for dep in $( $MODINFO "$source" | grep "^depends:" | tr -s ' ' | cut -d' ' -f2 | tr ',' ' ' ); do
module_install "$dep"
done
if [ ! -f $target ]; then
echo -n " $module"
mkdir -p "${target%/*}"
cp "$source" "$target"
for dep in $( $MODINFO "$source" | grep "^depends:" | tr -s ' ' | cut -d' ' -f2 | tr ',' ' ' ); do
module_install "$dep"
done
fi
else
modules_missing="$modules_missing $module"
echo -n " [$module]"
fi
}
echo -n "Installing modules:"
modules_missing=
if [ -n "$MKINITRD_MODULES" ]; then
for module in $MKINITRD_MODULES; do
module_install "$module"
done
fi
# greedy^3
find $moddir/kernel/drivers/{block,ata,ide,ieee1394,md,scsi,cdrom,usb,message} \
@ -68,4 +81,6 @@ if [ -n "$moddir" ]; then
echo
$DEPMOD -ae -b "$tmpdir" -F "$sysmap" "$kernelver"
[ -z "$modules_missing" ] || echo "Failed to find:$modules_missing"
fi

Loading…
Cancel
Save