summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2018-06-24 17:51:48 -0400
committerDavid P <megver83@parabola.nu>2018-06-24 17:51:48 -0400
commitbcf442d8254a2cbed95a7dc479545b76946172f3 (patch)
tree5ffad346c6a261afff4cf8a3de6c5ab1ab5acc6d
parentb0bb09005622d1917deb37a08fa6768c0501ecc2 (diff)
add reset option
I made this because Arch uses different variables than us for CONFIG_LOCALVERSION and others Signed-off-by: David P <megver83@parabola.nu>
-rwxr-xr-xrun.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/run.sh b/run.sh
index b4ecfe9..20cf728 100755
--- a/run.sh
+++ b/run.sh
@@ -21,10 +21,6 @@ version=$1
args=${@#$1}
path=${0%/*}
-if ! [[ $RESET = "" ]]; then
- reset="-e 's|^CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=""|;s|^CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME="\(none\)"|'"
-fi
-
usage() {
cat <<EOM
Usage: ${0##*/} [VERSION] [FILE1] [FILE2] ...
@@ -34,9 +30,13 @@ Example: ${0##*/} 4.14 /usr/src/linux-4.14/.config
To see a list of available versions, look at the files under the $path/versions
directory.
-If the \$RESET environment variable is set (to anything), then the
+If the \$RESET environment variable is set, then the sed expresion to reset
CONFIG_LOCALVERSION and CONFIG_DEFAULT_HOSTNAME variables of the specified
-config files will be set to the default values.
+config files will be printed and applied. Also CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN
+will be set to "linux-libre.fsfla.org" and CONFIG_LOCALVERSION will be set to
+what \$RESET was set.
+
+When RESET='none' then it is considered to have an empty CONFIG_LOCALVERSION.
EOM
}
@@ -68,7 +68,7 @@ deblob() {
for i in $configs; do
sed -i \
-e "s|$i=.*|# $i is not set|" \
- $reset \
+ "$reset" \
$1
sleep 0.2
done
@@ -119,5 +119,14 @@ main(){
if [[ $# -lt 1 ]]; then
usage
else
+ if ! [[ $RESET = "none" ]]; then
+ export reset="-e s|^CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\""$RESET"\"|;s|^CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME=\"\(none\)\"|;s|^CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN=.*|CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN=\"linux-libre.fsfla.org\"|"
+ echo "$reset"
+ elif [[ $RESET = "" ]]; then
+ unset reset
+ else
+ export reset="-e s|^CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"\"|;s|^CONFIG_DEFAULT_HOSTNAME=.*|CONFIG_DEFAULT_HOSTNAME=\"\(none\)\"|;s| ^CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN=.*|CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN=\"linux-libre.fsfla.org\"|"
+ echo "$reset"
+ fi
main $args
fi