mirror of https://github.com/dynup/kpatch
43 lines
915 B
Bash
Executable File
43 lines
915 B
Bash
Executable File
#!/bin/bash
|
|
# vim: tabstop=4 shiftwidth=4 expandtab
|
|
set -o nounset
|
|
set -o errexit
|
|
set -o pipefail
|
|
|
|
SCRIPT="`basename $BASH_SOURCE`"
|
|
|
|
arg1="$1"
|
|
shift
|
|
args=()
|
|
i=0
|
|
for arg in "$@"; do
|
|
args[$i]="$arg"
|
|
i=$((i + 1))
|
|
done
|
|
outfile=
|
|
|
|
die ()
|
|
{
|
|
echo "$SCRIPT: error: $*" >&2
|
|
exit 1
|
|
}
|
|
|
|
if [ -f kpatch-in-progress ] && [ "$arg1" = "gcc" ]; then
|
|
while [ "$#" -gt 0 ]; do
|
|
if [ "$1" = "-o" ]; then
|
|
case "$2" in
|
|
*.mod.o|*built-in.o|vmlinux.o|.tmp_kallsyms1.o|.tmp_kallsyms2.o|init/version.o|arch/x86/boot/version.o|arch/x86/boot/compressed/eboot.o|arch/x86/boot/header.o|arch/x86/boot/compressed/efi_stub_64.o|arch/x86/boot/compressed/piggy.o)
|
|
;;
|
|
*.o)
|
|
cp -f "$2" "$2.kpatch_orig"
|
|
;;
|
|
esac
|
|
break
|
|
fi
|
|
shift
|
|
done
|
|
fi
|
|
|
|
#exec $arg1 $args
|
|
exec "$arg1" "${args[@]}"
|