diff options
Diffstat (limited to 'remote/modules/kernel/kernel.build')
-rw-r--r-- | remote/modules/kernel/kernel.build | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/remote/modules/kernel/kernel.build b/remote/modules/kernel/kernel.build index 0248a980..aaba6c01 100644 --- a/remote/modules/kernel/kernel.build +++ b/remote/modules/kernel/kernel.build @@ -29,7 +29,7 @@ build() { # make kernel with the new config cd ksrc || perror "Could not cd to ksrc, was the kernel source fetched properly?" pinfo "Preparing kernel for new config ('make oldconfig')" - yes n | make oldconfig || perror "make oldconfig failed" + yes "" | make oldconfig || perror "make oldconfig failed" pinfo "Compiling kernel... (this will take some time)" make || perror "make failed" @@ -63,18 +63,19 @@ update_config() { cp "$BASE_CONFIG_FILE" "$TARGET_CONFIG_FILE" for WANTED_CONFIG in $(cat $OPENSLX_WANTED_CONFIG|sort -u); do - local CONFIG_PARAM_NAME=$(echo $WANTED_CONFIG | awk -F "=" '{print $1}') - local SEARCH_RESULT=$(grep "^$CONFIG_PARAM_NAME=" "$BASE_CONFIG_FILE") + local CONFIG_PARAM_NAME="$(echo $WANTED_CONFIG | awk -F "=" '{print $1}')" + local SEARCH_RESULT="$(grep -E "^\s*$(echo "$CONFIG_PARAM_NAME" | escape_search)=" "$BASE_CONFIG_FILE")" #echo "Process: $SEARCH_RESULT" # analyse results if [ "x$SEARCH_RESULT" == "x" ]; then # no match, add it - echo $WANTED_CONFIG >> $TARGET_CONFIG_FILE + sed -i -r "s/^\s*#.*\s$(echo "$CONFIG_PARAM_NAME" | escape_search)[^_A-Z0-9].*$//" "$TARGET_CONFIG_FILE" + echo "$WANTED_CONFIG" >> "$TARGET_CONFIG_FILE" else # match, change to our setting if they differ - if [ "x${SEARCH_RESULT: -1}" != "x${WANTED_CONFIG: -1}" ]; then - sed -i "s/$SEARCH_RESULT/$WANTED_CONFIG/" "$TARGET_CONFIG_FILE" + if [ "x$SEARCH_RESULT" != "x$WANTED_CONFIG" ]; then + sed -i "s/$(echo "$SEARCH_RESULT" | escape_search)/$(echo "$WANTED_CONFIG" | escape_replace)/" "$TARGET_CONFIG_FILE" fi fi done |