Skip to contentSkip to conversation

board/orangepi/orangepi-zero:extlinux, refactoring

PATCH In review Sergey Kuzminov 2 participants 4 messages Jan 18, 2022 – Jan 19, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 board/orangepi/orangepi-zero:extlinux, refactoring

Changes:
- common scenarios for multiple boards to create the SD image: board/orangepi/common;
- extlinux.conf instead of boot.scr;
- exclude FAT partition;
- defconfig refactoring;
- kernel: bump to version 5.16.1;
- u-boot: bump to version 2022.01;
- added BR2_ARM_FPU_NEON_VFPV4;
- added fast_commit for ext4.

Patch required to work:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

---
 board/orangepi/common/extlinux.conf       |  5 ++
 board/orangepi/common/genimage.cfg        | 20 +++++++
 board/orangepi/common/post-build.sh       | 34 +++++++++++
 board/orangepi/common/uboot-extras.config |  3 +
 board/orangepi/orangepi-zero/boot.cmd     |  9 ---
 board/orangepi/orangepi-zero/genimage.cfg | 36 ------------
 configs/orangepi_zero_defconfig           | 69 ++++++++++++++---------
 7 files changed, 104 insertions(+), 72 deletions(-)
 create mode 100644 board/orangepi/common/extlinux.conf
 create mode 100644 board/orangepi/common/genimage.cfg
 create mode 100755 board/orangepi/common/post-build.sh
 create mode 100644 board/orangepi/common/uboot-extras.config
 delete mode 100644 board/orangepi/orangepi-zero/boot.cmd
 delete mode 100644 board/orangepi/orangepi-zero/genimage.cfg
board/orangepi/common/extlinux.conf new file +5 -0
new file mode 100644
index 0000000000..015f29270e
@@ -0,0 +1,5 @@
+LABEL default
+  kernel /boot/%LINUXIMAGE%
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait console=${console}
+# append root=PARTUUID=%PARTUUID% rootwait console=${console} rootfstype=ext4 quiet panic=10
board/orangepi/common/genimage.cfg new file +20 -0
new file mode 100644
index 0000000000..8b80ffb138
@@ -0,0 +1,20 @@
+image sdcard.img {
+	hdimage {
+		partition-table-type = gpt
+		gpt-no-backup = true
+		gpt-location = 1008K # 1MB - 16KB
+	}
+
+	partition u-boot {
+		in-partition-table = false
+		image = "u-boot-sunxi-with-spl.bin"
+		offset = 8K
+		size = 1000K # 1MB - 8KB - 16KB
+	}
+
+	partition rootfs {
+		offset = 1M
+		image = "rootfs.ext4"
+		partition-uuid = %PARTUUID%
+	}
+}
board/orangepi/common/post-build.sh new file +34 -0
new file mode 100755
index 0000000000..296f94b174
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+linux_image()
+{
+	if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+		echo "uImage"
+	elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+		echo "Image"
+	elif grep -Eq "^BR2_LINUX_KERNEL_IMAGEGZ=y$" ${BR2_CONFIG}; then
+		echo "Image.gz"
+	else
+		echo "zImage"
+	fi
+}
+
+generic_getty()
+{
+	if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG}; then
+		echo ""
+	else
+		echo "s/\s*console=\S*//"
+	fi
+}
+
+PARTUUID="$($HOST_DIR/bin/uuidgen)"
+
+install -d "$TARGET_DIR/boot/extlinux/"
+
+sed -e "$(generic_getty)" \
+	-e "s/%LINUXIMAGE%/$(linux_image)/g" \
+	-e "s/%PARTUUID%/$PARTUUID/g" \
+	"board/orangepi/common/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
+
+sed "s/%PARTUUID%/$PARTUUID/g" "board/orangepi/common/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
board/orangepi/common/uboot-extras.config new file +3 -0
new file mode 100644
index 0000000000..5aa97523d9
@@ -0,0 +1,3 @@
+CONFIG_BOOTDELAY=0
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv preboot;"
board/orangepi/orangepi-zero/boot.cmd deleted +0 -9
deleted file mode 100644
index d094a64fe5..0000000000
@@ -1,9 +0,0 @@
-setenv fdt_high ffffffff
-
-part uuid mmc 0:2 uuid
-setenv bootargs console=ttyS0,115200 root=PARTUUID=${uuid} rootwait
-
-fatload mmc 0 $kernel_addr_r zImage
-fatload mmc 0 $fdt_addr_r sun8i-h2-plus-orangepi-zero.dtb
-
-bootz $kernel_addr_r - $fdt_addr_r
board/orangepi/orangepi-zero/genimage.cfg deleted +0 -36
deleted file mode 100644
index 32f5454ae6..0000000000
@@ -1,36 +0,0 @@
-# Minimal SD card image for the OrangePi Zero
-#
-image boot.vfat {
-	vfat {
-		files = {
-			"zImage",
-			"sun8i-h2-plus-orangepi-zero.dtb",
-			"boot.scr"
-		}
-	}
-	size = 10M
-}
-
-image sdcard.img {
-	hdimage {
-	}
-
-	partition u-boot {
-		in-partition-table = "no"
-		image = "u-boot-sunxi-with-spl.bin"
-		offset = 8K
-		size = 1016K # 1MB - 8KB
-	}
-
-	partition boot {
-		partition-type = 0xC
-		bootable = "true"
-		image = "boot.vfat"
-	}
-
-	partition rootfs {
-		partition-type = 0x83
-		image = "rootfs.ext4"
-		size = 512M
-	}
-}
configs/orangepi_zero_defconfig +42 -27

