Skip to content

Commit

Permalink
orangepi3b: create dtb symlink for mainline migration
Browse files Browse the repository at this point in the history
Linux prior to v6.11 did not contain a native Orange Pi 3B device tree, hence "rk3566-orangepi-3b.dtb" was added via patch. Since there is an incompatibility between board revisions v1.1 and v2.1, mainline Linux however added two device trees for those two revisions. Since mainline U-Boot did already select those new device trees by default, we needed to define the old one via boot environmetn, which does not exist in new kernel. Older U-Boot versions however won't load the new device trees.

To not break boot after kernel package upgrade, a symlink is hence added to the package to keep it compatible with old U-Boot and boot environment. A migration to new U-Boot, removing the then obsolete fdtfile declaration from boot env, can be done via distro upgrade scripts or manually, to fully support board revision v2.1.

Signed-off-by: MichaIng <[email protected]>
  • Loading branch information
MichaIng committed Dec 31, 2024
1 parent 635e7dc commit 7bd7cfd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/functions/compilation/kernel-debs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ function kernel_package_callback_linux_dtb() {
mkdir -p "${package_directory}/boot/"
run_host_command_logged cp -rp "${tmp_kernel_install_dirs[INSTALL_DTBS_PATH]}" "${package_directory}/boot/dtb-${kernel_version_family}"

# Create symlink for old Orange Pi 3B device tree for transition from custom to mainline dtb: https://dietpi.com/forum/t/20689/22
[[ -f "${package_directory}/boot/dtb-${kernel_version_family}/rockchip/rk3566-orangepi-3b-v1.1.dtb" && ! -f "${package_directory}/boot/dtb-${kernel_version_family}/rockchip/rk3566-orangepi-3b.dtb" ]] && run_host_command_logged ln -s 'rk3566-orangepi-3b-v1.1.dtb' "${package_directory}/boot/dtb-${kernel_version_family}/rockchip/rk3566-orangepi-3b.dtb"

# Generate a control file
cat <<- CONTROL_FILE > "${package_DEBIAN_dir}/control"
Version: ${artifact_version}
Expand Down

0 comments on commit 7bd7cfd

Please sign in to comment.