From e32e1f55dd86b6e3374a5224a1ce52fca6d39b18 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 13 Jun 2016 21:02:39 +0200 Subject: [PATCH] Introducing new feature, defined as "DEBUG_MODE" for easier source debugging. You can create changes on the top of all our patches and patch, placed into sub dir userpatches, will be produced automatically --- common.sh | 31 ++++++++++++++++++++++++++++++- compile.sh | 3 ++- documentation/geek-faq.md | 3 +++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/common.sh b/common.sh index 920ba382c..c56d195d8 100644 --- a/common.sh +++ b/common.sh @@ -31,7 +31,10 @@ compile_uboot (){ # read uboot version to variable $VER grab_version "$SOURCES/$BOOTSOURCEDIR" "VER" - + + # create patch for manual source changes in debug mode + userpatch_create "u-boot" + display_alert "Compiling uboot" "$VER" "info" display_alert "Compiler version" "${UBOOT_COMPILER}gcc $(eval ${UBOOT_TOOLCHAIN:+env PATH=$UBOOT_TOOLCHAIN:$PATH} ${UBOOT_COMPILER}gcc -dumpversion)" "info" cd $SOURCES/$BOOTSOURCEDIR @@ -133,6 +136,9 @@ compile_kernel (){ # read kernel version to variable $VER grab_version "$SOURCES/$LINUXSOURCEDIR" "VER" + # create patch for manual source changes in debug mode + userpatch_create "kernel" + display_alert "Compiling $BRANCH kernel" "$VER" "info" display_alert "Compiler version" "${KERNEL_COMPILER}gcc $(eval ${KERNEL_TOOLCHAIN:+env PATH=$KERNEL_TOOLCHAIN:$PATH} ${KERNEL_COMPILER}gcc -dumpversion)" "info" cd $SOURCES/$LINUXSOURCEDIR/ @@ -384,3 +390,26 @@ customize_image() chroot $CACHEDIR/sdcard /bin/bash -c "/tmp/customize-image.sh $RELEASE $FAMILY $BOARD $BUILD_DESKTOP" umount $CACHEDIR/sdcard/tmp/overlay } + +userpatch_create() +{ + if [[ $DEBUG_MODE == yes ]]; then + # configure + mkdir -p $SRC/userpatches/patch + git config --global user.name 'John Doe' + git config --global user.email johndoe@somedomain.com + + # create commit to start from clean source + git add . + git commit -q -m "Cleaning" + + # prompt to alter source + display_alert "Make your changes in this directory:" "$(pwd)" "wrn" + display_alert "You will find a patch here:" "$SRC/userpatches/patch/$1-$LINUXFAMILY-$(date +'%d.%m.%Y').patch" "wrn" + read -p 'Press after you are done with changes to the source' + git add . + # create patch out of changes + git diff --staged > $SRC/userpatches/patch/$1-$LINUXFAMILY-$(date +'%d.%m.%Y').patch + git reset --soft HEAD~ + fi +} \ No newline at end of file diff --git a/compile.sh b/compile.sh index 366a437b2..d3f80d024 100755 --- a/compile.sh +++ b/compile.sh @@ -28,6 +28,7 @@ CONSOLE_CHAR="UTF-8" # advanced KERNEL_KEEP_CONFIG="no" # overwrite kernel config before compilation EXTERNAL="yes" # build and install extra applications and drivers +DEBUG_MODE="no" # wait that you make changes to uboot and kernel source and creates patches FORCE_CHECKOUT="yes" # ignore manual changes to source BUILD_ALL="no" # cycle through available boards and make images or kernel/u-boot packages. # set KERNEL_ONLY to "yes" or "no" to build all kernels/all images @@ -102,4 +103,4 @@ fi # If you are committing new version of this file, increment VERSION # Only integers are supported -# VERSION=18 +# VERSION=19 diff --git a/documentation/geek-faq.md b/documentation/geek-faq.md index 1bd00b5ad..1f4099201 100644 --- a/documentation/geek-faq.md +++ b/documentation/geek-faq.md @@ -50,6 +50,9 @@ Run the script - Mediatek MT7601U wireless - driver - Sunxi display control - hostapd from sources +- **DEBUG_MODE** (yes|no) + - set to "yes" will prompt you right before the compilation starts to make changes to the source code. Separate for u-boot and kernel. It will also create a patch out of this. If you want that this patch is included in the normal run, you need to copy it to appropriate directory + - set to "no" compilation will run uninterrupted - **FORCE_CHECKOUT** (yes|no): - set to "yes" to force overwrite any changed or manually patched kernel, u-boot and other sources - set to "no" to keep all changes to sources