Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | inherit kernel-uboot kernel-artifact-names uboot-sign |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | |
| 3 | python __anonymous () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 4 | kerneltypes = d.getVar('KERNEL_IMAGETYPES') or "" |
He Zhe | fe76b1e | 2016-05-25 04:47:16 -0400 | [diff] [blame] | 5 | if 'fitImage' in kerneltypes.split(): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 6 | depends = d.getVar("DEPENDS") |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 7 | depends = "%s u-boot-tools-native dtc-native" % depends |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | d.setVar("DEPENDS", depends) |
| 9 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 10 | uarch = d.getVar("UBOOT_ARCH") |
| 11 | if uarch == "arm64": |
| 12 | replacementtype = "Image" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 13 | elif uarch == "riscv": |
| 14 | replacementtype = "Image" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 15 | elif uarch == "mips": |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | replacementtype = "vmlinuz.bin" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 17 | elif uarch == "x86": |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 18 | replacementtype = "bzImage" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 19 | elif uarch == "microblaze": |
| 20 | replacementtype = "linux.bin" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 21 | else: |
| 22 | replacementtype = "zImage" |
| 23 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 24 | # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal |
| 25 | # to kernel.bbclass . We have to override it, since we pack zImage |
| 26 | # (at least for now) into the fitImage . |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 27 | typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or "" |
He Zhe | fe76b1e | 2016-05-25 04:47:16 -0400 | [diff] [blame] | 28 | if 'fitImage' in typeformake.split(): |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 29 | d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype)) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 31 | image = d.getVar('INITRAMFS_IMAGE') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | if image: |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 33 | d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete') |
| 34 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 35 | #check if there are any dtb providers |
| 36 | providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") |
| 37 | if providerdtb: |
| 38 | d.appendVarFlag('do_assemble_fitimage', 'depends', ' virtual/dtb:do_populate_sysroot') |
| 39 | d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' virtual/dtb:do_populate_sysroot') |
| 40 | d.setVar('EXTERNAL_KERNEL_DEVICETREE', "${RECIPE_SYSROOT}/boot/devicetree") |
| 41 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 42 | # Verified boot will sign the fitImage and append the public key to |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 43 | # U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 44 | # the fitImage: |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 45 | if d.getVar('UBOOT_SIGN_ENABLE') == "1" and d.getVar('UBOOT_DTB_BINARY'): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 46 | uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot' |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 47 | d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_populate_sysroot' % uboot_pn) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | } |
| 49 | |
Yannick Gicquel | d5813b4 | 2016-04-27 16:20:55 +0200 | [diff] [blame] | 50 | # Options for the device tree compiler passed to mkimage '-D' feature: |
| 51 | UBOOT_MKIMAGE_DTCOPTS ??= "" |
| 52 | |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 53 | # fitImage Hash Algo |
| 54 | FIT_HASH_ALG ?= "sha256" |
| 55 | |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 56 | # fitImage Signature Algo |
| 57 | FIT_SIGN_ALG ?= "rsa2048" |
| 58 | |
Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 59 | # Generate keys for signing fitImage |
| 60 | FIT_GENERATE_KEYS ?= "0" |
| 61 | |
| 62 | # Size of private key in number of bits |
| 63 | FIT_SIGN_NUMBITS ?= "2048" |
| 64 | |
| 65 | # args to openssl genrsa (Default is just the public exponent) |
| 66 | FIT_KEY_GENRSA_ARGS ?= "-F4" |
| 67 | |
| 68 | # args to openssl req (Default is -batch for non interactive mode and |
| 69 | # -new for new certificate) |
| 70 | FIT_KEY_REQ_ARGS ?= "-batch -new" |
| 71 | |
| 72 | # Standard format for public key certificate |
| 73 | FIT_KEY_SIGN_PKCS ?= "-x509" |
| 74 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | # |
| 76 | # Emit the fitImage ITS header |
| 77 | # |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 78 | # $1 ... .its filename |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 79 | fitimage_emit_fit_header() { |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 80 | cat << EOF >> ${1} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | /dts-v1/; |
| 82 | |
| 83 | / { |
| 84 | description = "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}"; |
| 85 | #address-cells = <1>; |
| 86 | EOF |
| 87 | } |
| 88 | |
| 89 | # |
| 90 | # Emit the fitImage section bits |
| 91 | # |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 92 | # $1 ... .its filename |
| 93 | # $2 ... Section bit type: imagestart - image section start |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 94 | # confstart - configuration section start |
| 95 | # sectend - section end |
| 96 | # fitend - fitimage end |
| 97 | # |
| 98 | fitimage_emit_section_maint() { |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 99 | case $2 in |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 100 | imagestart) |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 101 | cat << EOF >> ${1} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 102 | |
| 103 | images { |
| 104 | EOF |
| 105 | ;; |
| 106 | confstart) |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 107 | cat << EOF >> ${1} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 108 | |
| 109 | configurations { |
| 110 | EOF |
| 111 | ;; |
| 112 | sectend) |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 113 | cat << EOF >> ${1} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 114 | }; |
| 115 | EOF |
| 116 | ;; |
| 117 | fitend) |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 118 | cat << EOF >> ${1} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 119 | }; |
| 120 | EOF |
| 121 | ;; |
| 122 | esac |
| 123 | } |
| 124 | |
| 125 | # |
| 126 | # Emit the fitImage ITS kernel section |
| 127 | # |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 128 | # $1 ... .its filename |
| 129 | # $2 ... Image counter |
| 130 | # $3 ... Path to kernel image |
| 131 | # $4 ... Compression type |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 132 | fitimage_emit_section_kernel() { |
| 133 | |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 134 | kernel_csum="${FIT_HASH_ALG}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 135 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 136 | ENTRYPOINT="${UBOOT_ENTRYPOINT}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 137 | if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then |
| 138 | ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \ |
| 139 | awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 140 | fi |
| 141 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 142 | cat << EOF >> ${1} |
| 143 | kernel@${2} { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 144 | description = "Linux kernel"; |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 145 | data = /incbin/("${3}"); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 146 | type = "kernel"; |
| 147 | arch = "${UBOOT_ARCH}"; |
| 148 | os = "linux"; |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 149 | compression = "${4}"; |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 150 | load = <${UBOOT_LOADADDRESS}>; |
| 151 | entry = <${ENTRYPOINT}>; |
| 152 | hash@1 { |
| 153 | algo = "${kernel_csum}"; |
| 154 | }; |
| 155 | }; |
| 156 | EOF |
| 157 | } |
| 158 | |
| 159 | # |
| 160 | # Emit the fitImage ITS DTB section |
| 161 | # |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 162 | # $1 ... .its filename |
| 163 | # $2 ... Image counter |
| 164 | # $3 ... Path to DTB image |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 165 | fitimage_emit_section_dtb() { |
| 166 | |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 167 | dtb_csum="${FIT_HASH_ALG}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 168 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 169 | dtb_loadline="" |
| 170 | dtb_ext=${DTB##*.} |
| 171 | if [ "${dtb_ext}" = "dtbo" ]; then |
| 172 | if [ -n "${UBOOT_DTBO_LOADADDRESS}" ]; then |
| 173 | dtb_loadline="load = <${UBOOT_DTBO_LOADADDRESS}>;" |
| 174 | fi |
| 175 | elif [ -n "${UBOOT_DTB_LOADADDRESS}" ]; then |
| 176 | dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;" |
| 177 | fi |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 178 | cat << EOF >> ${1} |
| 179 | fdt@${2} { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 180 | description = "Flattened Device Tree blob"; |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 181 | data = /incbin/("${3}"); |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 182 | type = "flat_dt"; |
| 183 | arch = "${UBOOT_ARCH}"; |
| 184 | compression = "none"; |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 185 | ${dtb_loadline} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 186 | hash@1 { |
| 187 | algo = "${dtb_csum}"; |
| 188 | }; |
| 189 | }; |
| 190 | EOF |
| 191 | } |
| 192 | |
| 193 | # |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 194 | # Emit the fitImage ITS setup section |
| 195 | # |
| 196 | # $1 ... .its filename |
| 197 | # $2 ... Image counter |
| 198 | # $3 ... Path to setup image |
| 199 | fitimage_emit_section_setup() { |
| 200 | |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 201 | setup_csum="${FIT_HASH_ALG}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 202 | |
| 203 | cat << EOF >> ${1} |
| 204 | setup@${2} { |
| 205 | description = "Linux setup.bin"; |
| 206 | data = /incbin/("${3}"); |
| 207 | type = "x86_setup"; |
| 208 | arch = "${UBOOT_ARCH}"; |
| 209 | os = "linux"; |
| 210 | compression = "none"; |
| 211 | load = <0x00090000>; |
| 212 | entry = <0x00090000>; |
| 213 | hash@1 { |
| 214 | algo = "${setup_csum}"; |
| 215 | }; |
| 216 | }; |
| 217 | EOF |
| 218 | } |
| 219 | |
| 220 | # |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 221 | # Emit the fitImage ITS ramdisk section |
| 222 | # |
| 223 | # $1 ... .its filename |
| 224 | # $2 ... Image counter |
| 225 | # $3 ... Path to ramdisk image |
| 226 | fitimage_emit_section_ramdisk() { |
| 227 | |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 228 | ramdisk_csum="${FIT_HASH_ALG}" |
Nathan Rossi | b4a4dc0 | 2016-10-21 22:07:27 +1000 | [diff] [blame] | 229 | ramdisk_loadline="" |
| 230 | ramdisk_entryline="" |
| 231 | |
| 232 | if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then |
| 233 | ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;" |
| 234 | fi |
| 235 | if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then |
| 236 | ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;" |
| 237 | fi |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 238 | |
| 239 | cat << EOF >> ${1} |
| 240 | ramdisk@${2} { |
Rick Altherr | bc1b880 | 2017-01-20 11:28:53 -0800 | [diff] [blame] | 241 | description = "${INITRAMFS_IMAGE}"; |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 242 | data = /incbin/("${3}"); |
| 243 | type = "ramdisk"; |
| 244 | arch = "${UBOOT_ARCH}"; |
| 245 | os = "linux"; |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 246 | compression = "none"; |
Nathan Rossi | b4a4dc0 | 2016-10-21 22:07:27 +1000 | [diff] [blame] | 247 | ${ramdisk_loadline} |
| 248 | ${ramdisk_entryline} |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 249 | hash@1 { |
| 250 | algo = "${ramdisk_csum}"; |
| 251 | }; |
| 252 | }; |
| 253 | EOF |
| 254 | } |
| 255 | |
| 256 | # |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 257 | # Emit the fitImage ITS configuration section |
| 258 | # |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 259 | # $1 ... .its filename |
| 260 | # $2 ... Linux kernel ID |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 261 | # $3 ... DTB image name |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 262 | # $4 ... ramdisk ID |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 263 | # $5 ... config ID |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 264 | # $6 ... default flag |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 265 | fitimage_emit_section_config() { |
| 266 | |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 267 | conf_csum="${FIT_HASH_ALG}" |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 268 | conf_sign_algo="${FIT_SIGN_ALG}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 269 | if [ -n "${UBOOT_SIGN_ENABLE}" ] ; then |
| 270 | conf_sign_keyname="${UBOOT_SIGN_KEYNAME}" |
| 271 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 272 | |
| 273 | # Test if we have any DTBs at all |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 274 | sep="" |
| 275 | conf_desc="" |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 276 | conf_node="conf@" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 277 | kernel_line="" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 278 | fdt_line="" |
| 279 | ramdisk_line="" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 280 | setup_line="" |
| 281 | default_line="" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 282 | |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 283 | # conf node name is selected based on dtb ID if it is present, |
| 284 | # otherwise its selected based on kernel ID |
| 285 | if [ -n "${3}" ]; then |
| 286 | conf_node=$conf_node${3} |
| 287 | else |
| 288 | conf_node=$conf_node${2} |
| 289 | fi |
| 290 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 291 | if [ -n "${2}" ]; then |
| 292 | conf_desc="Linux kernel" |
| 293 | sep=", " |
| 294 | kernel_line="kernel = \"kernel@${2}\";" |
| 295 | fi |
| 296 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 297 | if [ -n "${3}" ]; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 298 | conf_desc="${conf_desc}${sep}FDT blob" |
| 299 | sep=", " |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 300 | fdt_line="fdt = \"fdt@${3}\";" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 301 | fi |
| 302 | |
| 303 | if [ -n "${4}" ]; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 304 | conf_desc="${conf_desc}${sep}ramdisk" |
| 305 | sep=", " |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 306 | ramdisk_line="ramdisk = \"ramdisk@${4}\";" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 307 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 308 | |
| 309 | if [ -n "${5}" ]; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 310 | conf_desc="${conf_desc}${sep}setup" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 311 | setup_line="setup = \"setup@${5}\";" |
| 312 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 313 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 314 | if [ "${6}" = "1" ]; then |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 315 | # default node is selected based on dtb ID if it is present, |
| 316 | # otherwise its selected based on kernel ID |
| 317 | if [ -n "${3}" ]; then |
| 318 | default_line="default = \"conf@${3}\";" |
| 319 | else |
| 320 | default_line="default = \"conf@${2}\";" |
| 321 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 322 | fi |
| 323 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 324 | cat << EOF >> ${1} |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 325 | ${default_line} |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 326 | $conf_node { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 327 | description = "${6} ${conf_desc}"; |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 328 | ${kernel_line} |
| 329 | ${fdt_line} |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 330 | ${ramdisk_line} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 331 | ${setup_line} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 332 | hash@1 { |
| 333 | algo = "${conf_csum}"; |
| 334 | }; |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 335 | EOF |
| 336 | |
| 337 | if [ ! -z "${conf_sign_keyname}" ] ; then |
| 338 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 339 | sign_line="sign-images = " |
| 340 | sep="" |
| 341 | |
| 342 | if [ -n "${2}" ]; then |
| 343 | sign_line="${sign_line}${sep}\"kernel\"" |
| 344 | sep=", " |
| 345 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 346 | |
| 347 | if [ -n "${3}" ]; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 348 | sign_line="${sign_line}${sep}\"fdt\"" |
| 349 | sep=", " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 350 | fi |
| 351 | |
| 352 | if [ -n "${4}" ]; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 353 | sign_line="${sign_line}${sep}\"ramdisk\"" |
| 354 | sep=", " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 355 | fi |
| 356 | |
| 357 | if [ -n "${5}" ]; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 358 | sign_line="${sign_line}${sep}\"setup\"" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 359 | fi |
| 360 | |
| 361 | sign_line="${sign_line};" |
| 362 | |
| 363 | cat << EOF >> ${1} |
| 364 | signature@1 { |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 365 | algo = "${conf_csum},${conf_sign_algo}"; |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 366 | key-name-hint = "${conf_sign_keyname}"; |
| 367 | ${sign_line} |
| 368 | }; |
| 369 | EOF |
| 370 | fi |
| 371 | |
| 372 | cat << EOF >> ${1} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 373 | }; |
| 374 | EOF |
| 375 | } |
| 376 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 377 | # |
| 378 | # Assemble fitImage |
| 379 | # |
| 380 | # $1 ... .its filename |
| 381 | # $2 ... fitImage name |
| 382 | # $3 ... include ramdisk |
| 383 | fitimage_assemble() { |
| 384 | kernelcount=1 |
| 385 | dtbcount="" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 386 | DTBS="" |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 387 | ramdiskcount=${3} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 388 | setupcount="" |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 389 | rm -f ${1} arch/${ARCH}/boot/${2} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 390 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 391 | fitimage_emit_fit_header ${1} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 392 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 393 | # |
| 394 | # Step 1: Prepare a kernel image section. |
| 395 | # |
| 396 | fitimage_emit_section_maint ${1} imagestart |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 397 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 398 | uboot_prep_kimage |
| 399 | fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 400 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 401 | # |
| 402 | # Step 2: Prepare a DTB image section |
| 403 | # |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 404 | |
| 405 | if [ -z "${EXTERNAL_KERNEL_DEVICETREE}" ] && [ -n "${KERNEL_DEVICETREE}" ]; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 406 | dtbcount=1 |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 407 | for DTB in ${KERNEL_DEVICETREE}; do |
| 408 | if echo ${DTB} | grep -q '/dts/'; then |
| 409 | bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used." |
| 410 | DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'` |
| 411 | fi |
| 412 | DTB_PATH="arch/${ARCH}/boot/dts/${DTB}" |
| 413 | if [ ! -e "${DTB_PATH}" ]; then |
| 414 | DTB_PATH="arch/${ARCH}/boot/${DTB}" |
| 415 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 416 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 417 | DTB=$(echo "${DTB}" | tr '/' '_') |
| 418 | DTBS="${DTBS} ${DTB}" |
| 419 | fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH} |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 420 | done |
| 421 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 422 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 423 | if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then |
| 424 | dtbcount=1 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 425 | for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 426 | DTB=$(echo "${DTB}" | tr '/' '_') |
| 427 | DTBS="${DTBS} ${DTB}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 428 | fitimage_emit_section_dtb ${1} ${DTB} "${EXTERNAL_KERNEL_DEVICETREE}/${DTB}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 429 | done |
| 430 | fi |
| 431 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 432 | # |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 433 | # Step 3: Prepare a setup section. (For x86) |
| 434 | # |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 435 | if [ -e arch/${ARCH}/boot/setup.bin ]; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 436 | setupcount=1 |
| 437 | fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin |
| 438 | fi |
| 439 | |
| 440 | # |
| 441 | # Step 4: Prepare a ramdisk section. |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 442 | # |
| 443 | if [ "x${ramdiskcount}" = "x1" ] ; then |
Rick Altherr | bc1b880 | 2017-01-20 11:28:53 -0800 | [diff] [blame] | 444 | # Find and use the first initramfs image archive type we find |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 445 | for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz ext2.gz cpio; do |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 446 | initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}" |
Rick Altherr | bc1b880 | 2017-01-20 11:28:53 -0800 | [diff] [blame] | 447 | echo "Using $initramfs_path" |
| 448 | if [ -e "${initramfs_path}" ]; then |
| 449 | fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}" |
| 450 | break |
| 451 | fi |
| 452 | done |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 453 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 454 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 455 | fitimage_emit_section_maint ${1} sectend |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 456 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 457 | # Force the first Kernel and DTB in the default config |
| 458 | kernelcount=1 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 459 | if [ -n "${dtbcount}" ]; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 460 | dtbcount=1 |
| 461 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 462 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 463 | # |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 464 | # Step 5: Prepare a configurations section |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 465 | # |
| 466 | fitimage_emit_section_maint ${1} confstart |
| 467 | |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 468 | # kernel-fitimage.bbclass currently only supports a single kernel (no less or |
| 469 | # more) to be added to the FIT image along with 0 or more device trees and |
| 470 | # 0 or 1 ramdisk. |
| 471 | # If a device tree is to be part of the FIT image, then select |
| 472 | # the default configuration to be used is based on the dtbcount. If there is |
| 473 | # no dtb present than select the default configuation to be based on |
| 474 | # the kernelcount. |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 475 | if [ -n "${DTBS}" ]; then |
| 476 | i=1 |
| 477 | for DTB in ${DTBS}; do |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 478 | dtb_ext=${DTB##*.} |
| 479 | if [ "${dtb_ext}" = "dtbo" ]; then |
| 480 | fitimage_emit_section_config ${1} "" "${DTB}" "" "" "`expr ${i} = ${dtbcount}`" |
| 481 | else |
| 482 | fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`" |
| 483 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 484 | i=`expr ${i} + 1` |
| 485 | done |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 486 | else |
| 487 | defaultconfigcount=1 |
| 488 | fitimage_emit_section_config ${1} "${kernelcount}" "" "${ramdiskcount}" "${setupcount}" "${defaultconfigcount}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 489 | fi |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 490 | |
| 491 | fitimage_emit_section_maint ${1} sectend |
| 492 | |
| 493 | fitimage_emit_section_maint ${1} fitend |
| 494 | |
| 495 | # |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 496 | # Step 6: Assemble the image |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 497 | # |
| 498 | uboot-mkimage \ |
| 499 | ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ |
| 500 | -f ${1} \ |
| 501 | arch/${ARCH}/boot/${2} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 502 | |
| 503 | # |
| 504 | # Step 7: Sign the image and add public key to U-Boot dtb |
| 505 | # |
| 506 | if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 507 | add_key_to_u_boot="" |
| 508 | if [ -n "${UBOOT_DTB_BINARY}" ]; then |
| 509 | # The u-boot.dtb is a symlink to UBOOT_DTB_IMAGE, so we need copy |
| 510 | # both of them, and don't dereference the symlink. |
| 511 | cp -P ${STAGING_DATADIR}/u-boot*.dtb ${B} |
| 512 | add_key_to_u_boot="-K ${B}/${UBOOT_DTB_BINARY}" |
| 513 | fi |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 514 | uboot-mkimage \ |
| 515 | ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ |
| 516 | -F -k "${UBOOT_SIGN_KEYDIR}" \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 517 | $add_key_to_u_boot \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 518 | -r arch/${ARCH}/boot/${2} |
| 519 | fi |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 520 | } |
| 521 | |
| 522 | do_assemble_fitimage() { |
| 523 | if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then |
| 524 | cd ${B} |
| 525 | fitimage_assemble fit-image.its fitImage |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 526 | fi |
| 527 | } |
| 528 | |
| 529 | addtask assemble_fitimage before do_install after do_compile |
| 530 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 531 | do_assemble_fitimage_initramfs() { |
| 532 | if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \ |
| 533 | test -n "${INITRAMFS_IMAGE}" ; then |
| 534 | cd ${B} |
| 535 | fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1 |
| 536 | fi |
| 537 | } |
| 538 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 539 | addtask assemble_fitimage_initramfs before do_deploy after do_bundle_initramfs |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 540 | |
Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 541 | do_generate_rsa_keys() { |
| 542 | if [ "${UBOOT_SIGN_ENABLE}" = "0" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then |
| 543 | bbwarn "FIT_GENERATE_KEYS is set to 1 eventhough UBOOT_SIGN_ENABLE is set to 0. The keys will not be generated as they won't be used." |
| 544 | fi |
| 545 | |
| 546 | if [ "${UBOOT_SIGN_ENABLE}" = "1" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then |
| 547 | |
| 548 | # Generate keys only if they don't already exist |
| 549 | if [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key ] || \ |
| 550 | [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt]; then |
| 551 | |
| 552 | # make directory if it does not already exist |
| 553 | mkdir -p "${UBOOT_SIGN_KEYDIR}" |
| 554 | |
| 555 | echo "Generating RSA private key for signing fitImage" |
| 556 | openssl genrsa ${FIT_KEY_GENRSA_ARGS} -out \ |
| 557 | "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key \ |
| 558 | "${FIT_SIGN_NUMBITS}" |
| 559 | |
| 560 | echo "Generating certificate for signing fitImage" |
| 561 | openssl req ${FIT_KEY_REQ_ARGS} "${FIT_KEY_SIGN_PKCS}" \ |
| 562 | -key "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key \ |
| 563 | -out "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt |
| 564 | fi |
| 565 | fi |
| 566 | } |
| 567 | |
| 568 | addtask generate_rsa_keys before do_assemble_fitimage after do_compile |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 569 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 570 | kernel_do_deploy[vardepsexclude] = "DATETIME" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 571 | kernel_do_deploy_append() { |
| 572 | # Update deploy directory |
He Zhe | fe76b1e | 2016-05-25 04:47:16 -0400 | [diff] [blame] | 573 | if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 574 | echo "Copying fit-image.its source file..." |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 575 | install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its" |
| 576 | ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 577 | |
| 578 | echo "Copying linux.bin file..." |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 579 | install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}.bin |
| 580 | ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 581 | |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 582 | if [ -n "${INITRAMFS_IMAGE}" ]; then |
| 583 | echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 584 | install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" |
| 585 | ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 586 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 587 | echo "Copying fitImage-${INITRAMFS_IMAGE} file..." |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 588 | install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin" |
| 589 | ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" |
George McCollister | 185c8ae | 2016-05-26 08:55:16 -0500 | [diff] [blame] | 590 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 591 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a -n "${UBOOT_DTB_BINARY}" ] ; then |
| 592 | # UBOOT_DTB_IMAGE is a realfile, but we can't use |
| 593 | # ${UBOOT_DTB_IMAGE} since it contains ${PV} which is aimed |
| 594 | # for u-boot, but we are in kernel env now. |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 595 | install -m 0644 ${B}/u-boot-${MACHINE}*.dtb "$deployDir/" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 596 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 597 | fi |
| 598 | } |