-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchkdefconfigs
More file actions
executable file
·49 lines (44 loc) · 1.34 KB
/
chkdefconfigs
File metadata and controls
executable file
·49 lines (44 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash -eu
#
# Check defconfigs
#
fail=0
for config in DEFCONFIGS/* ; do
echo
echo "-- Process ${config}"
config=${config#*/}
arch=${config%%-*}
case "${arch}" in
amd64) kernarch="x86_64" ; ccompile="" ;;
arm64) kernarch="arm64" ; ccompile="aarch64-linux-gnu-" ;;
armhf) kernarch="arm" ; ccompile="arm-linux-gnueabihf-" ;;
ppc64el) kernarch="powerpc" ; ccompile="powerpc64le-linux-gnu-" ;;
s390x) kernarch="s390" ; ccompile="s390x-linux-gnu-" ;;
riscv64) kernarch="riscv" ; ccompile="riscv64-linux-gnu-" ;;
*) echo "-- Invalid architecture: ${arch}" >&2 ; exit 1 ;;
esac
if ! [ -f CONFIGS/"${config}" ] ; then
echo "-- No such file: CONFIGS/${config}" >&2
exit 1
fi
rm -rf buildd
mkdir buildd
cp DEFCONFIGS/"${config}" buildd/.config
ARCH=${kernarch} CROSS_COMPILE=${ccompile} \
cranky chroot run -- make O=buildd olddefconfig
diff buildd/.config CONFIGS/"${config}" > buildd/diff || true
if [ -s buildd/diff ] ; then
echo "-- Generated config file does not match CONFIGS/${config}" >&2
echo "-- Begin of diff" >&2
cat buildd/diff >&2
echo "-- End of diff" >&2
fail=$((fail + 1))
else
echo "-- Generated config file matches CONFIGS/${config}"
fi
done
if [ ${fail} -ne 0 ] ; then
echo
echo "-- ${fail} config file check(s) failed" >&2
exit 1
fi