aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2018-03-12 10:51:26 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2018-03-24 10:27:50 -0400
commit1b8837b61714c3743fadb3a6bbb57ffd53839e7c (patch)
tree0ef092c32a85b8380de32b443d683ea6f4b314c5
parent73b9160d0dfe44dfdaffd6465dc1224c38a4a73c (diff)
ARM: 8750/1: deflate_xip_data.sh: minor fixes
Send nm complaints about broken pipe (when sed exits early) to /dev/null. All errors should be printed to stderr. Don't trap on normal exit so the trap can return an error code. Signed-off-by: Nicolas Pitre <nico@linaro.org> Tested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rwxr-xr-xarch/arm/boot/deflate_xip_data.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/boot/deflate_xip_data.sh b/arch/arm/boot/deflate_xip_data.sh
index 1189598a25eb..5e7d758ebdd6 100755
--- a/arch/arm/boot/deflate_xip_data.sh
+++ b/arch/arm/boot/deflate_xip_data.sh
@@ -30,7 +30,7 @@ esac
30 30
31sym_val() { 31sym_val() {
32 # extract hex value for symbol in $1 32 # extract hex value for symbol in $1
33 local val=$($NM "$VMLINUX" | sed -n "/ $1$/{s/ .*$//p;q}") 33 local val=$($NM "$VMLINUX" 2>/dev/null | sed -n "/ $1\$/{s/ .*$//p;q}")
34 [ "$val" ] || { echo "can't find $1 in $VMLINUX" 1>&2; exit 1; } 34 [ "$val" ] || { echo "can't find $1 in $VMLINUX" 1>&2; exit 1; }
35 # convert from hex to decimal 35 # convert from hex to decimal
36 echo $((0x$val)) 36 echo $((0x$val))
@@ -48,12 +48,12 @@ data_end=$(($_edata_loc - $base_offset))
48file_end=$(stat -c "%s" "$XIPIMAGE") 48file_end=$(stat -c "%s" "$XIPIMAGE")
49if [ "$file_end" != "$data_end" ]; then 49if [ "$file_end" != "$data_end" ]; then
50 printf "end of xipImage doesn't match with _edata_loc (%#x vs %#x)\n" \ 50 printf "end of xipImage doesn't match with _edata_loc (%#x vs %#x)\n" \
51 $(($file_end + $base_offset)) $_edata_loc 2>&1 51 $(($file_end + $base_offset)) $_edata_loc 1>&2
52 exit 1; 52 exit 1;
53fi 53fi
54 54
55# be ready to clean up 55# be ready to clean up
56trap 'rm -f "$XIPIMAGE.tmp"' 0 1 2 3 56trap 'rm -f "$XIPIMAGE.tmp"; exit 1' 1 2 3
57 57
58# substitute the data section by a compressed version 58# substitute the data section by a compressed version
59$DD if="$XIPIMAGE" count=$data_start iflag=count_bytes of="$XIPIMAGE.tmp" 59$DD if="$XIPIMAGE" count=$data_start iflag=count_bytes of="$XIPIMAGE.tmp"