-
Notifications
You must be signed in to change notification settings - Fork 1
/
check-fragments-kernel
executable file
·71 lines (60 loc) · 1.82 KB
/
check-fragments-kernel
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
if [[ -f ${HOME}/.ragnar.rc ]]; then
source ${HOME}/.ragnar.rc
else
TOP=${TOP:-"${HOME}/ragnar-artifacts"}
fi
mkdir -p ${TOP}
clean_build=0
git_describe=$(git describe --long)
#ARCH=arm64
usage() {
echo -e "$0's help text"
echo -e " -a ARCH, specify the architecture to build, default: not set"
echo -e " -c, cleanup output and staging dir before building, default: 0"
echo -e " -f, fragment file"
echo -e " -h, prints out this help"
}
while getopts "a:cf:h" arg; do
case $arg in
a)
ARCH="$OPTARG"
;;
c)
clean_build=1
;;
f)
FRAGMENT_FILE="$OPTARG"
;;
h|*)
usage
exit 0
;;
esac
done
if [[ ! -f ${FRAGMENT_FILE} ]]; then
echo -e "No such file: ${FRAGMENT_FILE}\n"
usage
exit 0
fi
OUTPUT=${OUTPUT:-"${TOP}/build_output/${ARCH}/${git_describe}"}
STAGING=${STAGING:-"${TOP}/staging/${ARCH}/${git_describe}"}
if [[ $clean_build -eq 1 ]]; then
echo "Cleaning up output and staging dir before building!"
rm -rf ${OUTPUT}
rm -rf ${STAGING}
fi
mkdir -p ${OUTPUT}
mkdir -p ${STAGING}
make -j ${NUM_CPUS} CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} KDIR=${KDIR} O=${OUTPUT} allnoconfig 2>&1 | tee ${STAGING}/make_config.log
ARCH=${ARCH} ./scripts/kconfig/merge_config.sh -O ${OUTPUT} ${FRAGMENT_FILE}
for conf_frag in $(cat ${FRAGMENT_FILE} | cut -f 1 -d\=) ; do
if [[ -z $(grep -w ${conf_frag} ${OUTPUT}/.config) ]]; then
echo = ${conf_frag} =
fi
done
echo "------------------------------------------------------------------"
echo "iterate over this find whats missing with the first frament in the"
echo "list above, add it to the fragment file and rerun this script $0"
echo "command to run:"
echo " make ARCH=${ARCH} O=${OUTPUT} menuconfig"