Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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

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

@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.

 

 

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.