]>
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
27 CONFIG_ANDROID_BINDER_DEVICES=\"binder,hwbinder,vndbinder,anbox-binder,anbox-hwbinder,anbox-vndbinder\"
41 echo -e "\n\nChecking config file for Halium specific config options.\n\n"
46 for c
in $CONFIGS_ON $CONFIGS_OFF;do
47 cnt
=`grep -w -c $c $FILE`
48 if [ $cnt -gt 1 ];then
49 ered
"$c appears more than once in the config file, fix this"
53 if [ $cnt -eq 0 ];then
56 echo "# $c is not set" >> "$FILE"
59 ered
"$c is neither enabled nor disabled in the config file"
65 for c
in $CONFIGS_ON;do
66 if grep "$c=y\|$c=m" "$FILE" >/dev
/null
;then
67 egreen
"$c is already set"
71 sed -i "s,# $c is not set,$c=y," "$FILE"
74 ered
"$c is not set, set it"
80 for c
in $CONFIGS_EQ;do
81 lhs
=$(awk -F= '{ print $1 }' <(echo $c))
82 rhs
=$(awk -F= '{ print $2 }' <(echo $c))
83 if grep "^$c" "$FILE" >/dev
/null
;then
84 egreen
"$c is already set correctly."
86 elif grep "^$lhs" "$FILE" >/dev
/null
;then
87 cur
=$(awk -F= '{ print $2 }' <(grep "$lhs" "$FILE"))
88 ered
"$lhs is set, but to $cur not $rhs."
90 egreen
"Setting $c correctly"
91 sed -i 's,^'"$lhs"'.*,# '"$lhs"' was '"$cur"'\n'"$c"',' "$FILE"
106 for c
in $CONFIGS_OFF;do
107 if grep "$c=y\|$c=m" "$FILE" >/dev
/null
;then
109 ewhite
"Unsetting $c"
110 sed -i "s,$c=.*,# $c is not set," $FILE
113 ered
"$c is set, unset it"
117 egreen
"$c is already unset"
121 if [ $errors -eq 0 ];then
122 egreen
"\n\nConfig file checked, found no errors.\n\n"
124 ered
"\n\nConfig file checked, found $errors errors that I did not fix.\n\n"
127 if [ $fixes -gt 0 ];then
128 egreen
"Made $fixes fixes.\n\n"