board/bananapi/bananapi-m2-berry: switch to use extlinux.conf
PATCH 1/2 board/bananapi/bananapi-m2-berry: switch to use extlinux.conf
While switching bump Linux version to 6.1.57 and U-Boot version to 2023.10.
--- board/bananapi/bananapi-m2-berry/boot.cmd | 7 ------- board/bananapi/bananapi-m2-berry/extlinux.conf | 4 ++++ board/bananapi/bananapi-m2-berry/genimage.cfg | 18 ------------------ board/bananapi/bananapi-m2-berry/post-build.sh | 5 +++++ configs/bananapi_m2_berry_defconfig | 9 ++++----- 5 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 board/bananapi/bananapi-m2-berry/boot.cmd create mode 100644 board/bananapi/bananapi-m2-berry/extlinux.conf create mode 100755 board/bananapi/bananapi-m2-berry/post-build.sh
board/bananapi/bananapi-m2-berry/boot.cmd deleted +0 -7
@@ -1,7 +0,0 @@ -setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait - -mmc dev 0 -fatload mmc 0 $kernel_addr_r zImage -fatload mmc 0 $fdt_addr_r sun8i-v40-bananapi-m2-berry.dtb - -bootz $kernel_addr_r - $fdt_addr_r
board/bananapi/bananapi-m2-berry/extlinux.conf new file +4 -0
@@ -0,0 +1,4 @@ +label Bananapi M2 Berry linux + kernel /boot/zImage + devicetree /boot/sun8i-v40-bananapi-m2-berry.dtb + append console=ttyS0,115200n8 root=/dev/mmcblk0p1 rootwait
board/bananapi/bananapi-m2-berry/genimage.cfg +0 -18
@@ -1,15 +1,3 @@ -image boot.vfat { - vfat { - files = { - "zImage", - "sun8i-v40-bananapi-m2-berry.dtb", - "boot.scr" - } - } - - size = 64M -} - image sdcard.img { hdimage { }
@@ -21,12 +9,6 @@ image sdcard.img { size = 1016K # 1MB - 8KB } - partition boot { - partition-type = 0xC - bootable = "true" - image = "boot.vfat" - } - partition rootfs { partition-type = 0x83 image = "rootfs.ext4"
board/bananapi/bananapi-m2-berry/post-build.sh new file +5 -0
@@ -0,0 +1,5 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" + +install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
configs/bananapi_m2_berry_defconfig +4 -5
@@ -2,21 +2,23 @@ BR2_arm=y BR2_cortex_a7=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TARGET_GENERIC_ISSUE="Welcome to Bananapi M2 Berry" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/bananapi/bananapi-m2-berry/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/bananapi/bananapi-m2-berry/genimage.cfg" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.38" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.57" BR2_LINUX_KERNEL_DEFCONFIG="sunxi" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-v40-bananapi-m2-berry" +BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y # BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y -BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2023.07" +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2023.10" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="bananapi_m2_berry" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
@@ -26,6 +28,3 @@ BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y -BR2_PACKAGE_HOST_UBOOT_TOOLS=y -BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y -BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/bananapi/bananapi-m2-berry/boot.cmd"
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/2 board/bananapi/bananapi-m2-ultra: switch to use extlinux.conf
While switching bump Linux version to 6.1.57 and U-Boot version to 2023.10.
--- board/bananapi/bananapi-m2-ultra/boot.cmd | 7 ------- board/bananapi/bananapi-m2-ultra/extlinux.conf | 4 ++++ board/bananapi/bananapi-m2-ultra/genimage.cfg | 18 ------------------ board/bananapi/bananapi-m2-ultra/post-build.sh | 5 +++++ configs/bananapi_m2_ultra_defconfig | 9 ++++----- 5 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 board/bananapi/bananapi-m2-ultra/boot.cmd create mode 100644 board/bananapi/bananapi-m2-ultra/extlinux.conf create mode 100755 board/bananapi/bananapi-m2-ultra/post-build.sh
board/bananapi/bananapi-m2-ultra/boot.cmd deleted +0 -7
@@ -1,7 +0,0 @@ -setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait - -mmc dev 0 -fatload mmc 0 $kernel_addr_r zImage -fatload mmc 0 $fdt_addr_r sun8i-r40-bananapi-m2-ultra.dtb - -bootz $kernel_addr_r - $fdt_addr_r
board/bananapi/bananapi-m2-ultra/extlinux.conf new file +4 -0
@@ -0,0 +1,4 @@ +label Bananapi M2 Ultra linux + kernel /boot/zImage + devicetree /boot/sun8i-r40-bananapi-m2-ultra.dtb + append console=ttyS0,115200n8 root=/dev/mmcblk0p1 rootwait
board/bananapi/bananapi-m2-ultra/genimage.cfg +0 -18
@@ -1,15 +1,3 @@ -image boot.vfat { - vfat { - files = { - "zImage", - "sun8i-r40-bananapi-m2-ultra.dtb", - "boot.scr" - } - } - - size = 64M -} - image sdcard.img { hdimage { }
@@ -21,12 +9,6 @@ image sdcard.img { size = 1016K # 1MB - 8KB } - partition boot { - partition-type = 0xC - bootable = "true" - image = "boot.vfat" - } - partition rootfs { partition-type = 0x83 image = "rootfs.ext4"
board/bananapi/bananapi-m2-ultra/post-build.sh new file +5 -0
@@ -0,0 +1,5 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" + +install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf
configs/bananapi_m2_ultra_defconfig +4 -5
@@ -2,21 +2,23 @@ BR2_arm=y BR2_cortex_a7=y BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y BR2_TARGET_GENERIC_ISSUE="Welcome to Bananapi M2 Ultra" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/bananapi/bananapi-m2-ultra/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/bananapi/bananapi-m2-ultra/genimage.cfg" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.12" +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.57" BR2_LINUX_KERNEL_DEFCONFIG="sunxi" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-r40-bananapi-m2-ultra" +BR2_LINUX_KERNEL_INSTALL_TARGET=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y # BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_UBOOT=y BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y -BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2023.01" +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2023.10" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="bananapi_m2_berry" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
@@ -27,6 +29,3 @@ BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y -BR2_PACKAGE_HOST_UBOOT_TOOLS=y -BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y -BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/bananapi/bananapi-m2-ultra/boot.cmd"
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Giulio,
Thanks for your work on this!
Quoted 23 lines · On Fri, 13 Oct 2023 23:08:40 +0200 Giulio Benetti…
board/bananapi/bananapi-m2-berry/genimage.cfg +0
-12@@ -1,15 +1,3 @@ -image boot.vfat { - vfat { - files = { - "zImage", - "sun8i-v40-bananapi-m2-berry.dtb", - "boot.scr" - } - } - - size = 64M -} - image sdcard.img { hdimage { }@@ -21,12 +9,6 @@ image sdcard.img { size = 1016K # 1MB - 8KB }
board/bananapi/bananapi-m2-berry/genimage.cfg image sdcard.img { · line 14
Quoted 10 lines
board/bananapi/bananapi-m2-berry/genimage.cfg +0
-6- partition boot { - partition-type = 0xC - bootable = "true" - image = "boot.vfat" - } - partition rootfs { partition-type = 0x83 image = "rootfs.ext4"
Are you sure this works? Indeed the FAT partition used to have the bootable = "true" flag. Now, no partition has this flag. But from what I remember, the heuristic that U-Boot uses to determine which partition has the extlinux.conf file is precisely this bootable flag.
Could you double check this?
Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Thomas,
Quoted 46 lines · Thomas Petazzoni
Hello Giulio,
Thanks for your work on this!
Quoted 23 lines · On Fri, 13 Oct 2023 23:08:40 +0200 Giulio Benetti…
board/bananapi/bananapi-m2-berry/genimage.cfg +0
-12@@ -1,15 +1,3 @@ -image boot.vfat { - vfat { - files = { - "zImage", - "sun8i-v40-bananapi-m2-berry.dtb", - "boot.scr" - } - } - - size = 64M -} - image sdcard.img { hdimage { }@@ -21,12 +9,6 @@ image sdcard.img { size = 1016K # 1MB - 8KB }board/bananapi/bananapi-m2-berry/genimage.cfg image sdcard.img { · line 14
Quoted 10 lines
board/bananapi/bananapi-m2-berry/genimage.cfg +0
-6- partition boot { - partition-type = 0xC - bootable = "true" - image = "boot.vfat" - } - partition rootfs { partition-type = 0x83 image = "rootfs.ext4"Are you sure this works? Indeed the FAT partition used to have the bootable = "true" flag. Now, no partition has this flag. But from what I remember, the heuristic that U-Boot uses to determine which partition has the extlinux.conf file is precisely this bootable flag.
Quoted 1 line
Could you double check this?
Just rebuilt, flashed and given a run, this is the log, specifically in u-boot:
```
Bus usb@1c19000: USB EHCI 1.00
scanning bus usb@1c19000 for devices... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
1: Bananapi M2 Berry linux
Retrieving file: /boot/zImage
append: console=ttyS0,115200n8 root=/dev/mmcblk0p1 rootwait
Retrieving file: /boot/sun8i-v40-bananapi-m2-berry.dtb
Kernel image @ 0x42000000 [ 0x000000 - 0x4ee608 ]
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
Working FDT set to 43000000
Loading Device Tree to 49ff6000, end 49fff231 ... OK
Working FDT set to 49ff6000
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
```It looks for /boot/extlinux/extlinux.conf among the medias and other scripts. So yes, it works.
Kind regards
Signature · 6 lines
Giulio Benetti CEO&CTO@Benetti Engineering sas _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 2 lines · On Thu, 2 Nov 2023 19:30:48 +0100 Giulio Benetti…
Just rebuilt, flashed and given a run, this is the log, specifically in u-boot:
Hum, indeed, the U-Boot documentation says:
"Note that in the absence of any partition that is explicitly marked bootable, U-Boot falls back to searching the first valid partition of a disk for boot configuration files."
So, that's why it works.
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 6 lines
Il giorno 4 nov 2023, alle ore 15:02, Thomas Petazzoni <[email protected]> ha scritto:
On Thu, 2 Nov 2023 19:30:48 +0100
Giulio Benetti <[email protected]> wrote:
Quoted 8 lines
Quoted 2 lines
Just rebuilt, flashed and given a run, this is the log, specifically in u-boot:
Hum, indeed, the U-Boot documentation says:
"Note that in the absence of any partition that is explicitly marked bootable, U-Boot falls back to searching the first valid partition of a disk for boot configuration files."
Thank you for digging and finding the reason!
Best regards
Giulio
Quoted 8 lines
So, that's why it works.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 4 lines · On Fri, 13 Oct 2023 23:08:40 +0200 Giulio Benetti…
While switching bump Linux version to 6.1.57 and U-Boot version to 2023.10.
Signed-off-by Giulio Benetti <[email protected]>
Quoted 10 lines
--- board/bananapi/bananapi-m2-berry/boot.cmd | 7 ------- board/bananapi/bananapi-m2-berry/extlinux.conf | 4 ++++ board/bananapi/bananapi-m2-berry/genimage.cfg | 18 ------------------ board/bananapi/bananapi-m2-berry/post-build.sh | 5 +++++ configs/bananapi_m2_berry_defconfig | 9 ++++----- 5 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 board/bananapi/bananapi-m2-berry/boot.cmd create mode 100644 board/bananapi/bananapi-m2-berry/extlinux.conf create mode 100755 board/bananapi/bananapi-m2-berry/post-build.sh
Series applied to master, thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot