Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux-lmp: rework a versioning of patches #1453

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
base: linux-lmp: backport compatibility logic for 32-bit dtb
Backport the logic for 32-bit dtb files for ARM architecture from
meta-freescasle [1].

"Newer kernels have moved the dtbs to a vendor sub-folder.

In order to maintain one KERNEL_DEVICETREE for both new and old kernels,
provide logic that can be enabled in older kernels to strip the new
sub-folder."

[1]
commit f06c7376 ("linux: Add compatibility logic for 32-bit dtb move")

Signed-off-by: Oleksandr Suvorov <[email protected]>
MrCry0 committed Jun 25, 2024
commit 7ca8a26df24b4b9c0e0bf3f84533d3698b631020
28 changes: 28 additions & 0 deletions meta-lmp-base/recipes-kernel/linux/linux-lmp.inc
Original file line number Diff line number Diff line change
@@ -26,3 +26,31 @@ do_deploy:append() {
cp -a ${B}/.config ${DEPLOYDIR}/${KERNEL_CONFIG_NAME}
ln -sf ${KERNEL_CONFIG_NAME} ${DEPLOYDIR}/${KERNEL_CONFIG_LINK_NAME}
}

# Backport this function from meta-freescale:
# f06c7376 ("linux: Add compatibility logic for 32-bit dtb move")
# A function to strip the new 32-bit dtb sub-folders in KERNEL_DEVICETREE
# for older kernel builds.
# Set KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1" to enable.
KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE ?= "0"
python kernel_devicetree_32bit_compatibility_update() {
import os.path
import re
if d.getVar('KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE') != "1" or d.getVar('TUNE_ARCH') != "arm":
return
input = d.getVar('KERNEL_DEVICETREE').split()
output = ""
stripped = ""
for original in input:
if re.match("^.*/", original):
stripped = os.path.basename(original)
output += stripped + " "
bb.debug(1, "Devicetrees are moved to sub-folder, stripping the sub-folder for older kernel: %s -> %s" % (original, stripped))
else:
output += original + " "
if stripped:
bb.warn("Updating KERNEL_DEVICETREE, removing sub-folders for older kernel. Use -D for more details. Set KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = \"0\" to disable.")
d.setVar('KERNEL_DEVICETREE', output)
}
addhandler kernel_devicetree_32bit_compatibility_update
kernel_devicetree_32bit_compatibility_update[eventmask] = "bb.event.RecipeParsed"