summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-qoriq_4.1.bbappend
blob: 8659cb208ca1fb49695d29d9e1efca85011be4bc (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

#SRC_URI main is in meta-freescale/src-nxp-npi-1703 layers
SRC_URI += "file://simc-t10xx_device_tree_addition.patch file://fit_image_template.its"
SRC_URI += "file://simc-t2081_device_tree_addition.patch"

python __anonymous () {
    d.appendVar("PACKAGES", " kernel-fitimage")
}

FILES_kernel-fitimage = "/boot/"

# Appending of simc-txxxx specific kernel configs to the used defconfig.
do_configure_prepend() {
	if [ "${MACHINE}" = "simc-t2081-tcb-02" ] ; then
		cat ${THISDIR}/../../../meta-scalys-ppc/recipes-kernel/linux/files/defconfig_append_simc-t2081 >> ${KERNEL_DEFCONFIG}
	else
        cat ${THISDIR}/../../../meta-scalys-ppc/recipes-kernel/linux/files/defconfig_append_simc-t10xx >> ${KERNEL_DEFCONFIG}
    fi
    
    # uncomment next line to insert virt kernel configs
    #cat ${THISDIR}/../../../meta-scalys-ppc/recipes-kernel/linux/files/defconfig_append_simc-txxxx-virt >> ${KERNEL_DEFCONFIG}
}

do_kernel_fitimage() {
	cd ${B}
	for i in ${KERNEL_FIT_IMAGES}; do
		cp ${WORKDIR}/fit_image_template.its ${i}.its
		sed -i "s/DTB_PLACEHOLDER/${i}/g" ${i}.its
		uboot-mkimage -f ${i}.its ${B}/arch/${ARCH}/boot/${i}.itb
		
		# Assemble the name for the fitImage
		ITB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${i}/g" | sed "s/uImage-/fitImage/g"`
		#ITB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${i}/g"`
		
		install -d ${DEPLOYDIR}
		install -m 0644 ${B}/arch/${ARCH}/boot/${i}.itb ${DEPLOYDIR}/${ITB_NAME}.itb
		
		# create a symlink for the last generated fit image
		cd ${DEPLOYDIR}
		ln -sf ${ITB_NAME}.itb fitImage.itb
		cd -
		
		# Make the FIT image available on the target RFS
		install -d ${D}/boot
		install -m 0644 ${B}/arch/${ARCH}/boot/${i}.itb ${D}/boot/${ITB_NAME}.itb
		
		# create a symlink for the last generated fit image
		cd ${D}/boot/
		ln -sf ${ITB_NAME}.itb fitImage.itb
		cd -
	done
}

# The install stage generates the DTB needed for the FIT image (linux-dtb.inc)
addtask do_kernel_fitimage after do_install before do_package