mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
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
This commit is contained in:
29
common.sh
29
common.sh
@@ -32,6 +32,9 @@ 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 <Enter> 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
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user