diff options
-rwxr-xr-x | arch/arm/boot/deflate_xip_data.sh | 2 | ||||
-rwxr-xr-x | arch/powerpc/boot/wrapper | 2 | ||||
-rw-r--r-- | scripts/Makefile.lib | 2 | ||||
-rwxr-xr-x | scripts/file-size.sh | 4 | ||||
-rwxr-xr-x | scripts/link-vmlinux.sh | 4 |
5 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/boot/deflate_xip_data.sh b/arch/arm/boot/deflate_xip_data.sh index 1189598a25eb..07adfc734fa3 100755 --- a/arch/arm/boot/deflate_xip_data.sh +++ b/arch/arm/boot/deflate_xip_data.sh | |||
@@ -45,7 +45,7 @@ data_start=$(($__data_loc - $base_offset)) | |||
45 | data_end=$(($_edata_loc - $base_offset)) | 45 | data_end=$(($_edata_loc - $base_offset)) |
46 | 46 | ||
47 | # Make sure data occupies the last part of the file. | 47 | # Make sure data occupies the last part of the file. |
48 | file_end=$(stat -c "%s" "$XIPIMAGE") | 48 | file_end=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" "$XIPIMAGE") |
49 | if [ "$file_end" != "$data_end" ]; then | 49 | if [ "$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 2>&1 |
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 76fe3ccfd381..f9141eaec6ff 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
@@ -355,7 +355,7 @@ vmz="$tmpdir/`basename \"$kernel\"`.$ext" | |||
355 | 355 | ||
356 | # Calculate the vmlinux.strip size | 356 | # Calculate the vmlinux.strip size |
357 | ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" | 357 | ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" |
358 | strip_size=$(stat -c %s $vmz.$$) | 358 | strip_size=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" "$vmz.$$") |
359 | 359 | ||
360 | if [ -z "$cacheit" -o ! -f "$vmz$compression" -o "$vmz$compression" -ot "$kernel" ]; then | 360 | if [ -z "$cacheit" -o ! -f "$vmz$compression" -o "$vmz$compression" -ot "$kernel" ]; then |
361 | # recompress the image if we need to | 361 | # recompress the image if we need to |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 5fd60af76d98..ef592e993e92 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -329,7 +329,7 @@ dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) | |||
329 | size_append = printf $(shell \ | 329 | size_append = printf $(shell \ |
330 | dec_size=0; \ | 330 | dec_size=0; \ |
331 | for F in $1; do \ | 331 | for F in $1; do \ |
332 | fsize=$$(stat -c "%s" $$F); \ | 332 | fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \ |
333 | dec_size=$$(expr $$dec_size + $$fsize); \ | 333 | dec_size=$$(expr $$dec_size + $$fsize); \ |
334 | done; \ | 334 | done; \ |
335 | printf "%08x\n" $$dec_size | \ | 335 | printf "%08x\n" $$dec_size | \ |
diff --git a/scripts/file-size.sh b/scripts/file-size.sh new file mode 100755 index 000000000000..7eb7423416b5 --- /dev/null +++ b/scripts/file-size.sh | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/bin/sh | ||
2 | # SPDX-License-Identifier: GPL-2.0 | ||
3 | set -- $(ls -dn "$1") | ||
4 | printf '%s\n' "$5" | ||
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 08ca08e9105c..9045823c7be7 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh | |||
@@ -269,8 +269,8 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then | |||
269 | kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o | 269 | kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o |
270 | 270 | ||
271 | # step 3 | 271 | # step 3 |
272 | size1=$(stat -c "%s" .tmp_kallsyms1.o) | 272 | size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" .tmp_kallsyms1.o) |
273 | size2=$(stat -c "%s" .tmp_kallsyms2.o) | 273 | size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" .tmp_kallsyms2.o) |
274 | 274 | ||
275 | if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then | 275 | if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then |
276 | kallsymso=.tmp_kallsyms3.o | 276 | kallsymso=.tmp_kallsyms3.o |