Jump to content

[Armbian build PR] - cli: `rewrite-<uboot,kernel>-patches`: rewrite only patches needing a rebase


RSS Bot

Recommended Posts

Description

This is a follow-up on this PR https://github.com/armbian/build/pull/6376 and this comment https://github.com/armbian/build/pull/6376#issuecomment-1987147291 It's more of an idea, since I tried rewrite-uboot-patches and noticed the following:

Board NanoPi-R6S has 5 U-Boot patches in total (legacy/u-boot-raxda-rk3588). Using ./compile.sh BOARD=nanopi-r6s BRANCH=edge rewrite-uboot-patches has the following patch summary: Summary: u-boot patching: 5 total patches; 5 applied; 2 with problems; 2 needs_rebase However, instead of only rewriting/rebasing the 2 patches, it modifies all 5 patches slightly (see example below). This means your git working tree quickly gets cluttered with these modified-without-any-real-changes patch files. And you'll have to either figure out which patches were changed/rebased if you only want to commit those, or commit all and make it harder to see the actual changes (I think?).

Example of a patch file getting modified even if the patch stays the same: (Notice the lines/hunks did not get changed, only the metadata)

git diff patch/u-boot/legacy/u-boot-radxa-rk3588/0001-Add-defconfig-and-dtb-of-nanopi6.patch | cat

diff --git a/patch/u-boot/legacy/u-boot-radxa-rk3588/0001-Add-defconfig-and-dtb-of-nanopi6.patch b/patch/u-boot/legacy/u-boot-radxa-rk3588/0001-Add-defconfig-and-dtb-of-nanopi6.patch
index 38f1a5a..b8e16cd 100644
--- a/patch/u-boot/legacy/u-boot-radxa-rk3588/0001-Add-defconfig-and-dtb-of-nanopi6.patch
+++ b/patch/u-boot/legacy/u-boot-radxa-rk3588/0001-Add-defconfig-and-dtb-of-nanopi6.patch
@@ -1,18 +1,16 @@
-From 70d65e65db965295ddd23d5db752aad1c035c205 Mon Sep 17 00:00:00 2001
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Muhammed=20Efe=20=C3=87etin?= <efectn@protonmail.com>
 Date: Sat, 15 Apr 2023 23:12:17 +0300
-Subject: [PATCH] Add defconfig and dtb of nanopi6
+Subject: Add defconfig and dtb of nanopi6
 
 ---
- arch/arm/dts/rk3588s-nanopi-r6s.dts  | 126 ++++++++++++++++
- configs/nanopi-r6s-rk3588s_defconfig | 217 +++++++++++++++++++++++++++
+ arch/arm/dts/rk3588s-nanopi-r6s.dts  | 126 ++++++
+ configs/nanopi-r6s-rk3588s_defconfig | 217 ++++++++++
  2 files changed, 343 insertions(+)
- create mode 100644 arch/arm/dts/rk3588s-nanopi-r6s.dts
- create mode 100644 configs/nanopi-r6s-rk3588s_defconfig
 
 diff --git a/arch/arm/dts/rk3588s-nanopi-r6s.dts b/arch/arm/dts/rk3588s-nanopi-r6s.dts
 new file mode 100644
-index 0000000000..4899e23fa3
+index 000000000000..4899e23fa3aa
 --- /dev/null
 +++ b/arch/arm/dts/rk3588s-nanopi-r6s.dts
 @@ -0,0 +1,126 @@
@@ -144,7 +142,7 @@ index 0000000000..4899e23fa3
 +};
 diff --git a/configs/nanopi-r6s-rk3588s_defconfig b/configs/nanopi-r6s-rk3588s_defconfig
 new file mode 100644
-index 0000000000..19bae55629
+index 000000000000..19bae5562928
 --- /dev/null
 +++ b/configs/nanopi-r6s-rk3588s_defconfig
 @@ -0,0 +1,217 @@
@@ -366,5 +364,5 @@ index 0000000000..19bae55629
 +CONFIG_OPTEE_V2=y
 +CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION=y
 -- 
-2.39.2
+Armbian

How I tried to solve this

The information if a patch needs rebasing is already there, so I tried to solve this by introducing a new option REWRITE_PATCHES_NEEDING_REBASE in addition to the existing REWRITE_PATCHES. Why an additional option?

  1. I didn't want to break anything (took me some hours already to figure out where the actual patch rewriting happes and to understand their logic, so I'm not confident to change what REWRITE_PATCHES does on its own ๐Ÿ˜…)
  2. Maybe there will be some reason when you want to actually rewrite all patches even if they don't need rebasing?

If it's not an issue, I could also just remove the additional option REWRITE_PATCHES_NEEDING_REBASE and instead make this the default behaviour for REWRITE_PATCHES.

How Has This Been Tested?

  • [x] Run the same command as earlier: ./compile.sh BOARD=nanopi-r6s BRANCH=edge rewrite-uboot-patches and only the 2 patches that needed rebasing were modified
  • [x] Compiled a board image to check if nothing got broken: ./compile.sh build BOARD=nanopi-r5c BRANCH=edge BUILD_DESKTOP=no BUILD_MINIMAL=no KERNEL_CONFIGURE=no RELEASE=bookworm

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings

View the full article

Link to comment
Share on other sites

ร—
ร—
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines