Merge pull request #339 from jpoimboe/module-name-fixes

module name fixes
This commit is contained in:
Seth Jennings 2014-07-29 20:59:39 -05:00
commit aa6f510bc0

View File

@ -250,14 +250,15 @@ fi
[[ -z $TARGETS ]] && TARGETS="vmlinux modules"
PATCHNAME="$(basename $PATCHFILE)"
PATCHNAME=$(basename "$PATCHFILE")
if [[ "$PATCHNAME" =~ \.patch ]] || [[ "$PATCHNAME" =~ \.diff ]]; then
PATCHNAME="${PATCHNAME%.*}"
fi
# Only allow alphanumerics and '_' and '-' in the module name.
# Everything else is replaced with '-'.
PATCHNAME=${PATCHNAME//[^a-zA-Z0-9_-]/-}
# Only allow alphanumerics and '_' and '-' in the module name. Everything else
# is replaced with '-'. Also truncate to 48 chars so the full name fits in the
# kernel's 56-byte module name array.
PATCHNAME=$(echo ${PATCHNAME//[^a-zA-Z0-9_-]/-} |cut -c 1-48)
find_dirs || die "can't find supporting tools"