diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2017-09-12 11:20:40 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2017-09-27 10:26:46 -0300 |
commit | d578533e80934496f56e1521bbf64bda9aa76797 (patch) | |
tree | 1fee013dd129a26395c78e27d4f05dadac05ef05 | |
parent | 18aa784c0163e6f235f007cda239016f71ec02a4 (diff) | |
download | meta-freescale-d578533e80934496f56e1521bbf64bda9aa76797.tar.gz |
kernel-imximage.bbclass: Linux kernel with DCD headers
This new image type adds support to generate a Linux kernel with DCD
headers. Essentially it adds support to directly boot a Linux kernel
without a bootloader.
As the Linux kernel will be boot directly, it required that the Device
Tree is appended to the kernel image, which had support included in
OE-Core.
To have the Linux kernel generated with the DCD headers, following
steps must be followed:
- Linux kernel recipe must inherit kernel-imximage class;
- Device Tree appended Linux kernel must be used
(KERNEL_DEVICETREE_BUNDLE = "1");
- DCD header configuration must be provided (dcd.cfg or
dcd-<devicetree>.cfg);
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r-- | classes/kernel-imximage.bbclass | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/classes/kernel-imximage.bbclass b/classes/kernel-imximage.bbclass new file mode 100644 index 00000000..efc819f0 --- /dev/null +++ b/classes/kernel-imximage.bbclass | |||
@@ -0,0 +1,41 @@ | |||
1 | DEPENDS_append = ' u-boot-mkimage-native' | ||
2 | |||
3 | IMXIMAGE_ENTRYPOINT ?= "${UBOOT_ENTRYPOINT}" | ||
4 | |||
5 | imx_mkimage() { | ||
6 | uboot-mkimage -n $1 -T imximage -e ${IMXIMAGE_ENTRYPOINT} -d $2 $2.imx | ||
7 | } | ||
8 | |||
9 | gen_imximage() { | ||
10 | if [ -z "${IMXIMAGE_ENTRYPOINT}" ]; then | ||
11 | bbfatal "IMXIMAGE_ENTRYPOINT must have a valid value" | ||
12 | fi | ||
13 | |||
14 | for DTB in ${KERNEL_DEVICETREE}; do | ||
15 | DTB=`normalize_dtb "${DTB}"` | ||
16 | DTB_EXT=${DTB##*.} | ||
17 | DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"` | ||
18 | base_name="zImage-"${KERNEL_IMAGE_BASE_NAME} | ||
19 | symlink_name="zImage-"${KERNEL_IMAGE_SYMLINK_NAME} | ||
20 | DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` | ||
21 | DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` | ||
22 | for DCD in dcd-${DTB}.cfg dcd.cfg; do | ||
23 | if [ -e "${WORKDIR}/${DCD}" ]; then | ||
24 | if [ -e ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin ]; then | ||
25 | imx_mkimage ${WORKDIR}/${DCD} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin | ||
26 | ln -sf ${DTB_NAME}.${DTB_EXT}.bin.imx ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin.imx | ||
27 | fi | ||
28 | |||
29 | if [ -e ${DEPLOYDIR}/zImage-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin ]; then | ||
30 | imx_mkimage ${WORKDIR}/${DCD} ${DEPLOYDIR}/zImage-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin | ||
31 | ln -sf zImage-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin.imx \ | ||
32 | ${DEPLOYDIR}/zImage-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin.imx | ||
33 | fi | ||
34 | fi | ||
35 | done | ||
36 | done | ||
37 | } | ||
38 | |||
39 | do_deploy_append() { | ||
40 | gen_imximage | ||
41 | } | ||