From 4f2d5d209c41d2951918e1196c4ca52dff4ead53 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Mon, 17 Feb 2014 14:55:57 -0600 Subject: [PATCH] variablize strip command and add --keep-file-symbols We need to keep the file symbols around for add-patches-section and link-vmlinux-syms to resolve ambigous symbols in vmlinux. Signed-off-by: Seth Jennings --- kpatch-build/kpatch-build | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 0ba88d9..9761478 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -30,6 +30,7 @@ KSRCDIR="$HOME/.kpatch/$ARCHVERSION" KSRCDIR_DIR="$(dirname $KSRCDIR)" KSRCDIR_CACHE="$KSRCDIR.tgz" TEMPDIR= +STRIPCMD="strip -d --keep-file-symbols" cleanup() { rm -Rf "$KSRCDIR" "$LOGFILE" "$TEMPDIR" > /dev/null 2>/dev/null @@ -127,7 +128,7 @@ mkdir "$TEMPDIR/patched" for i in "$(cat $TEMPDIR/changed_objs)"; do rm -f "$i" KCFLAGS="-ffunction-sections -fdata-sections" make "$i" >> "$LOGFILE" 2>&1 || die - strip -d "$i" >> "$LOGFILE" 2>&1 || die + "$STRIPCMD" "$i" >> "$LOGFILE" 2>&1 || die cp -f "$i" "$TEMPDIR/patched/" || die done @@ -136,7 +137,7 @@ mkdir "$TEMPDIR/orig" for i in "$(cat $TEMPDIR/changed_objs)"; do rm -f "$i" KCFLAGS="-ffunction-sections -fdata-sections" make "$i" >> "$LOGFILE" 2>&1 || die - strip -d "$i" >> "$LOGFILE" 2>&1 || die + "$STRIPCMD" -d "$i" >> "$LOGFILE" 2>&1 || die cp -f "$i" "$TEMPDIR/orig/" || die done @@ -158,7 +159,7 @@ cd patch ld -r -o output.o ../output/* >> "$LOGFILE" 2>&1 || die "$TOOLSDIR"/add-patches-section output.o ../vmlinux >> "$LOGFILE" 2>&1 || die KPATCH_BASEDIR="$TEMPDIR/core" KPATCH_BUILD="$KSRCDIR" KPATCH_NAME="$PATCHNAME" make >> "$LOGFILE" 2>&1 || die -strip -d "kpatch-$PATCHNAME.ko" >> "$LOGFILE" 2>&1 || die +"$STRIPCMD" "kpatch-$PATCHNAME.ko" >> "$LOGFILE" 2>&1 || die "$TOOLSDIR"/link-vmlinux-syms "kpatch-$PATCHNAME.ko" ../vmlinux >> "$LOGFILE" 2>&1 || die cp -f "$TEMPDIR/patch/kpatch-$PATCHNAME.ko" "$TEMPDIR/core/kpatch.ko" "$BASE" || die