]>
glassweightruler.freedombox.rocks Git - waydroid.git/blob - scripts/check-kernel-config.sh
6 echo "Provide a config file as argument"
12 if [ "$2" = "-w" ]; then
19 CONFIG_CGROUP_NET_CLASSID
22 CONFIG_NETFILTER_XT_TARGET_CHECKSUM
29 CONFIG_ANDROID_BINDER_DEVICES=\"binder,hwbinder,vndbinder,anbox-binder,anbox-hwbinder,anbox-vndbinder\"
43 echo -e "\n\nChecking config file for Halium specific config options.\n\n"
48 for c
in $CONFIGS_ON $CONFIGS_OFF;do
49 cnt
=`grep -w -c $c $FILE`
50 if [ $cnt -gt 1 ];then
51 ered
"$c appears more than once in the config file, fix this"
55 if [ $cnt -eq 0 ];then
58 echo "# $c is not set" >> "$FILE"
61 ered
"$c is neither enabled nor disabled in the config file"
67 for c
in $CONFIGS_ON;do
68 if grep "$c=y\|$c=m" "$FILE" >/dev
/null
;then
69 egreen
"$c is already set"
73 sed -i "s,# $c is not set,$c=y," "$FILE"
76 ered
"$c is not set, set it"
82 for c
in $CONFIGS_EQ;do
83 lhs
=$(awk -F= '{ print $1 }' <(echo $c))
84 rhs
=$(awk -F= '{ print $2 }' <(echo $c))
85 if grep "^$c" "$FILE" >/dev
/null
;then
86 egreen
"$c is already set correctly."
88 elif grep "^$lhs" "$FILE" >/dev
/null
;then
89 cur
=$(awk -F= '{ print $2 }' <(grep "$lhs" "$FILE"))
90 ered
"$lhs is set, but to $cur not $rhs."
92 egreen
"Setting $c correctly"
93 sed -i 's,^'"$lhs"'.*,# '"$lhs"' was '"$cur"'\n'"$c"',' "$FILE"
108 for c
in $CONFIGS_OFF;do
109 if grep "$c=y\|$c=m" "$FILE" >/dev
/null
;then
111 ewhite
"Unsetting $c"
112 sed -i "s,$c=.*,# $c is not set," $FILE
115 ered
"$c is set, unset it"
119 egreen
"$c is already unset"
123 if [ $errors -eq 0 ];then
124 egreen
"\n\nConfig file checked, found no errors.\n\n"
126 ered
"\n\nConfig file checked, found $errors errors that I did not fix.\n\n"
129 if [ $fixes -gt 0 ];then
130 egreen
"Made $fixes fixes.\n\n"