96 lines not on this page · raw message

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Sergey,

patch subject doesn’t say what you’re doing. How about:
orangepi/orangepi-zero: bump Linux and U-Boot versions

And in commit log below try to keep it more consistent. Like every change form sounds the same:
- create common scenario…
- use extlinux.conf instead of boot.scr
Etc.

Quoted 12 lines

Il giorno 18 gen 2022, alle ore 22:59, Sergey Kuzminov <[email protected]> ha scritto:

Changes:
- common scenario for multiple boards to create the SD image: board/orangepi/common;
- extlinux.conf instead of boot.scr;
- exclude FAT partition;
- defconfig refactoring;
- kernel: bump to version 5.16.1;
- u-boot: bump to version 2022.01;
- added BR2_ARM_FPU_NEON_VFPV4;
- added fast_commit for ext4.

Quoted 4 lines

Patch required to work:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

—-
Here you need to add:
V1->V2:
* changed this
* changed that
So in V3 you also need to add:
V2->V3:
* changed those
* etc.

Quoted 167 lines

---

board/orangepi/common/extlinux.conf       |  5 ++
board/orangepi/common/genimage.cfg        | 20 +++++++
board/orangepi/common/post-build.sh       | 34 +++++++++++
board/orangepi/common/uboot-extras.config |  3 +
board/orangepi/orangepi-zero/boot.cmd     |  9 ---
board/orangepi/orangepi-zero/genimage.cfg | 36 ------------
configs/orangepi_zero_defconfig           | 69 ++++++++++++++---------
7 files changed, 104 insertions(+), 72 deletions(-)

create mode 100644 board/orangepi/common/extlinux.conf create mode 100644 board/orangepi/common/genimage.cfg create mode 100755 board/orangepi/common/post-build.sh create mode 100644 board/orangepi/common/uboot-extras.config delete mode 100644 board/orangepi/orangepi-zero/boot.cmd delete mode 100644 board/orangepi/orangepi-zero/genimage.cfg

board/orangepi/common/extlinux.conf new file +5 -0
new file mode 100644
index 0000000000..015f29270e
@@ -0,0 +1,5 @@
+LABEL default
+  kernel /boot/%LINUXIMAGE%
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait console=${console}
+# append root=PARTUUID=%PARTUUID% rootwait console=${console} rootfstype=ext4 quiet panic=10
board/orangepi/common/genimage.cfg new file +20 -0
new file mode 100644
index 0000000000..8b80ffb138
@@ -0,0 +1,20 @@
+image sdcard.img {
+    hdimage {
+        partition-table-type = gpt
+        gpt-no-backup = true
+        gpt-location = 1008K # 1MB - 16KB
+    }
+
+    partition u-boot {
+        in-partition-table = false
+        image = "u-boot-sunxi-with-spl.bin"
+        offset = 8K
+        size = 1000K # 1MB - 8KB - 16KB
+    }
+
+    partition rootfs {
+        offset = 1M
+        image = "rootfs.ext4"
+        partition-uuid = %PARTUUID%
+    }
+}
board/orangepi/common/post-build.sh new file +34 -0
new file mode 100755
index 0000000000..296f94b174
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+linux_image()
+{
+    if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+        echo "uImage"
+    elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+        echo "Image"
+    elif grep -Eq "^BR2_LINUX_KERNEL_IMAGEGZ=y$" ${BR2_CONFIG}; then
+        echo "Image.gz"
+    else
+        echo "zImage"
+    fi
+}
+
+generic_getty()
+{
+    if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG}; then
+        echo ""
+    else
+        echo "s/\s*console=\S*//"
+    fi
+}
+
+PARTUUID="$($HOST_DIR/bin/uuidgen)"
+
+install -d "$TARGET_DIR/boot/extlinux/"
+
+sed -e "$(generic_getty)" \
+    -e "s/%LINUXIMAGE%/$(linux_image)/g" \
+    -e "s/%PARTUUID%/$PARTUUID/g" \
+    "board/orangepi/common/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
+
+sed "s/%PARTUUID%/$PARTUUID/g" "board/orangepi/common/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
board/orangepi/common/uboot-extras.config new file +3 -0
new file mode 100644
index 0000000000..5aa97523d9
@@ -0,0 +1,3 @@
+CONFIG_BOOTDELAY=0
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv preboot;"
board/orangepi/orangepi-zero/boot.cmd deleted +0 -9
deleted file mode 100644
index d094a64fe5..0000000000
@@ -1,9 +0,0 @@
-setenv fdt_high ffffffff
-
-part uuid mmc 0:2 uuid
-setenv bootargs console=ttyS0,115200 root=PARTUUID=${uuid} rootwait
-
-fatload mmc 0 $kernel_addr_r zImage
-fatload mmc 0 $fdt_addr_r sun8i-h2-plus-orangepi-zero.dtb
-
-bootz $kernel_addr_r - $fdt_addr_r
board/orangepi/orangepi-zero/genimage.cfg deleted +0 -36
deleted file mode 100644
index 32f5454ae6..0000000000
@@ -1,36 +0,0 @@
-# Minimal SD card image for the OrangePi Zero
-#
-image boot.vfat {
-    vfat {
-        files = {
-            "zImage",
-            "sun8i-h2-plus-orangepi-zero.dtb",
-            "boot.scr"
-        }
-    }
-    size = 10M
-}
-
-image sdcard.img {
-    hdimage {
-    }
-
-    partition u-boot {
-        in-partition-table = "no"
-        image = "u-boot-sunxi-with-spl.bin"
-        offset = 8K
-        size = 1016K # 1MB - 8KB
-    }
-
-    partition boot {
-        partition-type = 0xC
-        bootable = "true"
-        image = "boot.vfat"
-    }
-
-    partition rootfs {
-        partition-type = 0x83
-        image = "rootfs.ext4"
-        size = 512M
-    }
-}
configs/orangepi_zero_defconfig +1 -0
index 1c107b10e6..d1cae2b4f3 100644
@@ -1,49 +1,64 @@
+# Architecture

