Skip to content

Commit 97f55e9

Browse files
Christophe PriouzeauBernardPuel
authored andcommitted
KERNEL: 6.1-stm32mp-r1
Change-Id: If968a7d772e08ae57e98727cf4c3bff77ebeb947 Signed-off-by: Christophe Priouzeau <[email protected]>
1 parent e9c30f9 commit 97f55e9

36 files changed

+145258
-52498
lines changed

recipes-kernel/linux/linux-stm32mp.inc

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,51 @@ COMPATIBLE_MACHINE = "(stm32mpcommon)"
33
#for EFI
44
include ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'conf/image-uefi.conf', '', d)}
55
inherit kernel
6+
inherit external-dt
7+
inherit multilib_header
8+
9+
# For FIT image to expand properly for UBOOT_CONFIG vars
10+
include ${@bb.utils.contains('MACHINE_FEATURES', 'fit', 'recipes-bsp/u-boot/u-boot-stm32mp-config.inc', '', d)}
611

712
DEPENDS += "openssl-native util-linux-native libyaml-native"
13+
DEPENDS += "unifdef-native bison-native rsync-native"
814

915
B = "${WORKDIR}/build"
1016
# Configure build dir for externalsrc class usage through devtool
1117
EXTERNALSRC_BUILD:pn-${PN} = "${WORKDIR}/build"
1218

1319
# To share config fragments between layers
14-
FILESEXTRAPATHS:prepend := "${THISDIR}:"
20+
FILESEXTRAPATHS:prepend := "${THISDIR}:${THISDIR}/linux-stm32mp:"
1521

1622
do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}/kernel"
1723

1824
#---------------------------------------------------------------
1925
# Module kernel signature
2026
KERNEL_SIGN_ENABLE ?= "0"
2127
EXTRA_OEMAKE += "${@oe.utils.ifelse(d.getVar('KERNEL_SIGN_ENABLE') == '1', 'INSTALL_MOD_STRIP=1','')}"
28+
EXTRA_OEMAKE += "${@bb.utils.contains('EXTERNAL_DT_ENABLED', '1', 'KBUILD_EXTDTS=${STAGING_EXTDT_DIR}/${EXTDT_DIR_LINUX}', '', d)}"
2229

2330
# Deploy kernel config file to deploy folder
2431
KERNEL_CONFIG_DEPLOY ??= "0"
2532

33+
# scmversion
34+
# in case of several build with the same source code ( git, devtools),
35+
# a scmversion file is create on source code but never added
36+
# on build directory except for first build.
37+
# => Need to create the file in all case
38+
do_configure:prepend() {
39+
if [ ! -d ${B} ]; then
40+
mkdir -p ${B}
41+
fi
42+
if [ ! -e ${B}/.scmversion ]; then
43+
echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
44+
fi
45+
if [ ! -e ${S}/.scmversion ]; then
46+
echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
47+
echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
48+
fi
49+
}
50+
2651
# ---------------------------------------------------------------------
2752
# Defconfig
2853
#
@@ -70,11 +95,37 @@ do_configure:append() {
7095
}
7196

7297
# ---------------------------------------------------------------------
98+
# stub for devicetree which are located on st directory
99+
do_install:prepend() {
100+
if [ -d "${B}/arch/${ARCH}/boot/dts/st" ]; then
101+
for dtbf in ${KERNEL_DEVICETREE}; do
102+
if [ -n "${KERNEL_SUB_PATH}" -a -e "${B}/arch/${ARCH}/boot/dts/${KERNEL_SUB_PATH}${dtbf}" ]; then
103+
install -m 0644 "${B}/arch/${ARCH}/boot/dts/${KERNEL_SUB_PATH}${dtbf}" "${B}/arch/${ARCH}/boot/dts/"
104+
else
105+
if [ -z "${KERNEL_SUB_PATH}" -a -e "${B}/arch/${ARCH}/boot/dts/st/${dtbf}" ]; then
106+
install -m 0644 "${B}/arch/${ARCH}/boot/dts/st/${dtbf}" "${B}/arch/${ARCH}/boot/dts/"
107+
fi
108+
fi
109+
done
110+
fi
111+
}
112+
correct_buildpaths() {
113+
FILES=" \
114+
${B}/drivers/video/logo/logo_linux_clut224.c \
115+
${B}/drivers/tty/vt/consolemap_deftbl.c \
116+
${B}/lib/oid_registry_data.c \
117+
"
118+
for f in $FILES; do
119+
if [ -e $f ]; then
120+
sed -i "s|${TMPDIR}||g" $f
121+
fi
122+
done
123+
}
73124
do_install:append() {
74125
# Install KERNEL_IMAGETYPE for kernel-imagebootfs package
75126
install -m 0644 ${KERNEL_OUTPUT_DIR}/${KERNEL_IMAGETYPE} ${D}/${KERNEL_IMAGEDEST}
76-
install -d ${D}/${sysconfdir}/modprobe.d/
77127

128+
install -d ${D}/${sysconfdir}/modprobe.d
78129
if ${@bb.utils.contains('MACHINE_FEATURES','gpu','true','false',d)}; then
79130
# when ACCEPT_EULA are filled
80131
echo "blacklist etnaviv" > ${D}/${sysconfdir}/modprobe.d/blacklist.conf
@@ -90,6 +141,16 @@ do_install:append() {
90141
install -d ${D}${EFI_PREFIX}/dtb
91142
install -m 0664 ${D}${EFI_PREFIX}/*.dtb ${D}${EFI_PREFIX}/dtb/
92143
fi
144+
145+
# install header for sdk
146+
oe_runmake headers_install INSTALL_HDR_PATH=${D}${prefix}/src/linux-header-${LINUX_VERSION}
147+
# Kernel should not be exporting this header
148+
rm -f ${D}${prefix}/src/linux-header-${LINUX_VERSION}/include/scsi/scsi.h
149+
# The ..install.cmd conflicts between various configure runs
150+
find ${D}${prefix}/src/linux-header-${LINUX_VERSION} -name ..install.cmd | xargs rm -f
151+
152+
# correct buildpaths qa
153+
correct_buildpaths
93154
}
94155
# ---------------------------------------------------------------------
95156
do_deploy:append() {
@@ -104,6 +165,7 @@ do_deploy:append() {
104165
}
105166
do_deploy[depends] += " virtual/kernel:do_package "
106167

168+
107169
# ---------------------------------------------------------------------
108170
# Support checking the kernel load address parameter: expecting proper value for ST kernel.
109171
#

0 commit comments

Comments
 (0)