kpatch: prevent installing a duplicate patch module

This commit is contained in:
Josh Poimboeuf 2014-05-21 10:09:11 -05:00
parent 761f1e8586
commit 7e76dba346
1 changed files with 2 additions and 0 deletions

View File

@ -184,6 +184,8 @@ case "$1" in
[[ -e "$PATCH" ]] || die "$PATCH doesn't exist"
[[ ${PATCH: -3} == ".ko" ]] || die "$PATCH isn't a .ko file"
find_module $(basename "$PATCH") && die "$PATCH is already installed"
echo "installing $PATCH to $USERDIR"
mkdir -p "$USERDIR" || die "failed to create install directory"
cp -f "$PATCH" "$USERDIR" || die "failed to install patch $PATCH"