BR2_arm=y
BR2_cortex_a7=y

configs/orangepi_zero_defconfig line 6

Quoted 4 lines
configs/orangepi_zero_defconfig +3 -1
-BR2_ARM_FPU_VFPV4=y
+BR2_ARM_EABIHF=y
+BR2_ARM_FPU_NEON_VFPV4=y
+#BR2_ARM_INSTRUCTIONS_THUMB2=y

Is there a specific reason for specifying here not thumb2? So ARM?

Quoted 34 lines
configs/orangepi_zero_defconfig +4 -0
+
+# System
+BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Zero"
+BR2_TARGET_GENERIC_HOSTNAME="OrangePi_Zero"

BR2_GLOBAL_PATCH_DIR="board/orangepi/orangepi-zero/patches" BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y

configs/orangepi_zero_defconfig +0 -3
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_12=y
-BR2_TARGET_GENERIC_HOSTNAME="OrangePi_Zero"
-BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Zero"

BR2_SYSTEM_DHCP="eth0"

configs/orangepi_zero_defconfig +2 -11
-BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.12.2"
-BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
-BR2_LINUX_KERNEL_DTS_SUPPORT=y
-BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero"
-BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero/linux-extras.config"
-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
-BR2_TARGET_ROOTFS_EXT2=y
-BR2_TARGET_ROOTFS_EXT2_4=y
-# BR2_TARGET_ROOTFS_TAR is not set
+
+# Bootloader

BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y

configs/orangepi_zero_defconfig +1 -1
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2021.04"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.01"

BR2_TARGET_UBOOT_BOARD_DEFCONFIG="orangepi_zero" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_PYTHON3=y BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"

configs/orangepi_zero_defconfig line 26

Quoted 8 lines
configs/orangepi_zero_defconfig +1 -7
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/orangepi/orangepi-zero/boot.cmd"
-BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
-BR2_PACKAGE_HOST_MTOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/orangepi/common/uboot-extras.config"

Here ^^^ I tend to use .fragment extension instead of .config

configs/orangepi_zero_defconfig line 33

Quoted 7 lines
configs/orangepi_zero_defconfig +7 -0
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero/linux-extras.config"

Ditto ^^^

configs/orangepi_zero_defconfig line 46

Quoted 13 lines
configs/orangepi_zero_defconfig +13 -0
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.16.1"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_16=y
+
+# Filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="63M"
+BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O ^64bit,fast_commit"
+BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW=y
+BR2_TARGET_ROOTFS_TAR=n

Here you should keep the form # BR2_TARGET_ROOTFS_TAR not set Instead of assigning =n

Best regards
—-
Giulio Benetti
Benetti Engineering sas

Quoted 27 lines
configs/orangepi_zero_defconfig +3 -0
+
+# Image
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/common/post-build.sh"

BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"

configs/orangepi_zero_defconfig +5 -2
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/orangepi/orangepi-zero/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_GENIMAGE=y
 
-# wireless driver and firmware
+# Wireless driver and firmware

