xf.li | 3dd5374 | 2024-09-27 00:06:23 -0700 | [diff] [blame] | 1 | SUMMARY = "zxic Linux kernel" |
| 2 | SECTION = "kernel" |
| 3 | PV = "${LINUX_VERSION}" |
| 4 | LICENSE = "GPLv2" |
| 5 | LIC_FILES_CHKSUM ?= "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" |
| 6 | LINUX_VERSION ?= "5.10.156" |
| 7 | BSPDIR = "${TOPDIR}/../upstream" |
| 8 | #pub include |
| 9 | include ${TOPDIR}/layers/meta-zxic/conf/pub_esdk.inc |
| 10 | |
| 11 | DEPENDS += "kern-tools-native" |
| 12 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES','dm-verity','zstd-native','',d)}" |
| 13 | inherit kernel siteinfo |
| 14 | |
xf.li | a06dd22 | 2024-10-14 09:07:20 +0000 | [diff] [blame^] | 15 | EXTRA_OEMAKE_append = " LOADADDR=${KERNEL_LOADADDR} EXTRA_CFLAGS='${ZXIC_EXTRA_CFLAGS}' " |
xf.li | 3dd5374 | 2024-09-27 00:06:23 -0700 | [diff] [blame] | 16 | FILESEXTRAPATHS_prepend :="${TOPDIR}/../upstream:" |
| 17 | # PR_CONFIG_cpe = "linux-5_10-cpe-${BOOT_CTL}-defconfig" |
| 18 | # PR_CONFIG_v2x = "linux-5_10-v2x-${BOOT_CTL}-defconfig" |
| 19 | PR_CONFIG_vehicle_dc = "linux-5_10-vehicle_dc-${BOOT_CTL}-defconfig" |
| 20 | PR_CONFIG_vehicle_dc_4Gb = "linux-5_10-vehicle_dc_4Gb-${BOOT_CTL}-defconfig" |
| 21 | S = "${WORKDIR}/linux-5.10" |
| 22 | |
| 23 | do_install[nostamp] = "1" |
| 24 | |
| 25 | SRC_URI = "\ |
| 26 | file://linux-5.10 \ |
| 27 | file://${MACHINE}/${LINUX_BASE_CONFIG} \ |
| 28 | " |
| 29 | |
| 30 | # returns all the elements from the src uri that are .cfg files |
| 31 | def find_cfgs(d): |
| 32 | sources=src_patches(d, True) |
| 33 | sources_list=[] |
| 34 | for s in sources: |
| 35 | if s.endswith('.cfg'): |
| 36 | sources_list.append(s) |
| 37 | |
| 38 | return sources_list |
| 39 | |
| 40 | kernel_do_configure() { |
| 41 | # fixes extra + in /lib/modules/2.6.37+ |
| 42 | # $ scripts/setlocalversion . => + |
| 43 | # $ make kernelversion => 2.6.37 |
| 44 | # $ make kernelrelease => 2.6.37+ |
| 45 | touch ${B}/.scmversion ${S}/.scmversion |
| 46 | |
| 47 | cp ${WORKDIR}/${MACHINE}/${LINUX_BASE_CONFIG} ${WORKDIR}/defconfig |
| 48 | if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then |
| 49 | mv "${S}/.config" "${B}/.config" |
| 50 | fi |
| 51 | |
| 52 | # Copy defconfig to .config if .config does not exist. This allows |
| 53 | # recipes to manage the .config themselves in do_configure_prepend(). |
| 54 | if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then |
| 55 | cp "${WORKDIR}/defconfig" "${B}/.config" |
| 56 | fi |
| 57 | |
| 58 | merge_config.sh -m ${WORKDIR}/defconfig ${@" ".join(find_cfgs(d))} |
| 59 | ${KERNEL_CONFIG_COMMAND} |
| 60 | } |
| 61 | |
| 62 | fakeroot do_cpio () { |
| 63 | if ${@bb.utils.contains('DISTRO_FEATURES','dm-verity','true','false',d)}; then |
| 64 | cp -v ${BSPDIR}/../esdk/sources/meta-zxic-custom/conf/distro/dm-verity/${KERNEL_INITRAMFS_CPIO} ${B}/ |
| 65 | fi |
| 66 | } |
| 67 | |
| 68 | do_install_append () { |
| 69 | #install elfs |
| 70 | install -d ${ELFS-PATH}/ |
| 71 | install -d ${BINS-PATH}/ |
| 72 | install -m 0755 ${WORKDIR}/image/boot/uImage ${ELFS-PATH}/uImage |
| 73 | install -m 0755 ${WORKDIR}/image/boot/${MACHINE}-${DISTRO}.dtb ${BINS-PATH}/ap_cpucap.dtb |
| 74 | install -m 0755 ${WORKDIR}/image/boot/${MACHINE}-${DISTRO}.dtb ${ELFS-PATH}/ |
| 75 | |
| 76 | install -m 0755 ${B}/vmlinux ${ELFS-PATH}/vmlinux |
| 77 | install -m 0755 ${B}/System.map ${ELFS-PATH}/System.map |
| 78 | if [ -d ${WORKDIR}/image/lib/modules ]; then |
| 79 | cp -rf ${WORKDIR}/image/lib/modules ${ELFS-PATH}/${PN}/ |
| 80 | fi |
| 81 | } |
| 82 | |
| 83 | do_cleanlibs () { |
| 84 | rm -fr ${ELFS-PATH}/uImage |
| 85 | rm -fr ${ELFS-PATH}/${MACHINE}-${DISTRO}.dtb |
| 86 | rm -fr ${ELFS-PATH}/vmlinux |
| 87 | rm -fr ${ELFS-PATH}/System.map |
| 88 | rm -fr ${ELFS-PATH}/${PN}/modules |
| 89 | } |
| 90 | addtask cleanlibs after do_clean before do_cleansstate |
| 91 | addtask do_cpio after do_configure before do_compile |
| 92 | |
| 93 | COMPATIBLE_MACHINE = "^zxic$" |