diff options
| author | Jaewon Lee <jaewon.lee@xilinx.com> | 2021-05-20 15:22:52 -0700 |
|---|---|---|
| committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2021-07-14 15:00:08 -0700 |
| commit | 328b6d4b49f5233f258a11936f136c53da54ad4a (patch) | |
| tree | d21207f4f80358044fffd84901360f1184d99bf8 /meta-xilinx-bsp | |
| parent | ccd14f2ae4b9e58e1fafe6be43689a12d1187af5 (diff) | |
| download | meta-xilinx-328b6d4b49f5233f258a11936f136c53da54ad4a.tar.gz | |
Revert "linux-xlnx_2021.1.bb: Adding fitimage_assemble as is from core"
This reverts commit 6fd06856a72e1bedb27e0f3890840d7d741a062f.
Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
Diffstat (limited to 'meta-xilinx-bsp')
| -rw-r--r-- | meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.1.bb | 139 |
1 files changed, 0 insertions, 139 deletions
diff --git a/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.1.bb b/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.1.bb index 0e83bc2d..d1daa13c 100644 --- a/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.1.bb +++ b/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2021.1.bb | |||
| @@ -7,142 +7,3 @@ KCONF_AUDIT_LEVEL="0" | |||
| 7 | include linux-xlnx.inc | 7 | include linux-xlnx.inc |
| 8 | 8 | ||
| 9 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 9 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
| 10 | |||
| 11 | fitimage_assemble() { | ||
| 12 | kernelcount=1 | ||
| 13 | dtbcount="" | ||
| 14 | DTBS="" | ||
| 15 | ramdiskcount=${3} | ||
| 16 | setupcount="" | ||
| 17 | rm -f ${1} arch/${ARCH}/boot/${2} | ||
| 18 | |||
| 19 | fitimage_emit_fit_header ${1} | ||
| 20 | |||
| 21 | # | ||
| 22 | # Step 1: Prepare a kernel image section. | ||
| 23 | # | ||
| 24 | fitimage_emit_section_maint ${1} imagestart | ||
| 25 | |||
| 26 | uboot_prep_kimage | ||
| 27 | fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}" | ||
| 28 | |||
| 29 | # | ||
| 30 | # Step 2: Prepare a DTB image section | ||
| 31 | # | ||
| 32 | |||
| 33 | if [ -z "${EXTERNAL_KERNEL_DEVICETREE}" ] && [ -n "${KERNEL_DEVICETREE}" ]; then | ||
| 34 | dtbcount=1 | ||
| 35 | for DTB in ${KERNEL_DEVICETREE}; do | ||
| 36 | if echo ${DTB} | grep -q '/dts/'; then | ||
| 37 | bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used." | ||
| 38 | DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'` | ||
| 39 | fi | ||
| 40 | DTB_PATH="arch/${ARCH}/boot/dts/${DTB}" | ||
| 41 | if [ ! -e "${DTB_PATH}" ]; then | ||
| 42 | DTB_PATH="arch/${ARCH}/boot/${DTB}" | ||
| 43 | fi | ||
| 44 | |||
| 45 | DTB=$(echo "${DTB}" | tr '/' '_') | ||
| 46 | DTBS="${DTBS} ${DTB}" | ||
| 47 | fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH} | ||
| 48 | done | ||
| 49 | fi | ||
| 50 | |||
| 51 | if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then | ||
| 52 | dtbcount=1 | ||
| 53 | for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do | ||
| 54 | DTB=$(echo "${DTB}" | tr '/' '_') | ||
| 55 | DTBS="${DTBS} ${DTB}" | ||
| 56 | fitimage_emit_section_dtb ${1} ${DTB} "${EXTERNAL_KERNEL_DEVICETREE}/${DTB}" | ||
| 57 | done | ||
| 58 | fi | ||
| 59 | |||
| 60 | # | ||
| 61 | # Step 3: Prepare a setup section. (For x86) | ||
| 62 | # | ||
| 63 | if [ -e arch/${ARCH}/boot/setup.bin ]; then | ||
| 64 | setupcount=1 | ||
| 65 | fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin | ||
| 66 | fi | ||
| 67 | |||
| 68 | # | ||
| 69 | # Step 4: Prepare a ramdisk section. | ||
| 70 | # | ||
| 71 | if [ "x${ramdiskcount}" = "x1" ] ; then | ||
| 72 | # Find and use the first initramfs image archive type we find | ||
| 73 | for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz cpio; do | ||
| 74 | initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}" | ||
| 75 | echo "Using $initramfs_path" | ||
| 76 | if [ -e "${initramfs_path}" ]; then | ||
| 77 | fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}" | ||
| 78 | break | ||
| 79 | fi | ||
| 80 | done | ||
| 81 | fi | ||
| 82 | |||
| 83 | fitimage_emit_section_maint ${1} sectend | ||
| 84 | |||
| 85 | # Force the first Kernel and DTB in the default config | ||
| 86 | kernelcount=1 | ||
| 87 | if [ -n "${dtbcount}" ]; then | ||
| 88 | dtbcount=1 | ||
| 89 | fi | ||
| 90 | |||
| 91 | # | ||
| 92 | # Step 5: Prepare a configurations section | ||
| 93 | # | ||
| 94 | fitimage_emit_section_maint ${1} confstart | ||
| 95 | |||
| 96 | # kernel-fitimage.bbclass currently only supports a single kernel (no less or | ||
| 97 | # more) to be added to the FIT image along with 0 or more device trees and | ||
| 98 | # 0 or 1 ramdisk. | ||
| 99 | # If a device tree is to be part of the FIT image, then select | ||
| 100 | # the default configuration to be used is based on the dtbcount. If there is | ||
| 101 | # no dtb present than select the default configuation to be based on | ||
| 102 | # the kernelcount. | ||
| 103 | if [ -n "${DTBS}" ]; then | ||
| 104 | i=1 | ||
| 105 | for DTB in ${DTBS}; do | ||
| 106 | dtb_ext=${DTB##*.} | ||
| 107 | if [ "${dtb_ext}" = "dtbo" ]; then | ||
| 108 | fitimage_emit_section_config ${1} "" "${DTB}" "" "" "`expr ${i} = ${dtbcount}`" | ||
| 109 | else | ||
| 110 | fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`" | ||
| 111 | fi | ||
| 112 | i=`expr ${i} + 1` | ||
| 113 | done | ||
| 114 | else | ||
| 115 | defaultconfigcount=1 | ||
| 116 | fitimage_emit_section_config ${1} "${kernelcount}" "" "${ramdiskcount}" "${setupcount}" "${defaultconfigcount}" | ||
| 117 | fi | ||
| 118 | |||
| 119 | fitimage_emit_section_maint ${1} sectend | ||
| 120 | |||
| 121 | fitimage_emit_section_maint ${1} fitend | ||
| 122 | |||
| 123 | # | ||
| 124 | # Step 6: Assemble the image | ||
| 125 | # | ||
| 126 | uboot-mkimage \ | ||
| 127 | ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ | ||
| 128 | -f ${1} \ | ||
| 129 | arch/${ARCH}/boot/${2} | ||
| 130 | |||
| 131 | # | ||
| 132 | # Step 7: Sign the image and add public key to U-Boot dtb | ||
| 133 | # | ||
| 134 | if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then | ||
| 135 | add_key_to_u_boot="" | ||
| 136 | if [ -n "${UBOOT_DTB_BINARY}" ]; then | ||
| 137 | # The u-boot.dtb is a symlink to UBOOT_DTB_IMAGE, so we need copy | ||
| 138 | # both of them, and don't dereference the symlink. | ||
| 139 | cp -P ${STAGING_DATADIR}/u-boot*.dtb ${B} | ||
| 140 | add_key_to_u_boot="-K ${B}/${UBOOT_DTB_BINARY}" | ||
| 141 | fi | ||
| 142 | uboot-mkimage \ | ||
| 143 | ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ | ||
| 144 | -F -k "${UBOOT_SIGN_KEYDIR}" \ | ||
| 145 | $add_key_to_u_boot \ | ||
| 146 | -r arch/${ARCH}/boot/${2} | ||
| 147 | fi | ||
| 148 | } | ||