BR2_PACKAGE_XR819_XRADIO=y
BR2_PACKAGE_ARMBIAN_FIRMWARE=y
BR2_PACKAGE_ARMBIAN_FIRMWARE_XR819=y

configs/orangepi_zero_defconfig +1 -1
-# wireless support
+# Wireless support

BR2_PACKAGE_IW=y
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WIRELESS_TOOLS_LIB=y

configs/orangepi_zero_defconfig +0 -0
@@ -51,5 +66,5 @@ BR2_PACKAGE_WPA_SUPPLICANT=y

BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y

configs/orangepi_zero_defconfig +1 -1
-# spi flash support
+# Spi flash support
Quoted 8 lines

BR2_PACKAGE_MTD=y

Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hi, Giulio.
Thanks for the comments, I'll try to do everything right in the evening. I would like to consult about BR2_ARM_INSTRUCTIONS_THUMB2.

I tested the build for Orange Zero (Allwinner H2+) using the built-in test in the 7-zip archiver and did not notice any performance differences between VFPV4, NEON_VFPV4, THUMB2. Most likely, another performance testing program is needed to unlock the potential of NEON.

But I was more interested in BR2_ARM_INSTRUCTIONS_THUMB2. As it turned out, in my build, all executable files have decreased in size. For example busybox 566Kb (THUMB2) vs. 766Kb (VFPV4/NEON_VFPV4). But I do not know if there are any disadvantages of THUMB 2. Therefore, I added BR2_ARM_INSTRUCTIONS_THUMB 2 to the configuration, but commented so that people could see that this mode is possible for this processor and would make a choice whether to use it.

Today I found a good article revealing the essence of what is happening: https://kmittal82.wordpress.com/2012/02/17/armthumbthumb-2/
What should I do? Leave as is, remove or enable BR2_ARM_INSTRUCTIONS_THUMB2.

19.01.2022 1:34, Giulio Benetti:

Quoted 314 lines

Hi Sergey,

patch subject doesn’t say what you’re doing. How about:
orangepi/orangepi-zero: bump Linux and U-Boot versions

And in commit log below try to keep it more consistent. Like every change form sounds the same:
- create common scenario…
- use extlinux.conf instead of boot.scr
Etc.

Quoted 12 lines

Il giorno 18 gen 2022, alle ore 22:59, Sergey Kuzminov <[email protected]> ha scritto:

Changes:
- common scenario for multiple boards to create the SD image: board/orangepi/common;
- extlinux.conf instead of boot.scr;
- exclude FAT partition;
- defconfig refactoring;
- kernel: bump to version 5.16.1;
- u-boot: bump to version 2022.01;
- added BR2_ARM_FPU_NEON_VFPV4;
- added fast_commit for ext4.

Quoted 4 lines

Patch required to work:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

—-
Here you need to add:
V1->V2:
* changed this
* changed that
So in V3 you also need to add:
V2->V3:
* changed those
* etc.

Quoted 167 lines

---

board/orangepi/common/extlinux.conf       |  5 ++
board/orangepi/common/genimage.cfg        | 20 +++++++
board/orangepi/common/post-build.sh       | 34 +++++++++++
board/orangepi/common/uboot-extras.config |  3 +
board/orangepi/orangepi-zero/boot.cmd     |  9 ---
board/orangepi/orangepi-zero/genimage.cfg | 36 ------------
configs/orangepi_zero_defconfig           | 69 ++++++++++++++---------
7 files changed, 104 insertions(+), 72 deletions(-)

create mode 100644 board/orangepi/common/extlinux.conf create mode 100644 board/orangepi/common/genimage.cfg create mode 100755 board/orangepi/common/post-build.sh create mode 100644 board/orangepi/common/uboot-extras.config delete mode 100644 board/orangepi/orangepi-zero/boot.cmd delete mode 100644 board/orangepi/orangepi-zero/genimage.cfg

