c25ce589dca10 (Finn Behrens 2020-11-23 15:15:33 +0100 1) #!/usr/bin/env bash
b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100 2) # SPDX-License-Identifier: GPL-2.0
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 3) # Manipulate options in a .config file from the command line
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 4)
7387778510b7d (Clement Chauplannaz 2013-05-12 21:08:51 +0200 5) myname=${0##*/}
7387778510b7d (Clement Chauplannaz 2013-05-12 21:08:51 +0200 6)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 7) # If no prefix forced, use the default CONFIG_
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 8) CONFIG_="${CONFIG_-CONFIG_}"
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 9)
e461bc9f9ab10 (Jeremie Francois (on alpha) 2020-04-10 18:57:40 +0200 10) # We use an uncommon delimiter for sed substitutions
e461bc9f9ab10 (Jeremie Francois (on alpha) 2020-04-10 18:57:40 +0200 11) SED_DELIM=$(echo -en "\001")
e461bc9f9ab10 (Jeremie Francois (on alpha) 2020-04-10 18:57:40 +0200 12)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 13) usage() {
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 14) cat >&2 <<EOL
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 15) Manipulate options in a .config file from the command line.
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 16) Usage:
7387778510b7d (Clement Chauplannaz 2013-05-12 21:08:51 +0200 17) $myname options command ...
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 18) commands:
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 19) --enable|-e option Enable option
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 20) --disable|-d option Disable option
1f990cf94559e (Michal Marek 2009-05-25 16:43:27 +0200 21) --module|-m option Turn option into a module
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 22) --set-str option string
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 23) Set option to "string"
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 24) --set-val option value
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 25) Set option to value
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 26) --undefine|-u option Undefine option
1f990cf94559e (Michal Marek 2009-05-25 16:43:27 +0200 27) --state|-s option Print state of option (n,y,m,undef)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 28)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 29) --enable-after|-E beforeopt option
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 30) Enable option directly after other option
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 31) --disable-after|-D beforeopt option
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 32) Disable option directly after other option
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 33) --module-after|-M beforeopt option
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 34) Turn option into module directly after other option
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 35)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 36) commands can be repeated multiple times
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 37)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 38) options:
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 39) --file config-file .config file to change (default .config)
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 40) --keep-case|-k Keep next symbols' case (dont' upper-case it)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 41)
7387778510b7d (Clement Chauplannaz 2013-05-12 21:08:51 +0200 42) $myname doesn't check the validity of the .config file. This is done at next
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 43) make time.
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 44)
7387778510b7d (Clement Chauplannaz 2013-05-12 21:08:51 +0200 45) By default, $myname will upper-case the given symbol. Use --keep-case to keep
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 46) the case of all following symbols unchanged.
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 47)
7387778510b7d (Clement Chauplannaz 2013-05-12 21:08:51 +0200 48) $myname uses 'CONFIG_' as the default symbol prefix. Set the environment
7387778510b7d (Clement Chauplannaz 2013-05-12 21:08:51 +0200 49) variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 50) EOL
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 51) exit 1
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 52) }
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 53)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 54) checkarg() {
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 55) ARG="$1"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 56) if [ "$ARG" = "" ] ; then
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 57) usage
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 58) fi
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 59) case "$ARG" in
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 60) ${CONFIG_}*)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 61) ARG="${ARG/${CONFIG_}/}"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 62) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 63) esac
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 64) if [ "$MUNGE_CASE" = "yes" ] ; then
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 65) ARG="`echo $ARG | tr a-z A-Z`"
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 66) fi
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 67) }
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 68)
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 69) txt_append() {
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 70) local anchor="$1"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 71) local insert="$2"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 72) local infile="$3"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 73) local tmpfile="$infile.swp"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 74)
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 75) # sed append cmd: 'a\' + newline + text + newline
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 76) cmd="$(printf "a\\%b$insert" "\n")"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 77)
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 78) sed -e "/$anchor/$cmd" "$infile" >"$tmpfile"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 79) # replace original file with the edited one
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 80) mv "$tmpfile" "$infile"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 81) }
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 82)
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 83) txt_subst() {
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 84) local before="$1"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 85) local after="$2"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 86) local infile="$3"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 87) local tmpfile="$infile.swp"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 88)
e461bc9f9ab10 (Jeremie Francois (on alpha) 2020-04-10 18:57:40 +0200 89) sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 90) # replace original file with the edited one
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 91) mv "$tmpfile" "$infile"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 92) }
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 93)
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 94) txt_delete() {
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 95) local text="$1"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 96) local infile="$2"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 97) local tmpfile="$infile.swp"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 98)
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 99) sed -e "/$text/d" "$infile" >"$tmpfile"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 100) # replace original file with the edited one
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 101) mv "$tmpfile" "$infile"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 102) }
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 103)
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 104) set_var() {
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 105) local name=$1 new=$2 before=$3
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 106)
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 107) name_re="^($name=|# $name is not set)"
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 108) before_re="^($before=|# $before is not set)"
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 109) if test -n "$before" && grep -Eq "$before_re" "$FN"; then
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 110) txt_append "^$before=" "$new" "$FN"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 111) txt_append "^# $before is not set" "$new" "$FN"
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 112) elif grep -Eq "$name_re" "$FN"; then
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 113) txt_subst "^$name=.*" "$new" "$FN"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 114) txt_subst "^# $name is not set" "$new" "$FN"
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 115) else
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 116) echo "$new" >>"$FN"
566432224731c (Michal Marek 2009-06-14 22:48:07 +0200 117) fi
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 118) }
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 119)
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 120) undef_var() {
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 121) local name=$1
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 122)
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 123) txt_delete "^$name=" "$FN"
83e8b90e1d2cc (Clement Chauplannaz 2013-07-13 16:36:56 +0200 124) txt_delete "^# $name is not set" "$FN"
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 125) }
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 126)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 127) if [ "$1" = "--file" ]; then
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 128) FN="$2"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 129) if [ "$FN" = "" ] ; then
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 130) usage
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 131) fi
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 132) shift 2
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 133) else
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 134) FN=.config
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 135) fi
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 136)
2302e8730e5ca (Andi Kleen 2009-01-07 22:33:15 +0100 137) if [ "$1" = "" ] ; then
2302e8730e5ca (Andi Kleen 2009-01-07 22:33:15 +0100 138) usage
2302e8730e5ca (Andi Kleen 2009-01-07 22:33:15 +0100 139) fi
2302e8730e5ca (Andi Kleen 2009-01-07 22:33:15 +0100 140)
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 141) MUNGE_CASE=yes
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 142) while [ "$1" != "" ] ; do
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 143) CMD="$1"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 144) shift
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 145) case "$CMD" in
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 146) --keep-case|-k)
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 147) MUNGE_CASE=no
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 148) continue
4edc7e32affd4 (Yann E. MORIN 2012-06-08 01:48:55 +0200 149) ;;
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 150) --refresh)
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 151) ;;
57a9c7609d741 (Clement Chauplannaz 2013-05-12 21:08:52 +0200 152) --*-after|-E|-D|-M)
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 153) checkarg "$1"
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 154) A=$ARG
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 155) checkarg "$2"
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 156) B=$ARG
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 157) shift 2
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 158) ;;
45f53cc90e8f0 (Andi Kleen 2010-11-05 12:06:05 +0100 159) -*)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 160) checkarg "$1"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 161) shift
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 162) ;;
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 163) esac
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 164) case "$CMD" in
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 165) --enable|-e)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 166) set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
47312d2cfd9b7 (Michal Marek 2009-05-25 16:43:25 +0200 167) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 168)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 169) --disable|-d)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 170) set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 171) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 172)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 173) --module|-m)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 174) set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 175) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 176)
1f990cf94559e (Michal Marek 2009-05-25 16:43:27 +0200 177) --set-str)
d6686da814c88 (Yann E. MORIN 2012-04-09 14:49:10 +0200 178) # sed swallows one level of escaping, so we need double-escaping
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 179) set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
1f990cf94559e (Michal Marek 2009-05-25 16:43:27 +0200 180) shift
1f990cf94559e (Michal Marek 2009-05-25 16:43:27 +0200 181) ;;
1f990cf94559e (Michal Marek 2009-05-25 16:43:27 +0200 182)
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 183) --set-val)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 184) set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 185) shift
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 186) ;;
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 187) --undefine|-u)
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 188) undef_var "${CONFIG_}$ARG"
d5bfb6b3814b2 (Yann E. MORIN 2012-06-08 01:48:57 +0200 189) ;;
f0a6332ce2216 (Jonas Aaberg 2010-12-15 08:37:00 +0100 190)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 191) --state|-s)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 192) if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 193) echo n
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 194) else
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 195) V="$(grep "^${CONFIG_}$ARG=" $FN)"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 196) if [ $? != 0 ] ; then
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 197) echo undef
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 198) else
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 199) V="${V/#${CONFIG_}$ARG=/}"
d6686da814c88 (Yann E. MORIN 2012-04-09 14:49:10 +0200 200) V="${V/#\"/}"
d6686da814c88 (Yann E. MORIN 2012-04-09 14:49:10 +0200 201) V="${V/%\"/}"
1925a276afa78 (Yann E. MORIN 2012-07-15 22:37:35 +0200 202) V="${V//\\\"/\"}"
d6686da814c88 (Yann E. MORIN 2012-04-09 14:49:10 +0200 203) echo "${V}"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 204) fi
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 205) fi
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 206) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 207)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 208) --enable-after|-E)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 209) set_var "${CONFIG_}$B" "${CONFIG_}$B=y" "${CONFIG_}$A"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 210) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 211)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 212) --disable-after|-D)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 213) set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 214) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 215)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 216) --module-after|-M)
f5ef2f7bf2e38 (Yann E. MORIN 2012-06-08 01:48:56 +0200 217) set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 218) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 219)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 220) # undocumented because it ignores --file (fixme)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 221) --refresh)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 222) yes "" | make oldconfig
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 223) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 224)
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 225) *)
d39648eb67ac8 (Randy Dunlap 2020-12-19 09:08:05 -0800 226) echo "bad command: $CMD" >&2
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 227) usage
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 228) ;;
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 229) esac
8e54701ea85b0 (Andi Kleen 2009-01-03 03:21:41 +0100 230) done