guowenxue
2026-07-12 b7502990ad6509ff7349cc0ee17e0d7180e85b3d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require recipes-kernel/linux/linux-yocto.inc
 
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += " file://linux-imx-lf-6.18.20-2.0.0.patch "
PATCHTOOL = "patch"
 
KERNEL_DANGLING_FEATURES_WARN_ONLY="1"
KERNEL_DTC_FLAGS = "-@"
KERNEL_DTOVERLAY ?= ""
 
do_copy_defconfig:append() {
    if [ "${TARGET_ARCH}" = "arm" ]; then
        cp ${S}/arch/arm/configs/${MACHINE}_defconfig ${WORKDIR}/defconfig
        cp ${S}/arch/arm/configs/${MACHINE}_defconfig ${B}/.config
    else
        cp ${S}/arch/arm64/configs/${MACHINE}_defconfig ${WORKDIR}/defconfig
        cp ${S}/arch/arm64/configs/${MACHINE}_defconfig ${B}/.config
    fi
}
 
do_compile:append() {
    if [ -n "${KERNEL_DTC_FLAGS}" ]; then
        export DTC_FLAGS="${KERNEL_DTC_FLAGS}"
    fi
 
    for dtbf in ${KERNEL_DTOVERLAY}; do
        dtb=`normalize_dtb "$dtbf"`
        oe_runmake $dtb CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
    done
}
 
do_deploy:append(){
    install -d ${DEPLOYDIR}/overlays
 
    if [ "${TARGET_ARCH}" = "arm" ]; then
        dtbo_path="${B}/arch/arm/boot/dts/nxp/imx/${MACHINE}"
    else
        dtbo_path="${B}/arch/arm64/boot/dts/freescale/${MACHINE}"
    fi
 
    cp $dtbo_path/*.dtbo ${DEPLOYDIR}/overlays/
}