board/orangepi/common/extlinux.conf new file +5 -0
new file mode 100644
index 0000000000..015f29270e
@@ -0,0 +1,5 @@
+LABEL default
+  kernel /boot/%LINUXIMAGE%
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait console=${console}
+# append root=PARTUUID=%PARTUUID% rootwait console=${console} rootfstype=ext4 quiet panic=10
board/orangepi/common/genimage.cfg new file +20 -0
new file mode 100644
index 0000000000..8b80ffb138
@@ -0,0 +1,20 @@
+image sdcard.img {
+    hdimage {
+        partition-table-type = gpt
+        gpt-no-backup = true
+        gpt-location = 1008K # 1MB - 16KB
+    }
+
+    partition u-boot {
+        in-partition-table = false
+        image = "u-boot-sunxi-with-spl.bin"
+        offset = 8K
+        size = 1000K # 1MB - 8KB - 16KB
+    }
+
+    partition rootfs {
+        offset = 1M
+        image = "rootfs.ext4"
+        partition-uuid = %PARTUUID%
+    }
+}
board/orangepi/common/post-build.sh new file +34 -0
new file mode 100755
index 0000000000..296f94b174
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+linux_image()
+{
+    if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+        echo "uImage"
+    elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+        echo "Image"
+    elif grep -Eq "^BR2_LINUX_KERNEL_IMAGEGZ=y$" ${BR2_CONFIG}; then
+        echo "Image.gz"
+    else
+        echo "zImage"
+    fi
+}
+
+generic_getty()
+{
+    if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG}; then
+        echo ""
+    else
+        echo "s/\s*console=\S*//"
+    fi
+}
+
+PARTUUID="$($HOST_DIR/bin/uuidgen)"
+
+install -d "$TARGET_DIR/boot/extlinux/"
+
+sed -e "$(generic_getty)" \
+    -e "s/%LINUXIMAGE%/$(linux_image)/g" \
+    -e "s/%PARTUUID%/$PARTUUID/g" \
+    "board/orangepi/common/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
+
+sed "s/%PARTUUID%/$PARTUUID/g" "board/orangepi/common/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
board/orangepi/common/uboot-extras.config new file +3 -0
new file mode 100644
index 0000000000..5aa97523d9
@@ -0,0 +1,3 @@
+CONFIG_BOOTDELAY=0
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv preboot;"
board/orangepi/orangepi-zero/boot.cmd deleted +0 -9
deleted file mode 100644
index d094a64fe5..0000000000
@@ -1,9 +0,0 @@
-setenv fdt_high ffffffff
-
-part uuid mmc 0:2 uuid
-setenv bootargs console=ttyS0,115200 root=PARTUUID=${uuid} rootwait
-
-fatload mmc 0 $kernel_addr_r zImage
-fatload mmc 0 $fdt_addr_r sun8i-h2-plus-orangepi-zero.dtb
-
-bootz $kernel_addr_r - $fdt_addr_r
board/orangepi/orangepi-zero/genimage.cfg deleted +0 -36
deleted file mode 100644
index 32f5454ae6..0000000000
@@ -1,36 +0,0 @@
-# Minimal SD card image for the OrangePi Zero
-#
-image boot.vfat {
-    vfat {
-        files = {
-            "zImage",
-            "sun8i-h2-plus-orangepi-zero.dtb",
-            "boot.scr"
-        }
-    }
-    size = 10M
-}
-
-image sdcard.img {
-    hdimage {
-    }
-
-    partition u-boot {
-        in-partition-table = "no"
-        image = "u-boot-sunxi-with-spl.bin"
-        offset = 8K
-        size = 1016K # 1MB - 8KB
-    }
-
-    partition boot {
-        partition-type = 0xC
-        bootable = "true"
-        image = "boot.vfat"
-    }
-
-    partition rootfs {
-        partition-type = 0x83
-        image = "rootfs.ext4"
-        size = 512M
-    }
-}
configs/orangepi_zero_defconfig +1 -0
index 1c107b10e6..d1cae2b4f3 100644
@@ -1,49 +1,64 @@
+# Architecture

BR2_arm=y
BR2_cortex_a7=y

configs/orangepi_zero_defconfig line 6

Quoted 4 lines
configs/orangepi_zero_defconfig +3 -1
-BR2_ARM_FPU_VFPV4=y
+BR2_ARM_EABIHF=y
+BR2_ARM_FPU_NEON_VFPV4=y
+#BR2_ARM_INSTRUCTIONS_THUMB2=y

Is there a specific reason for specifying here not thumb2? So ARM?

Quoted 34 lines
configs/orangepi_zero_defconfig +4 -0
+
+# System
+BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Zero"
+BR2_TARGET_GENERIC_HOSTNAME="OrangePi_Zero"

BR2_GLOBAL_PATCH_DIR="board/orangepi/orangepi-zero/patches" BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y

configs/orangepi_zero_defconfig +0 -3
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_12=y
-BR2_TARGET_GENERIC_HOSTNAME="OrangePi_Zero"
-BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Zero"

BR2_SYSTEM_DHCP="eth0"

configs/orangepi_zero_defconfig +2 -11
-BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.12.2"
-BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
-BR2_LINUX_KERNEL_DTS_SUPPORT=y
-BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero"
-BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero/linux-extras.config"
-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
-BR2_TARGET_ROOTFS_EXT2=y
-BR2_TARGET_ROOTFS_EXT2_4=y
-# BR2_TARGET_ROOTFS_TAR is not set
+
+# Bootloader

BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y

configs/orangepi_zero_defconfig +1 -1
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2021.04"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.01"

BR2_TARGET_UBOOT_BOARD_DEFCONFIG="orangepi_zero" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_PYTHON3=y BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"

configs/orangepi_zero_defconfig line 26

Quoted 8 lines
configs/orangepi_zero_defconfig +1 -7
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/orangepi/orangepi-zero/boot.cmd"
-BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
-BR2_PACKAGE_HOST_MTOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/orangepi/common/uboot-extras.config"

