From aff26601891d33146a19a900129f7d455269fc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 17 Nov 2017 19:15:00 +0100 Subject: Add virt use for linux --- sys-kernel/linux/files/config_prepare.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'sys-kernel/linux/files/config_prepare.sh') diff --git a/sys-kernel/linux/files/config_prepare.sh b/sys-kernel/linux/files/config_prepare.sh index 0d3409f..f4ae6d4 100755 --- a/sys-kernel/linux/files/config_prepare.sh +++ b/sys-kernel/linux/files/config_prepare.sh @@ -3,8 +3,24 @@ set -e B="$(dirname $0)" -# First just deploy arch linux configuration (ah yes I stole it) -cp "$B"/arch.config .config +BASE=arch.config +OVERLAY=overlay.config + +if [ "$1" = "virt" ]; then + BASE= + OVERLAY=virt.config +fi +################################################################################# + +# First just deploy base configuration (provided or just kernel default) +if [ -n "$BASE" ]; then + cp "$B/$BASE" .config +else + make defconfig +fi + +# We are done if no overlay is specified +[ -n "$OVERLAY" ] || exit 0 # And now apply changes from overlay.config while read L; do @@ -15,7 +31,7 @@ while read L; do sed -i "#^$OPTION#d" .config # Put config echo "$L" >> .config -done < "$B/overlay.config" +done < "$B/$OVERLAY" # As next step run olddefconfig (note: stderr contains some output about overrided # options so I am ignoring it) @@ -39,6 +55,6 @@ while read L; do echo -e "\e[1;31mN:\e[0m$L" fi fi -done < "$B/overlay.config" +done < "$B/$OVERLAY" exit $EC -- cgit v1.2.3