Hi Aravind,

On 12/5/24 1:34 PM, aravind posina wrote:
SUMMARY = "Cypress Wi-Fi backports package"
DESCRIPTION = "Backports of Cypress Wi-Fi drivers from a newer kernel
version to be used with an older kernel."
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b4425e8d7d63055b514bf7732284231a"

SRC_URI = "file://cypress-fmac-v5.15.58-2024_0118.tar.gz"

Would be nice to see the Makefile in this tarball as well.

#SRC_URI[sha256sum] =
"5b58e4f4e3182b60575dbbd1c5a91f55f50fefcbeef48666ceb279fa1b6db49d"
SRC_URI[sha256sum] =
"062574e1e63ffb4d9b1a67e68267126e49615d15bfeef4aea1cd14e063882eea"

S =
"${WORKDIR}/cypress-fmac-v5.15.58-2024_0118/cypress-backports-v5.15.58-2024_0118-module-src/v5.15.58-backports"
KERNEL_VERSION = "5.10.76-bsp-yocto-ampliphy-i.mx6ul-pd21.2.1"

#CFLAGS += -falign-functions=16
CFLAGS_append = " -falign-functions=32"
#EXTRA_OEMAKE += "CFLAGS+=-falign-functions=32"

# Define the kernel sources and build directories
KERNEL_SRC = "${STAGING_KERNEL_DIR}"
KERNEL_BUILD = "${STAGING_KERNEL_BUILDDIR}"

EXTRA_CFLAGS:remove = "-falign-functions"
EXTRA_CFLAGS:append = "-falign-functions=4"


# Inherit the module class to build kernel modules
inherit module

do_configure() {
     oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD}
defconfig-brcmfmac
     oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD} oldconfig
     oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD} modules

I assume this is actually building the modules, so it should be part of the do_compile. Which you should be able to do by simply setting MAKE_TARGET to "modules" in the recipe namespace (i.e. simply MAKE_TARGET = "modules" in your recipe, outside of tasks).

I would strongly suggest to look at what was done for the do_compile and do_install tasks inside the module class, you likely need something awfully similar for your do_configure step.
https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/module.bbclass?h=master#n49
https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/module.bbclass?h=master#n61

Specifically look at the unset line and all the variables passed to the or_runmake instruction.


}

# Compile the backports kernel modules
#do_compile() {
#    Compile the backports kernel modules
#    oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD} modules
#}
#do_compile() {
#    oe_runmake KLIB=${KERNEL_SRC} KLIB_BUILD=${KERNEL_BUILD}
EXTRA_CFLAGS="${CFLAGS}" modules
#}

do_compile_append() {
     export KERNEL_CFLAGS="-falign-functions=16"

Pretty sure this is not used since you'd set the variable after the compile instruction has run (:append).

}


do_install() {
     # Create directory for the modules
     install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress

     # Locate and install the kernel modules
     find ${S} -name "brcmutil.ko" -exec install -m 0644 {}
${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/ \;
     find ${S} -name "brcmfmac.ko" -exec install -m 0644 {}
${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/ \;
     find ${S} -name "cfg80211.ko" -exec install -m 0644 {}
${D}/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/ \;
}


# Update module dependencies after installation
do_install_append() {
     depmod -a ${KERNEL_VERSION} -b ${D}
}

# Files to be included in the final package
FILES_${PN} +=
"/lib/modules/${KERNEL_VERSION}/kernel/backports/cypress/*.ko"
FILES_${PN} += "/lib/modules/${KERNEL_VERSION}/modules.*"
FILES_${PN} += "/lib/firmware/brcm/*.bin"

TARGET_CFLAGS:remove = "-Werror"
TARGET_CFLAGS:append = " -falign-functions=4 "

# Skip the sanity check for installed vs shipped files (if applicable)
INSANE_SKIP_${PN} = "installed-vs-shipped"

Here is the recipe that I was compiling and I'm facing the issues.


Which version of Yocto are you using? Because the _ override syntax is long EoL, we now use : instead, so it should be do_install:append(), FILES:${PN}, do_compile:append() etc.... I see there are some :remove/:append there, so it seems like you're either using dunfell because both syntax are supported or something here just won't work as it's one syntax or the other that works but not both.

Cheers,
Quentin
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#64407): https://lists.yoctoproject.org/g/yocto/message/64407
Mute This Topic: https://lists.yoctoproject.org/mt/109831107/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to