aboutsummaryrefslogtreecommitdiff
path: root/scripts/uboot-script-gen
diff options
context:
space:
mode:
authorStefano Stabellini2020-04-14 13:38:10 -0700
committerStefano Stabellini2020-04-14 15:13:01 -0700
commit1ddba87493a1114011d4dcd76b08ee7e0775caea (patch)
tree807480502e37f1e7bf933ed06ab0af5d878494e8 /scripts/uboot-script-gen
parent4f53c7af211f919f34651828b97cae84cd00d7e7 (diff)
Use stat -L instead of stat, file -L instead of file
Use stat -L and file -L so that the two tools follow symlinks correctly. Also fix an error in check_file_type: the error function is called cleanup_and_return_err, not clean_up_and_err_out. Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com> Reviewed-by: Brian Woods <brian.woods@xilinx.com>
Diffstat (limited to 'scripts/uboot-script-gen')
-rw-r--r--scripts/uboot-script-gen8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index 9e81ad8..3e167b1 100644
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -105,7 +105,7 @@ function device_tree_editing()
function add_size()
{
local filename=$1
- local size=`stat --printf="%s" $filename`
+ local size=`stat -L --printf="%s" $filename`
memaddr=$(( $memaddr + $size + $offset - 1))
memaddr=$(( $memaddr & ~($offset - 1) ))
memaddr=`printf "0x%X\n" $memaddr`
@@ -138,11 +138,11 @@ function check_file_type()
type="executable\|data"
fi
- file $filename | grep "$type" &> /dev/null
+ file -L $filename | grep "$type" &> /dev/null
if test $? != 0
then
echo Wrong file type "$filename". It should be "$type", exiting.
- clean_up_and_err_out
+ cleanup_and_return_err
fi
}
@@ -157,7 +157,7 @@ function check_compressed_file_type()
cleanup_and_return_err
fi
- file $filename | grep "gzip compressed data" &> /dev/null
+ file -L $filename | grep "gzip compressed data" &> /dev/null
if test $? == 0
then
local tmp=`mktemp`