mirror of
https://github.com/dynup/kpatch
synced 2025-02-27 15:30:49 +00:00
Merge pull request #339 from jpoimboe/module-name-fixes
module name fixes
This commit is contained in:
commit
aa6f510bc0
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user