forked from RobertCNelson/linux-dev
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbone-config-checker.sh
executable file
·86 lines (76 loc) · 2.28 KB
/
bone-config-checker.sh
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh -e
DIR=$PWD
check_config_value () {
unset test_config
test_config=$(grep "${config}=" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=${value} >> ./KERNEL/.config"
else
if [ ! "x${test_config}" = "x${config}=${value}" ] ; then
echo "sed -i -e 's:${test_config}:${config}=${value}:g' ./KERNEL/.config"
fi
fi
}
check_config_builtin () {
unset test_config
test_config=$(grep "${config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=y >> ./KERNEL/.config"
fi
}
check_config_module () {
unset test_config
test_config=$(grep "${config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${config}=y" ] ; then
echo "sed -i -e 's:${config}=y:${config}=m:g' ./KERNEL/.config"
else
unset test_config
test_config=$(grep "${config}=" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=m >> ./KERNEL/.config"
fi
fi
}
check_config () {
unset test_config
test_config=$(grep "${config}=" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=y >> ./KERNEL/.config"
echo "echo ${config}=m >> ./KERNEL/.config"
fi
}
check_config_disable () {
unset test_config
test_config=$(grep "${config} is not set" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
unset test_config
test_config=$(grep "${config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${config}=y" ] ; then
echo "sed -i -e 's:${config}=y:# ${config} is not set:g' ./KERNEL/.config"
else
echo "sed -i -e 's:${config}=m:# ${config} is not set:g' ./KERNEL/.config"
fi
fi
}
check_if_set_then_set_module () {
unset test_config
test_config=$(grep "${if_config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${if_config}=y" ] ; then
check_config_module
fi
}
check_if_set_then_set () {
unset test_config
test_config=$(grep "${if_config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${if_config}=y" ] ; then
check_config_builtin
fi
}
check_if_set_then_disable () {
unset test_config
test_config=$(grep "${if_config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${if_config}=y" ] ; then
check_config_disable
fi
}
#