Jump to content

Attempting to use patch file to change u-boot configuration during build


ctag

Recommended Posts

Hi,

 

I'm trying to compile Armbian with TOC0 support for my opi-zero2, but am having difficulty getting the configuration setting to take effect.

 

Opening the compiled disk image in a hex editor shows me what I believe is evidence the current u-boot does not have the toc0 flag set:

image.thumb.png.64181d719b379b207e8d551437a7f0dd.png

 

I started by creating a patch file in userpatches: userpatches/u-boot/v2023.10/board_orangepizero2/orangepizero2_toc0.patch

diff --git a/configs/orangepi_zero2_defconfig b/configs/orangepi_zero2_defconfig
index f13735e91c..31f3c475e4 100644
--- a/configs/orangepi_zero2_defconfig
+++ b/configs/orangepi_zero2_defconfig
@@ -23,3 +23,4 @@ CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SPL_IMAGE_TYPE_SUNXI_TOC0=y

 

But this did not appear to have an effect on the built image.

 

Next I tried copying the red power LED patch over to userpatches and modifying it:

$ cp patch/u-boot/u-boot-sunxi/board_orangepizero2/orangepizero2_light_red_led_on.patch userpatches/u-boot/u-boot-sunxi/board_orangepizero2/orangepizero2_light_red_led_on.patch
$ cat userpatches/u-boot/u-boot-sunxi/board_orangepizero2/orangepizero2_light_red_led_on.patch
...
diff --git a/configs/orangepi_zero2_defconfig b/configs/orangepi_zero2_defconfig
index f13735e91c7..c88cd095205 100644
--- a/configs/orangepi_zero2_defconfig
+++ b/configs/orangepi_zero2_defconfig
@@ -23,3 +23,4 @@ CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_PWRLED="PC12"
+CONFIG_SPL_IMAGE_TYPE_SUNXI_TOC0=y
-- 
2.34.1

 

But this also hasn't had any effect. I would appreciate any pointers as to what I'm misunderstanding about the build system!

Edited by ctag
Link to comment
Share on other sites

When you run compile.sh you can observe in a table "summary of kernel patches" which patches are going to apply. User patches are in the bottom of the table.

Maybe you've chosen a wrong directory to put your custom patch...

Also you can set userpatch folder manually.

See in https://docs.armbian.com/Developer-Guide_Build-Options/ USERPATCHES_PATH option

 

Edited by Roman555
Link to comment
Share on other sites

@ctag Unless you have tried to override the BOOTPATCHDIR environment variable, your second patch path i.e. userpatches/u-boot/u-boot-sunxi/board_orangepizero2/orangepizero2_light_red_led_on.patch is correct. If you had passed BOOTPATCHDIR=v2023.10 on the commandline, first path would have worked as well, but it would have ignored all the patches that are currently applied by Armbian as we are using BOOTPATCHDIR as u-boot-sunxi.

 

I tried both of your patches in my checkout, and both of them failed to apply. See the output here - https://paste.armbian.com/uwapayuqiw.bash. In the shared output you would see its considering the file that I added based on your second patch and failing to apply the same.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines