mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
![Michael Forney](/assets/img/avatar_default.png)
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 <mforney@mforney.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Will Deacon <will.deacon@arm.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190618053306.730-1-mforney@mforney.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
33 lines
728 B
Bash
Executable file
33 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
|