summaryrefslogtreecommitdiff
path: root/sys-boot/linux/files/config_prepare.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-04-30 12:47:30 +0200
committerKarel Kočí <cynerd@email.cz>2017-04-30 12:47:30 +0200
commita2cfee41a7a3aefacce5db6f13e52e5540d51779 (patch)
treefb402c36c3cc07dff1ecb7a57e564510936d76c7 /sys-boot/linux/files/config_prepare.sh
parent09a210722e2d03129aed732ef11ed5a7f490b50d (diff)
downloadgentoo-personal-overlay-a2cfee41a7a3aefacce5db6f13e52e5540d51779.tar.gz
gentoo-personal-overlay-a2cfee41a7a3aefacce5db6f13e52e5540d51779.tar.bz2
gentoo-personal-overlay-a2cfee41a7a3aefacce5db6f13e52e5540d51779.zip
Base linux on arch configuration
Diffstat (limited to 'sys-boot/linux/files/config_prepare.sh')
-rwxr-xr-xsys-boot/linux/files/config_prepare.sh82
1 files changed, 37 insertions, 45 deletions
diff --git a/sys-boot/linux/files/config_prepare.sh b/sys-boot/linux/files/config_prepare.sh
index 729e53c..0d3409f 100755
--- a/sys-boot/linux/files/config_prepare.sh
+++ b/sys-boot/linux/files/config_prepare.sh
@@ -1,52 +1,44 @@
#!/bin/sh
set -e
-CNF="$(dirname $0)/configs"
+B="$(dirname $0)"
-CONFS="base gentoo"
+# First just deploy arch linux configuration (ah yes I stole it)
+cp "$B"/arch.config .config
-while [ $# -gt 0 ]; do
- case "$1" in
- --help|-h)
- echo "Usage: $0 [OPTION]... CONFIG..."
- echo "Combine configurations and esure that we have corrent ones."
- exit
- ;;
- --repeat|-r)
- shift
- REPEAT="$1"
- ;;
- -*)
- echo "Warning: ignoring uknown option: $1" >&2
- ;;
- *)
- if [ -f "$CNF/$1" ]; then
- CONFS="$CONFS $1"
- else
- echo "Warning: ignoring requested missing configuration: $1" >&2
- fi
- ;;
- esac
- shift
-done
+# And now apply changes from overlay.config
+while read L; do
+ echo "$L" | grep -qE "^[[:space:]]*$" && continue # ignore empty lines
+ echo "$L" | grep -qE "#.*" && continue # Ignore comments
+ # Remove lines with changed settings
+ OPTION="$(echo "$L" | grep -oE '^CONFIG_.*=')"
+ sed -i "#^$OPTION#d" .config
+ # Put config
+ echo "$L" >> .config
+done < "$B/overlay.config"
-if [ -z "$ARCH" ]; then
- CONFS="$CONFS $(uname -m)"
-elif [ "$ARCH" = "x86_64" ]; then
- CONFS="$CONFS x86_64"
-fi
+# As next step run olddefconfig (note: stderr contains some output about overrided
+# options so I am ignoring it)
+make olddefconfig 2>/dev/null
-for C in $CONFS; do
- while read L; do
- echo "$L" | grep -qE "^[[:space:]]*$" && continue # ignore empty lines
- echo "$L" | grep -qE "#.*" && continue # Ignore comments
- # Remove lines with changed settings
- OPTION="$(echo "$L" | grep -oE '^CONFIG_.*=')"
- sed -i "#^$OPTION#d" .config
- # Put config
- echo "$L" >> .config
- done < "$CNF/$C"
-done
-# Append small version
-#sed -i "#^CONFIG_LOCALVERSION=#g" .config
-#echo "CONFIG_LOCALVERSION=\".$VERSION\"" >> .config
+# Now let's check that configuration
+EC=0
+while read L; do
+ echo "$L" | grep -qE "^[[:space:]]*$" && continue # ignore empty lines
+ echo "$L" | grep -qE "#.*" && continue # Ignore comments
+ OPTION="$(echo "$L" | grep -oE '^CONFIG_.*=')"
+ VALUE="$(echo "$L" | grep -oE '=.*$')"
+ if [ "$VALUE" = "=n" ]; then
+ if grep -qE "^$OPTION=y" .config; then
+ EC=1
+ echo -e "\e[1;31mY:\e[0m$L"
+ fi
+ else
+ if ! grep -qE "^$L$" .config; then
+ EC=1
+ echo -e "\e[1;31mN:\e[0m$L"
+ fi
+ fi
+done < "$B/overlay.config"
+
+exit $EC