Here ^^^ I tend to use .fragment extension instead of .config

configs/orangepi_zero_defconfig line 33

Quoted 7 lines
configs/orangepi_zero_defconfig +7 -0
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero/linux-extras.config"

Ditto ^^^

configs/orangepi_zero_defconfig line 46

Quoted 13 lines
configs/orangepi_zero_defconfig +13 -0
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.16.1"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_16=y
+
+# Filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="63M"
+BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O ^64bit,fast_commit"
+BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW=y
+BR2_TARGET_ROOTFS_TAR=n

Here you should keep the form # BR2_TARGET_ROOTFS_TAR not set Instead of assigning =n

Best regards
—-
Giulio Benetti
Benetti Engineering sas

Quoted 31 lines
configs/orangepi_zero_defconfig +3 -0
+
+# Image
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/common/post-build.sh"

BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"

configs/orangepi_zero_defconfig +5 -2
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/orangepi/orangepi-zero/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_GENIMAGE=y
 
-# wireless driver and firmware
+# Wireless driver and firmware

BR2_PACKAGE_XR819_XRADIO=y
BR2_PACKAGE_ARMBIAN_FIRMWARE=y
BR2_PACKAGE_ARMBIAN_FIRMWARE_XR819=y

configs/orangepi_zero_defconfig +1 -1
-# wireless support
+# Wireless support

BR2_PACKAGE_IW=y
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WIRELESS_TOOLS_LIB=y

configs/orangepi_zero_defconfig +0 -0
@@ -51,5 +66,5 @@ BR2_PACKAGE_WPA_SUPPLICANT=y

BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y

configs/orangepi_zero_defconfig +1 -1
-# spi flash support
+# Spi flash support

BR2_PACKAGE_MTD=y

Signature · 1 line
2.34.1
Quoted 4 lines
Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hi Sergey,

adding Romain in Cc for Thumb2

Quoted 8 lines · Kuzminov Sergey

Hi, Giulio.
Thanks for the comments, I'll try to do everything right in the evening. I would like to consult about BR2_ARM_INSTRUCTIONS_THUMB2.

I tested the build for Orange Zero (Allwinner H2+) using the built-in test in the 7-zip archiver and did not notice any performance differences between VFPV4, NEON_VFPV4, THUMB2. Most likely, another performance testing program is needed to unlock the potential of NEON.

Yes, the mix of VFPV4 and NEON is rare, maybe you can appreciate it with libnss or other packages that use such optimization. Otherwise NEON doesn't get used. But anyway, if it's enabled, we have the chance for it to be used. It's there, so better use it :-)

Quoted 4 lines

But I was more interested in BR2_ARM_INSTRUCTIONS_THUMB2. As it turned out, in my build, all executable files have decreased in size. For example busybox 566Kb (THUMB2) vs. 766Kb (VFPV4/NEON_VFPV4). But I do not know if there are any disadvantages of THUMB 2.

THUMB2 yes, reduces size and it costs very few in term of performances(like 2% less), check here:
https://pagefault.blog/2017/05/03/why-and-how-to-enable-arm-thumb-2-instruction-set-in-yocto/

They also state that every piece of the system should then be compiled with THUMB2, including Linux.

About disadvantages, I only read sometimes that it can create some problem depending on toolchain. But here I leave the question to more experienced people than me. Maybe Romain can clarify this.

Quoted 4 lines

Therefore, I added
BR2_ARM_INSTRUCTIONS_THUMB 2 to the configuration, but commented so that people could see that this mode is possible for this processor and would make a choice whether to use it.

Yes, but this is not how we want defconfigs. The option is available issuing:

# make menuconfig
so one can anyway enable it and give a try. So please remove that commented line.
Quoted 2 lines

Today I found a good article revealing the essence of what is happening:
https://kmittal82.wordpress.com/2012/02/17/armthumbthumb-2/

Yes, this article is good too.

Quoted 1 line

What should I do? Leave as is, remove or enable BR2_ARM_INSTRUCTIONS_THUMB2.

It can't stay there commented for sure, so if commented you need to remove it. Otherwise, like every Microchip cortex-A5 board does, you can enable it by default. But for consistency with all the other Allwinner SoCs maybe it's better to keep it disabled. Otherwise we should give a try to every Allwinner board(many) with THUMB2. It can be done, but I would think about it later. I mean, Allwinner with ARM instructions is well tested, so I would go for that.

PS: please, next time answer in-line, don't top post :-) Thank you

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 315 lines

19.01.2022 1:34, Giulio Benetti:

Quoted 314 lines

Hi Sergey,

patch subject doesn’t say what you’re doing. How about:
orangepi/orangepi-zero: bump Linux and U-Boot versions

And in commit log below try to keep it more consistent. Like every change form sounds the same:
- create common scenario…
- use extlinux.conf instead of boot.scr
Etc.

Quoted 12 lines

