2013-01-18 00:09:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# vim: tabstop=4 shiftwidth=4 expandtab
|
|
|
|
set -o nounset
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
SCRIPT="`basename $BASH_SOURCE`"
|
|
|
|
|
2013-01-19 07:13:42 +00:00
|
|
|
arg1="$1"
|
|
|
|
shift
|
|
|
|
args=()
|
|
|
|
i=0
|
|
|
|
for arg in "$@"; do
|
|
|
|
args[$i]="$arg"
|
|
|
|
i=$((i + 1))
|
|
|
|
done
|
2013-01-18 00:09:26 +00:00
|
|
|
outfile=
|
|
|
|
|
|
|
|
die ()
|
|
|
|
{
|
|
|
|
echo "$SCRIPT: error: $*" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2013-01-19 07:13:42 +00:00
|
|
|
if [ -f kpatch-in-progress ] && [ "$arg1" = "gcc" ]; then
|
2013-01-18 00:09:26 +00:00
|
|
|
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)
|
2013-01-19 07:13:42 +00:00
|
|
|
cp -f "$2" "$2.kpatch_orig"
|
2013-01-18 00:09:26 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2013-01-19 07:13:42 +00:00
|
|
|
#exec $arg1 $args
|
|
|
|
exec "$arg1" "${args[@]}"
|