summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorMing Liu <ming.liu@toradex.com>2022-09-02 14:49:04 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2022-09-24 15:25:40 +0200
commit4e6801bcc0f3f7187aca1de7969fa55d62405779 (patch)
tree5be9e0fe563b6c3cdfc123cd59d1c62fea5e0ef2 /classes
parent0a58d4b4ef1fda315a4333102aa3935b75c71ba7 (diff)
toradex-fitimage.bbclass: drop bbclass
The reason we introduced this class was because we need the following fixes from OE which are not in dunfell branch: ``` ``` f9fcff023c meta: introduce UBOOT_MKIMAGE_KERNEL_TYPE b0f8d8a4c0 kernel-fitimage.bbclass: introduce FIT_SUPPORTED_INITRAMFS_FSTYPES 0ef3a5e2a6 kernel-fitimage.bbclass: drop unit addresses from bootscr sections 900949af7f kernel-fitimage.bbclass: fix a wrong conditional check c461b24507 kernel-fitimage.bbclass: support both KERNEL_DEVICETREE/EXTERNAL_KERNEL_DEVICETREE ``` ``` now they are in kirstone/master branches of OE, so we dont have to maintain it any more Related-to: ELB-4700 Signed-off-by: Ming Liu <ming.liu@toradex.com> (cherry picked from commit 25ae5789570d24d10bb9f9cf860212b259ccbbca)
Diffstat (limited to 'classes')
-rw-r--r--classes/toradex-fitimage.bbclass160
1 files changed, 0 insertions, 160 deletions
diff --git a/classes/toradex-fitimage.bbclass b/classes/toradex-fitimage.bbclass
deleted file mode 100644
index cbf7e86..0000000
--- a/classes/toradex-fitimage.bbclass
+++ /dev/null
@@ -1,160 +0,0 @@
-# Toradex kernel-fitimage.bbclass extension
-#
-# This bbclass extends OE's kernel-fitimage.bbclass by overridding
-# some functions according to Toradex specific requirements.
-#
-# Copyright 2021 (C) Toradex AG
-
-inherit kernel-fitimage
-
-FIT_SUPPORTED_INITRAMFS_FSTYPES:append = " squashfs"
-
-#
-# Override fitimage_assemble in kernel-fitimage.bbclass
-#
-# To support devicetree overlays, we need handle both
-# ${KERNEL_DEVICETREE} and ${EXTERNAL_KERNEL_DEVICETREE} at
-# meanwhile.
-#
-# Assemble fitImage
-#
-# $1 ... .its filename
-# $2 ... fitImage name
-# $3 ... include ramdisk
-fitimage_assemble() {
- kernelcount=1
- dtbcount=""
- DTBS=""
- ramdiskcount=${3}
- setupcount=""
- rm -f ${1} arch/${ARCH}/boot/${2}
-
- fitimage_emit_fit_header ${1}
-
- #
- # Step 1: Prepare a kernel image section.
- #
- fitimage_emit_section_maint ${1} imagestart
-
- uboot_prep_kimage
- fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}"
-
- #
- # Step 2: Prepare a DTB image section
- #
-
- if [ -n "${KERNEL_DEVICETREE}" ]; then
- dtbcount=1
- for DTB in ${KERNEL_DEVICETREE}; do
- if echo ${DTB} | grep -q '/dts/'; then
- bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
- DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
- fi
- DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
- if [ ! -e "${DTB_PATH}" ]; then
- DTB_PATH="arch/${ARCH}/boot/${DTB}"
- fi
-
- DTB=$(echo "$(basename ${DTB})" | tr '/' '_')
- DTBS="${DTBS} ${DTB}"
- fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
- done
- fi
-
- if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then
- dtbcount=1
- for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do
- DTB=$(echo "${DTB}" | tr '/' '_')
- DTBS="${DTBS} ${DTB}"
- fitimage_emit_section_dtb ${1} ${DTB} "${EXTERNAL_KERNEL_DEVICETREE}/${DTB}"
- done
- fi
-
- #
- # Step 3: Prepare a setup section. (For x86)
- #
- if [ -e arch/${ARCH}/boot/setup.bin ]; then
- setupcount=1
- fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin
- fi
-
- #
- # Step 4: Prepare a ramdisk section.
- #
- if [ "x${ramdiskcount}" = "x1" ] ; then
- # Find and use the first initramfs image archive type we find
- found=
- for img in ${FIT_SUPPORTED_INITRAMFS_FSTYPES}; do
- initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
- echo "Using $initramfs_path"
- if [ -e "${initramfs_path}" ]; then
- found=true
- fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}"
- break
- fi
- done
-
- if [ -z "$found" ]; then
- bbfatal "Could not find a valid initramfs type for ${INITRAMFS_IMAGE_NAME}, the supported types are: ${FIT_SUPPORTED_INITRAMFS_FSTYPES}"
- fi
- fi
-
- fitimage_emit_section_maint ${1} sectend
-
- # Force the first Kernel and DTB in the default config
- kernelcount=1
- if [ -n "${dtbcount}" ]; then
- dtbcount=1
- fi
-
- #
- # Step 5: Prepare a configurations section
- #
- fitimage_emit_section_maint ${1} confstart
-
- if [ -n "${DTBS}" ]; then
- i=1
- for DTB in ${DTBS}; do
- dtb_ext=${DTB##*.}
- if [ "${dtb_ext}" = "dtbo" ]; then
- fitimage_emit_section_config ${1} "" "${DTB}" "" "" "`expr ${i} = ${dtbcount}`"
- else
- fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
- fi
- i=`expr ${i} + 1`
- done
- else
- defaultconfigcount=1
- fitimage_emit_section_config ${1} "${kernelcount}" "" "${ramdiskcount}" "${setupcount}" "${defaultconfigcount}"
- fi
-
- fitimage_emit_section_maint ${1} sectend
-
- fitimage_emit_section_maint ${1} fitend
-
- #
- # Step 6: Assemble the image
- #
- uboot-mkimage \
- ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
- -f ${1} \
- arch/${ARCH}/boot/${2}
-
- #
- # Step 7: Sign the image and add public key to U-Boot dtb
- #
- if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then
- add_key_to_u_boot=""
- if [ -n "${UBOOT_DTB_BINARY}" ]; then
- # The u-boot.dtb is a symlink to UBOOT_DTB_IMAGE, so we need copy
- # both of them, and don't dereference the symlink.
- cp -P ${STAGING_DATADIR}/u-boot*.dtb ${B}
- add_key_to_u_boot="-K ${B}/${UBOOT_DTB_BINARY}"
- fi
- uboot-mkimage \
- ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
- -F -k "${UBOOT_SIGN_KEYDIR}" \
- $add_key_to_u_boot \
- -r arch/${ARCH}/boot/${2}
- fi
-}