Il giorno 18 gen 2022, alle ore 22:59, Sergey Kuzminov <[email protected]> ha scritto:

Changes:
- common scenario for multiple boards to create the SD image: board/orangepi/common;
- extlinux.conf instead of boot.scr;
- exclude FAT partition;
- defconfig refactoring;
- kernel: bump to version 5.16.1;
- u-boot: bump to version 2022.01;
- added BR2_ARM_FPU_NEON_VFPV4;
- added fast_commit for ext4.

Quoted 4 lines

Patch required to work:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/

—-
Here you need to add:
V1->V2:
* changed this
* changed that
So in V3 you also need to add:
V2->V3:
* changed those
* etc.

Quoted 167 lines

---

board/orangepi/common/extlinux.conf       |  5 ++
board/orangepi/common/genimage.cfg        | 20 +++++++
board/orangepi/common/post-build.sh       | 34 +++++++++++
board/orangepi/common/uboot-extras.config |  3 +
board/orangepi/orangepi-zero/boot.cmd     |  9 ---
board/orangepi/orangepi-zero/genimage.cfg | 36 ------------
configs/orangepi_zero_defconfig           | 69 ++++++++++++++---------
7 files changed, 104 insertions(+), 72 deletions(-)

create mode 100644 board/orangepi/common/extlinux.conf create mode 100644 board/orangepi/common/genimage.cfg create mode 100755 board/orangepi/common/post-build.sh create mode 100644 board/orangepi/common/uboot-extras.config delete mode 100644 board/orangepi/orangepi-zero/boot.cmd delete mode 100644 board/orangepi/orangepi-zero/genimage.cfg

board/orangepi/common/extlinux.conf new file +5 -0
new file mode 100644
index 0000000000..015f29270e
@@ -0,0 +1,5 @@
+LABEL default
+  kernel /boot/%LINUXIMAGE%
+  devicetreedir /boot
+  append root=PARTUUID=%PARTUUID% rootwait console=${console}
+# append root=PARTUUID=%PARTUUID% rootwait console=${console} rootfstype=ext4 quiet panic=10
board/orangepi/common/genimage.cfg new file +20 -0
new file mode 100644
index 0000000000..8b80ffb138
@@ -0,0 +1,20 @@
+image sdcard.img {
+    hdimage {
+        partition-table-type = gpt
+        gpt-no-backup = true
+        gpt-location = 1008K # 1MB - 16KB
+    }
+
+    partition u-boot {
+        in-partition-table = false
+        image = "u-boot-sunxi-with-spl.bin"
+        offset = 8K
+        size = 1000K # 1MB - 8KB - 16KB
+    }
+
+    partition rootfs {
+        offset = 1M
+        image = "rootfs.ext4"
+        partition-uuid = %PARTUUID%
+    }
+}
board/orangepi/common/post-build.sh new file +34 -0
new file mode 100755
index 0000000000..296f94b174
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+linux_image()
+{
+    if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+        echo "uImage"
+    elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+        echo "Image"
+    elif grep -Eq "^BR2_LINUX_KERNEL_IMAGEGZ=y$" ${BR2_CONFIG}; then
+        echo "Image.gz"
+    else
+        echo "zImage"
+    fi
+}
+
+generic_getty()
+{
+    if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG}; then
+        echo ""
+    else
+        echo "s/\s*console=\S*//"
+    fi
+}
+
+PARTUUID="$($HOST_DIR/bin/uuidgen)"
+
+install -d "$TARGET_DIR/boot/extlinux/"
+
+sed -e "$(generic_getty)" \
+    -e "s/%LINUXIMAGE%/$(linux_image)/g" \
+    -e "s/%PARTUUID%/$PARTUUID/g" \
+    "board/orangepi/common/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
+
+sed "s/%PARTUUID%/$PARTUUID/g" "board/orangepi/common/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
board/orangepi/common/uboot-extras.config new file +3 -0
new file mode 100644
index 0000000000..5aa97523d9
@@ -0,0 +1,3 @@
+CONFIG_BOOTDELAY=0
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv preboot;"
board/orangepi/orangepi-zero/boot.cmd deleted +0 -9
deleted file mode 100644
index d094a64fe5..0000000000
@@ -1,9 +0,0 @@
-setenv fdt_high ffffffff
-
-part uuid mmc 0:2 uuid
-setenv bootargs console=ttyS0,115200 root=PARTUUID=${uuid} rootwait
-
-fatload mmc 0 $kernel_addr_r zImage
-fatload mmc 0 $fdt_addr_r sun8i-h2-plus-orangepi-zero.dtb
-
-bootz $kernel_addr_r - $fdt_addr_r
board/orangepi/orangepi-zero/genimage.cfg deleted +0 -36
deleted file mode 100644
index 32f5454ae6..0000000000
@@ -1,36 +0,0 @@
-# Minimal SD card image for the OrangePi Zero
-#
-image boot.vfat {
-    vfat {
-        files = {
-            "zImage",
-            "sun8i-h2-plus-orangepi-zero.dtb",
-            "boot.scr"
-        }
-    }
-    size = 10M
-}
-
-image sdcard.img {
-    hdimage {
-    }
-
-    partition u-boot {
-        in-partition-table = "no"
-        image = "u-boot-sunxi-with-spl.bin"
-        offset = 8K
-        size = 1016K # 1MB - 8KB
-    }
-
-    partition boot {
-        partition-type = 0xC
-        bootable = "true"
-        image = "boot.vfat"
-    }
-
-    partition rootfs {
-        partition-type = 0x83
-        image = "rootfs.ext4"
-        size = 512M
-    }
-}
configs/orangepi_zero_defconfig +1 -0
index 1c107b10e6..d1cae2b4f3 100644
@@ -1,49 +1,64 @@
+# Architecture

