[PATCH v2 6/7] buildscript: use diffconfig.sh to store .config

Tim Niemeyer tim.niemeyer at mastersword.de
So Dez 6 13:42:21 CET 2015


Signed-off-by: Tim Niemeyer <tim.niemeyer at mastersword.de>
---

Changes in v2:
- new patch

 buildscript | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/buildscript b/buildscript
index 1240f51..1b5f873 100755
--- a/buildscript
+++ b/buildscript
@@ -254,8 +254,6 @@ config() {
             ;;
     esac
 
-    cd "$opath"
-
     save=""
     until [ "$save" = "y" -o "$save" = "n" ]; do
         echo "Do you want to save the generated config? (y/n)"
@@ -265,15 +263,20 @@ config() {
     if [ "$save" = "y" ]; then
         case "$1" in
             "openwrt")
-                grep '^CON\|^# CON' "$target"/.config | sort > ./bsp/"$machine"/.config
+                echo "# Generated using \"./buildscript config openwrt\"." > "$opath"/bsp/"$machine"/.config
+                echo "# Do no edit manualy" >> "$opath"/bsp/"$machine"/.config
+                echo "#" >> "$opath"/bsp/"$machine"/.config
+                ./scripts/diffconfig.sh | grep -v '^#' >> "$opath"/bsp/"$machine"/.config
                 ;;
             "kernel")
-                arch=$(awk -F= '/^CONFIG_TARGET_BOARD/{gsub(/"/,"",$2); print $2;}' ./bsp/"$machine"/.config)
-                version=$(awk '/^CONFIG_LINUX/ { sub(/CONFIG_LINUX_/,""); sub(/=y/,""); gsub(/_/,"."); print; }' ./bsp/"$machine"/.config)
-                grep '^CON\|^# CON' "$target"/target/linux/"$arch"/config-"$version" | sort > ./bsp/"$machine"/.kernelconfig-"$version"
+                arch=$(awk -F= '/^CONFIG_TARGET_BOARD/{gsub(/"/,"",$2); print $2;}' "$opath"/bsp/"$machine"/.config)
+                version=$(awk '/^CONFIG_LINUX/ { sub(/CONFIG_LINUX_/,""); sub(/=y/,""); gsub(/_/,"."); print; }' "$opath"/bsp/"$machine"/.config)
+                grep '^CON\|^# CON' target/linux/"$arch"/config-"$version" | sort > "$opath"/bsp/"$machine"/.kernelconfig-"$version"
                 ;;
         esac
     fi
+
+    cd "$opath"
 }
 
 postbuild() {
-- 
2.1.4




Mehr Informationen über die Mailingliste franken-dev