Skip to content

Draft: U-boots: copy already existing U-boot image from uboot-target (OpenWrt main repo)

Josef Schlehofer requested to merge feature/u-boot into develop

Omnia: compile tested
Turris 1x: not tested

What it does?

This depends on uboot-mvebu, which is located in OpenWrt main repo. It compiles the U-boot image for Turris Omnia router by using UBOOT_CONFIG, which is defined in the include/u-boot.mk, where it is used in Build/Configure/U-Boot. Because of Build/InstallDev the U-boot binary is copied to staging_dir, which we copy and package it to the standalone package as we want to provide users via opkg.

Why do it like this?

We are not doing it in the right way as OpenWrt.

  1. We don't use include/u-boot.mk from OpenWrt
    This means that no flags are being passed to U-boot. Thus we are losing LOCALVERSION [2], which we added to OpenWrt [3]

  2. We are compiling Turris Omnia U-boot twice
    This leads to increasing build time. Someone can argue that OpenWrt has older version of U-boot, then we are shipping, but we can do it by patch against their version. I was updating U-boot in the past there and testing it.

  3. All our U-boot packages are compiled by -j1.
    Caused by 1st point. We missed PKG_BUILD_PARALLEL.

  4. We are doing weird solutions, which are not necessary and are already handled within OpenWrt build system. While compiling two configs for one board, it does not do clean (a875a676), thus there can be some leftovers from previous compile run, but if you do it as OpenWrt does it, then it behaves correctly. See: build@b63cf66e

[1] https://oftc.irclog.whitequark.org/openwrt-devel/2022-09-05#31325363;
[2] https://github.com/openwrt/openwrt/blob/master/include/u-boot.mk#L48
[3] https://github.com/openwrt/openwrt/commit/d6aa9d9e071d9f23ed26f5142991bc66aefe20f5

Fixes: !964 (comment 260866)
cc: @sborek

Edited by Josef Schlehofer

Merge request reports