BR2_arm=y
BR2_cortex_a7=y

configs/orangepi_zero_defconfig line 6

Quoted 4 lines
configs/orangepi_zero_defconfig +3 -1
-BR2_ARM_FPU_VFPV4=y
+BR2_ARM_EABIHF=y
+BR2_ARM_FPU_NEON_VFPV4=y
+#BR2_ARM_INSTRUCTIONS_THUMB2=y

Is there a specific reason for specifying here not thumb2? So ARM?

Quoted 34 lines
configs/orangepi_zero_defconfig +4 -0
+
+# System
+BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Zero"
+BR2_TARGET_GENERIC_HOSTNAME="OrangePi_Zero"

BR2_GLOBAL_PATCH_DIR="board/orangepi/orangepi-zero/patches" BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y

configs/orangepi_zero_defconfig +0 -3
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_12=y
-BR2_TARGET_GENERIC_HOSTNAME="OrangePi_Zero"
-BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Orange Pi Zero"

BR2_SYSTEM_DHCP="eth0"

configs/orangepi_zero_defconfig +2 -11
-BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.12.2"
-BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
-BR2_LINUX_KERNEL_DTS_SUPPORT=y
-BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero"
-BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero/linux-extras.config"
-BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
-BR2_TARGET_ROOTFS_EXT2=y
-BR2_TARGET_ROOTFS_EXT2_4=y
-# BR2_TARGET_ROOTFS_TAR is not set
+
+# Bootloader

BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y

configs/orangepi_zero_defconfig +1 -1
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2021.04"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.01"

BR2_TARGET_UBOOT_BOARD_DEFCONFIG="orangepi_zero" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_PYTHON3=y BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"

configs/orangepi_zero_defconfig line 26

Quoted 8 lines
configs/orangepi_zero_defconfig +1 -7
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/orangepi/orangepi-zero/boot.cmd"
-BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
-BR2_PACKAGE_HOST_MTOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/orangepi/common/uboot-extras.config"

Here ^^^ I tend to use .fragment extension instead of .config

configs/orangepi_zero_defconfig line 33

Quoted 7 lines
configs/orangepi_zero_defconfig +7 -0
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="sunxi"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-h2-plus-orangepi-zero"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/orangepi/orangepi-zero/linux-extras.config"

Ditto ^^^

configs/orangepi_zero_defconfig line 46

Quoted 13 lines
configs/orangepi_zero_defconfig +13 -0
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.16.1"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_16=y
+
+# Filesystem
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="63M"
+BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O ^64bit,fast_commit"
+BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW=y
+BR2_TARGET_ROOTFS_TAR=n

Here you should keep the form # BR2_TARGET_ROOTFS_TAR not set Instead of assigning =n

Best regards
—-
Giulio Benetti
Benetti Engineering sas

Quoted 31 lines
configs/orangepi_zero_defconfig +3 -0
+
+# Image
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/orangepi/common/post-build.sh"

BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"

configs/orangepi_zero_defconfig +5 -2
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/orangepi/orangepi-zero/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BINARIES_DIR)/genimage.cfg"
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_GENIMAGE=y
 
-# wireless driver and firmware
+# Wireless driver and firmware

BR2_PACKAGE_XR819_XRADIO=y
BR2_PACKAGE_ARMBIAN_FIRMWARE=y
BR2_PACKAGE_ARMBIAN_FIRMWARE_XR819=y

configs/orangepi_zero_defconfig +1 -1
-# wireless support
+# Wireless support

BR2_PACKAGE_IW=y
BR2_PACKAGE_WIRELESS_TOOLS=y
BR2_PACKAGE_WIRELESS_TOOLS_LIB=y

configs/orangepi_zero_defconfig +0 -0
@@ -51,5 +66,5 @@ BR2_PACKAGE_WPA_SUPPLICANT=y

BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
BR2_PACKAGE_WPA_SUPPLICANT_CLI=y

configs/orangepi_zero_defconfig +1 -1
-# spi flash support
+# Spi flash support

BR2_PACKAGE_MTD=y

Signature · 1 line
2.34.1
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot