mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-08 10:31:43 +01:00
POSIX says the -n option must be a positive decimal integer. Not all implementations of head(1) support negative numbers meaning offset from the end of the file. Instead, the sed expression '$d' has the same effect of removing the last line of the file. Signed-off-by: Michael Forney <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Will Deacon <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
34 lines
728 B
Bash
Executable File
34 lines
728 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Check if atomic headers are up-to-date
|
|
|
|
ATOMICDIR=$(dirname $0)
|
|
ATOMICTBL=${ATOMICDIR}/atomics.tbl
|
|
LINUXDIR=${ATOMICDIR}/../..
|
|
|
|
echo '' | sha1sum - > /dev/null 2>&1
|
|
if [ $? -ne 0 ]; then
|
|
printf "sha1sum not available, skipping atomic header checks.\n"
|
|
exit 0
|
|
fi
|
|
|
|
cat <<EOF |
|
|
asm-generic/atomic-instrumented.h
|
|
asm-generic/atomic-long.h
|
|
linux/atomic-fallback.h
|
|
EOF
|
|
while read header; do
|
|
OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})"
|
|
OLDSUM="${OLDSUM#// }"
|
|
|
|
NEWSUM="$(sed '$d' ${LINUXDIR}/include/${header} | sha1sum)"
|
|
NEWSUM="${NEWSUM%% *}"
|
|
|
|
if [ "${OLDSUM}" != "${NEWSUM}" ]; then
|
|
printf "warning: generated include/${header} has been modified.\n"
|
|
fi
|
|
done
|
|
|
|
exit 0
|