Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 1 | inherit uboot-config |
| 2 | |
| 3 | CONVERSIONTYPES += "fitImage" |
| 4 | |
Patrick Williams | 1dc6b4a | 2023-08-04 10:41:33 -0500 | [diff] [blame] | 5 | CONVERSION_CMD:fitImage = "run_assemble_fitimage ${IMAGE_NAME}.${type}" |
| 6 | INITRAMFS_IMAGE="${IMAGE_NAME}.cpio.${INITRAMFS_CTYPE}" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 7 | KERNEL_OUTPUT_DIR="${DEPLOY_DIR_IMAGE}" |
| 8 | |
Tim Lee | 650d9dc | 2024-01-30 13:45:33 +0800 | [diff] [blame] | 9 | FIT_KERNEL_COMP_ALG ?= "none" |
| 10 | FIT_KERNEL_COMP_ALG_EXTENSION ?= "" |
| 11 | |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 12 | do_image_cpio[depends] += "virtual/kernel:do_deploy" |
| 13 | |
| 14 | run_assemble_fitimage() { |
| 15 | export linux_comp="none" |
| 16 | fitimage_assemble $1.its $1.fitImage 1 |
| 17 | |
| 18 | # The fitimage_assemble puts the image into DEPLOY_DIR_NAME due to |
| 19 | # KERNEL_OUTPUT_DIR, but we really want it still in ${IMGDEPLOYDIR}, so |
| 20 | # move it. |
| 21 | mv ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}.fitImage . |
| 22 | # Delete the spurious linux.bin created by our stubbed uboot_prep_kimage. |
| 23 | rm linux.bin |
| 24 | } |
| 25 | |
| 26 | UBOOT_MKIMAGE_KERNEL_TYPE ?= "kernel" |
| 27 | uboot_prep_kimage() { |
| 28 | cp ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} linux.bin |
Tim Lee | 650d9dc | 2024-01-30 13:45:33 +0800 | [diff] [blame] | 29 | |
| 30 | if [ "${linux_comp}" != "none" ] ; then |
| 31 | linux_suffix="${FIT_KERNEL_COMP_ALG_EXTENSION}" |
| 32 | if [ "${linux_comp}" = "gzip" ] ; then |
| 33 | gzip -9 linux.bin |
| 34 | elif [ "${linux_comp}" = "lzo" ] ; then |
| 35 | lzop -9 linux.bin |
| 36 | fi |
| 37 | mv -f "linux.bin${linux_suffix}" linux.bin |
| 38 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | DEPENDS:append = " u-boot-tools-native dtc-native virtual/${TARGET_PREFIX}binutils" |
| 42 | |
| 43 | # Description string |
| 44 | FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" |
| 45 | |
| 46 | # Kernel fitImage Hash Algo |
| 47 | FIT_HASH_ALG ?= "sha256" |
| 48 | |
| 49 | # Kernel fitImage Signature Algo |
| 50 | FIT_SIGN_ALG ?= "rsa2048" |
| 51 | |
| 52 | # Kernel / U-Boot fitImage Padding Algo |
| 53 | FIT_PAD_ALG ?= "pkcs-1.5" |
| 54 | |
| 55 | # Generate keys for signing Kernel fitImage |
| 56 | FIT_GENERATE_KEYS ?= "0" |
| 57 | |
| 58 | # Size of private keys in number of bits |
| 59 | FIT_SIGN_NUMBITS ?= "2048" |
| 60 | |
| 61 | # args to openssl genrsa (Default is just the public exponent) |
| 62 | FIT_KEY_GENRSA_ARGS ?= "-F4" |
| 63 | |
| 64 | # args to openssl req (Default is -batch for non interactive mode and |
| 65 | # -new for new certificate) |
| 66 | FIT_KEY_REQ_ARGS ?= "-batch -new" |
| 67 | |
| 68 | # Standard format for public key certificate |
| 69 | FIT_KEY_SIGN_PKCS ?= "-x509" |
| 70 | |
| 71 | # Sign individual images as well |
| 72 | FIT_SIGN_INDIVIDUAL ?= "0" |
| 73 | |
| 74 | FIT_CONF_PREFIX ?= "conf-" |
| 75 | FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name" |
| 76 | |
| 77 | FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio" |
| 78 | |
| 79 | # |
| 80 | # Emit the fitImage ITS header |
| 81 | # |
| 82 | # $1 ... .its filename |
| 83 | fitimage_emit_fit_header() { |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 84 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 85 | /dts-v1/; |
| 86 | |
| 87 | / { |
| 88 | description = "${FIT_DESC}"; |
| 89 | #address-cells = <1>; |
| 90 | EOF |
| 91 | } |
| 92 | |
| 93 | # |
| 94 | # Emit the fitImage section bits |
| 95 | # |
| 96 | # $1 ... .its filename |
| 97 | # $2 ... Section bit type: imagestart - image section start |
| 98 | # confstart - configuration section start |
| 99 | # sectend - section end |
| 100 | # fitend - fitimage end |
| 101 | # |
| 102 | fitimage_emit_section_maint() { |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 103 | case $2 in |
| 104 | imagestart) |
| 105 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 106 | |
| 107 | images { |
| 108 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 109 | ;; |
| 110 | confstart) |
| 111 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 112 | |
| 113 | configurations { |
| 114 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 115 | ;; |
| 116 | sectend) |
| 117 | cat << EOF >> $1 |
| 118 | }; |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 119 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 120 | ;; |
| 121 | fitend) |
| 122 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 123 | }; |
| 124 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 125 | ;; |
| 126 | esac |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | |
| 130 | # |
| 131 | # Emit the fitImage ITS kernel section |
| 132 | # |
| 133 | # $1 ... .its filename |
| 134 | # $2 ... Image counter |
| 135 | # $3 ... Path to kernel image |
| 136 | # $4 ... Compression type |
| 137 | fitimage_emit_section_kernel() { |
| 138 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 139 | kernel_csum="${FIT_HASH_ALG}" |
| 140 | kernel_sign_algo="${FIT_SIGN_ALG}" |
| 141 | kernel_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 142 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 143 | ENTRYPOINT="${UBOOT_ENTRYPOINT}" |
| 144 | if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then |
| 145 | ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \ |
| 146 | awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` |
| 147 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 148 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 149 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 150 | kernel-$2 { |
| 151 | description = "Linux kernel"; |
| 152 | data = /incbin/("$3"); |
| 153 | type = "${UBOOT_MKIMAGE_KERNEL_TYPE}"; |
| 154 | arch = "${UBOOT_ARCH}"; |
| 155 | os = "linux"; |
| 156 | compression = "$4"; |
| 157 | load = <${UBOOT_LOADADDRESS}>; |
| 158 | entry = <$ENTRYPOINT>; |
| 159 | hash-1 { |
| 160 | algo = "$kernel_csum"; |
| 161 | }; |
| 162 | }; |
| 163 | EOF |
| 164 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 165 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$kernel_sign_keyname" ] ; then |
| 166 | sed -i '$ d' $1 |
| 167 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 168 | signature-1 { |
| 169 | algo = "$kernel_csum,$kernel_sign_algo"; |
| 170 | key-name-hint = "$kernel_sign_keyname"; |
| 171 | }; |
| 172 | }; |
| 173 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 174 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | # |
| 178 | # Emit the fitImage ITS DTB section |
| 179 | # |
| 180 | # $1 ... .its filename |
| 181 | # $2 ... Image counter |
| 182 | # $3 ... Path to DTB image |
| 183 | fitimage_emit_section_dtb() { |
| 184 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 185 | dtb_csum="${FIT_HASH_ALG}" |
| 186 | dtb_sign_algo="${FIT_SIGN_ALG}" |
| 187 | dtb_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 188 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 189 | dtb_loadline="" |
| 190 | dtb_ext=${DTB##*.} |
| 191 | if [ "${dtb_ext}" = "dtbo" ]; then |
| 192 | if [ -n "${UBOOT_DTBO_LOADADDRESS}" ]; then |
| 193 | dtb_loadline="load = <${UBOOT_DTBO_LOADADDRESS}>;" |
| 194 | fi |
| 195 | elif [ -n "${UBOOT_DTB_LOADADDRESS}" ]; then |
| 196 | dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;" |
| 197 | fi |
| 198 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 199 | fdt-$2 { |
| 200 | description = "Flattened Device Tree blob"; |
| 201 | data = /incbin/("$3"); |
| 202 | type = "flat_dt"; |
| 203 | arch = "${UBOOT_ARCH}"; |
| 204 | compression = "none"; |
| 205 | $dtb_loadline |
| 206 | hash-1 { |
| 207 | algo = "$dtb_csum"; |
| 208 | }; |
| 209 | }; |
| 210 | EOF |
| 211 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 212 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$dtb_sign_keyname" ] ; then |
| 213 | sed -i '$ d' $1 |
| 214 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 215 | signature-1 { |
| 216 | algo = "$dtb_csum,$dtb_sign_algo"; |
| 217 | key-name-hint = "$dtb_sign_keyname"; |
| 218 | }; |
| 219 | }; |
| 220 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 221 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | # |
| 225 | # Emit the fitImage ITS u-boot script section |
| 226 | # |
| 227 | # $1 ... .its filename |
| 228 | # $2 ... Image counter |
| 229 | # $3 ... Path to boot script image |
| 230 | fitimage_emit_section_boot_script() { |
| 231 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 232 | bootscr_csum="${FIT_HASH_ALG}" |
| 233 | bootscr_sign_algo="${FIT_SIGN_ALG}" |
| 234 | bootscr_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 235 | |
| 236 | cat << EOF >> $1 |
| 237 | bootscr-$2 { |
| 238 | description = "U-boot script"; |
| 239 | data = /incbin/("$3"); |
| 240 | type = "script"; |
| 241 | arch = "${UBOOT_ARCH}"; |
| 242 | compression = "none"; |
| 243 | hash-1 { |
| 244 | algo = "$bootscr_csum"; |
| 245 | }; |
| 246 | }; |
| 247 | EOF |
| 248 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 249 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$bootscr_sign_keyname" ] ; then |
| 250 | sed -i '$ d' $1 |
| 251 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 252 | signature-1 { |
| 253 | algo = "$bootscr_csum,$bootscr_sign_algo"; |
| 254 | key-name-hint = "$bootscr_sign_keyname"; |
| 255 | }; |
| 256 | }; |
| 257 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 258 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | # |
| 262 | # Emit the fitImage ITS setup section |
| 263 | # |
| 264 | # $1 ... .its filename |
| 265 | # $2 ... Image counter |
| 266 | # $3 ... Path to setup image |
| 267 | fitimage_emit_section_setup() { |
| 268 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 269 | setup_csum="${FIT_HASH_ALG}" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 270 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 271 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 272 | setup-$2 { |
| 273 | description = "Linux setup.bin"; |
| 274 | data = /incbin/("$3"); |
| 275 | type = "x86_setup"; |
| 276 | arch = "${UBOOT_ARCH}"; |
| 277 | os = "linux"; |
| 278 | compression = "none"; |
| 279 | load = <0x00090000>; |
| 280 | entry = <0x00090000>; |
| 281 | hash-1 { |
| 282 | algo = "$setup_csum"; |
| 283 | }; |
| 284 | }; |
| 285 | EOF |
| 286 | } |
| 287 | |
| 288 | # |
| 289 | # Emit the fitImage ITS ramdisk section |
| 290 | # |
| 291 | # $1 ... .its filename |
| 292 | # $2 ... Image counter |
| 293 | # $3 ... Path to ramdisk image |
| 294 | fitimage_emit_section_ramdisk() { |
| 295 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 296 | ramdisk_csum="${FIT_HASH_ALG}" |
| 297 | ramdisk_sign_algo="${FIT_SIGN_ALG}" |
| 298 | ramdisk_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" |
| 299 | ramdisk_loadline="" |
| 300 | ramdisk_entryline="" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 301 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 302 | if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then |
| 303 | ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;" |
| 304 | fi |
| 305 | if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then |
| 306 | ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;" |
| 307 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 308 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 309 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 310 | ramdisk-$2 { |
| 311 | description = "${INITRAMFS_IMAGE}"; |
| 312 | data = /incbin/("$3"); |
| 313 | type = "ramdisk"; |
| 314 | arch = "${UBOOT_ARCH}"; |
| 315 | os = "linux"; |
| 316 | compression = "none"; |
| 317 | $ramdisk_loadline |
| 318 | $ramdisk_entryline |
| 319 | hash-1 { |
| 320 | algo = "$ramdisk_csum"; |
| 321 | }; |
| 322 | }; |
| 323 | EOF |
| 324 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 325 | if [ "${UBOOT_SIGN_ENABLE}" = "1" -a "${FIT_SIGN_INDIVIDUAL}" = "1" -a -n "$ramdisk_sign_keyname" ] ; then |
| 326 | sed -i '$ d' $1 |
| 327 | cat << EOF >> $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 328 | signature-1 { |
| 329 | algo = "$ramdisk_csum,$ramdisk_sign_algo"; |
| 330 | key-name-hint = "$ramdisk_sign_keyname"; |
| 331 | }; |
| 332 | }; |
| 333 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 334 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 335 | } |
| 336 | |
| 337 | # |
| 338 | # echoes symlink destination if it points below directory |
| 339 | # |
| 340 | # $1 ... file that's a potential symlink |
| 341 | # $2 ... expected parent directory |
| 342 | symlink_points_below() { |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 343 | file="$2/$1" |
| 344 | dir=$2 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 345 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 346 | if ! [ -L "$file" ]; then |
| 347 | return |
| 348 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 349 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 350 | realpath="$(realpath --relative-to=$dir $file)" |
| 351 | if [ -z "${realpath%%../*}" ]; then |
| 352 | return |
| 353 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 354 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 355 | echo "$realpath" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 356 | } |
| 357 | |
| 358 | # |
| 359 | # Emit the fitImage ITS configuration section |
| 360 | # |
| 361 | # $1 ... .its filename |
| 362 | # $2 ... Linux kernel ID |
| 363 | # $3 ... DTB image name |
| 364 | # $4 ... ramdisk ID |
| 365 | # $5 ... u-boot script ID |
| 366 | # $6 ... config ID |
| 367 | # $7 ... default flag |
| 368 | fitimage_emit_section_config() { |
| 369 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 370 | conf_csum="${FIT_HASH_ALG}" |
| 371 | conf_sign_algo="${FIT_SIGN_ALG}" |
| 372 | conf_padding_algo="${FIT_PAD_ALG}" |
| 373 | if [ "${UBOOT_SIGN_ENABLE}" = "1" ] ; then |
| 374 | conf_sign_keyname="${UBOOT_SIGN_KEYNAME}" |
| 375 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 376 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 377 | its_file="$1" |
| 378 | kernel_id="$2" |
| 379 | dtb_image="$3" |
| 380 | ramdisk_id="$4" |
| 381 | bootscr_id="$5" |
| 382 | config_id="$6" |
| 383 | default_flag="$7" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 384 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 385 | # Test if we have any DTBs at all |
| 386 | sep="" |
| 387 | conf_desc="" |
| 388 | conf_node="${FIT_CONF_PREFIX}" |
| 389 | kernel_line="" |
| 390 | fdt_line="" |
| 391 | ramdisk_line="" |
| 392 | bootscr_line="" |
| 393 | setup_line="" |
| 394 | default_line="" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 395 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 396 | dtb_image_sect=$(symlink_points_below $dtb_image "${EXTERNAL_KERNEL_DEVICETREE}") |
| 397 | if [ -z "$dtb_image_sect" ]; then |
| 398 | dtb_image_sect=$dtb_image |
| 399 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 400 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 401 | dtb_image=$(echo $dtb_image | tr '/' '_') |
| 402 | dtb_image_sect=$(echo "${dtb_image_sect}" | tr '/' '_') |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 403 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 404 | # conf node name is selected based on dtb ID if it is present, |
| 405 | # otherwise its selected based on kernel ID |
| 406 | if [ -n "$dtb_image" ]; then |
| 407 | conf_node=$conf_node$dtb_image |
| 408 | else |
| 409 | conf_node=$conf_node$kernel_id |
| 410 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 411 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 412 | if [ -n "$kernel_id" ]; then |
| 413 | conf_desc="Linux kernel" |
| 414 | sep=", " |
| 415 | kernel_line="kernel = \"kernel-$kernel_id\";" |
| 416 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 417 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 418 | if [ -n "$dtb_image" ]; then |
| 419 | conf_desc="$conf_desc${sep}FDT blob" |
| 420 | sep=", " |
| 421 | fdt_line="fdt = \"fdt-$dtb_image_sect\";" |
| 422 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 423 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 424 | if [ -n "$ramdisk_id" ]; then |
| 425 | conf_desc="$conf_desc${sep}ramdisk" |
| 426 | sep=", " |
| 427 | ramdisk_line="ramdisk = \"ramdisk-$ramdisk_id\";" |
| 428 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 429 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 430 | if [ -n "$bootscr_id" ]; then |
| 431 | conf_desc="$conf_desc${sep}u-boot script" |
| 432 | sep=", " |
| 433 | bootscr_line="bootscr = \"bootscr-$bootscr_id\";" |
| 434 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 435 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 436 | if [ -n "$config_id" ]; then |
| 437 | conf_desc="$conf_desc${sep}setup" |
| 438 | setup_line="setup = \"setup-$config_id\";" |
| 439 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 440 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 441 | if [ "$default_flag" = "1" ]; then |
| 442 | # default node is selected based on dtb ID if it is present, |
| 443 | # otherwise its selected based on kernel ID |
| 444 | if [ -n "$dtb_image" ]; then |
| 445 | default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";" |
| 446 | else |
| 447 | default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";" |
| 448 | fi |
| 449 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 450 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 451 | cat << EOF >> $its_file |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 452 | $default_line |
| 453 | $conf_node { |
| 454 | description = "$default_flag $conf_desc"; |
| 455 | $kernel_line |
| 456 | $fdt_line |
| 457 | $ramdisk_line |
| 458 | $bootscr_line |
| 459 | $setup_line |
| 460 | hash-1 { |
| 461 | algo = "$conf_csum"; |
| 462 | }; |
| 463 | EOF |
| 464 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 465 | if [ -n "$conf_sign_keyname" ] ; then |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 466 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 467 | sign_line="sign-images = " |
| 468 | sep="" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 469 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 470 | if [ -n "$kernel_id" ]; then |
| 471 | sign_line="$sign_line${sep}\"kernel\"" |
| 472 | sep=", " |
| 473 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 474 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 475 | if [ -n "$dtb_image" ]; then |
| 476 | sign_line="$sign_line${sep}\"fdt\"" |
| 477 | sep=", " |
| 478 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 479 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 480 | if [ -n "$ramdisk_id" ]; then |
| 481 | sign_line="$sign_line${sep}\"ramdisk\"" |
| 482 | sep=", " |
| 483 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 484 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 485 | if [ -n "$bootscr_id" ]; then |
| 486 | sign_line="$sign_line${sep}\"bootscr\"" |
| 487 | sep=", " |
| 488 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 489 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 490 | if [ -n "$config_id" ]; then |
| 491 | sign_line="$sign_line${sep}\"setup\"" |
| 492 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 493 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 494 | sign_line="$sign_line;" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 495 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 496 | cat << EOF >> $its_file |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 497 | signature-1 { |
| 498 | algo = "$conf_csum,$conf_sign_algo"; |
| 499 | key-name-hint = "$conf_sign_keyname"; |
| 500 | padding = "$conf_padding_algo"; |
| 501 | $sign_line |
| 502 | }; |
| 503 | EOF |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 504 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 505 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 506 | cat << EOF >> $its_file |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 507 | }; |
| 508 | EOF |
| 509 | } |
| 510 | |
| 511 | # |
| 512 | # Assemble fitImage |
| 513 | # |
| 514 | # $1 ... .its filename |
| 515 | # $2 ... fitImage name |
| 516 | # $3 ... include ramdisk |
| 517 | fitimage_assemble() { |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 518 | kernelcount=1 |
| 519 | dtbcount="" |
| 520 | DTBS="" |
| 521 | ramdiskcount=$3 |
| 522 | setupcount="" |
| 523 | bootscr_id="" |
| 524 | rm -f $1 ${KERNEL_OUTPUT_DIR}/$2 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 525 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 526 | if [ -n "${UBOOT_SIGN_IMG_KEYNAME}" -a "${UBOOT_SIGN_KEYNAME}" = "${UBOOT_SIGN_IMG_KEYNAME}" ]; then |
| 527 | bbfatal "Keys used to sign images and configuration nodes must be different." |
| 528 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 529 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 530 | fitimage_emit_fit_header $1 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 531 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 532 | # |
| 533 | # Step 1: Prepare a kernel image section. |
| 534 | # |
| 535 | fitimage_emit_section_maint $1 imagestart |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 536 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 537 | uboot_prep_kimage |
| 538 | fitimage_emit_section_kernel $1 $kernelcount linux.bin "$linux_comp" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 539 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 540 | # |
| 541 | # Step 2: Prepare a DTB image section |
| 542 | # |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 543 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 544 | if [ -n "${KERNEL_DEVICETREE}" ]; then |
| 545 | dtbcount=1 |
| 546 | for DTB in ${KERNEL_DEVICETREE}; do |
| 547 | if echo $DTB | grep -q '/dts/'; then |
| 548 | bbwarn "$DTB contains the full path to the the dts file, but only the dtb name should be used." |
| 549 | DTB=`basename $DTB | sed 's,\.dts$,.dtb,g'` |
| 550 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 551 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 552 | # Skip ${DTB} if it's also provided in ${EXTERNAL_KERNEL_DEVICETREE} |
| 553 | if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ] && [ -s ${EXTERNAL_KERNEL_DEVICETREE}/${DTB} ]; then |
| 554 | continue |
| 555 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 556 | |
Andrew Geissler | 0cb5bb5 | 2023-09-14 08:37:27 -0400 | [diff] [blame] | 557 | # For non-vendored DTBs, we need to strip off the vendor path. |
| 558 | if "${@'false' if oe.types.boolean(d.getVar('KERNEL_DTBVENDORED')) else 'true'}"; then |
| 559 | DTB=`basename $DTB` |
| 560 | fi |
| 561 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 562 | DTB_PATH="${KERNEL_OUTPUT_DIR}/dts/$DTB" |
| 563 | if [ ! -e "$DTB_PATH" ]; then |
| 564 | DTB_PATH="${KERNEL_OUTPUT_DIR}/$DTB" |
| 565 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 566 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 567 | # Skip DTB if we've picked it up previously |
| 568 | echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 569 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 570 | DTBS="$DTBS $DTB" |
| 571 | DTB=$(echo $DTB | tr '/' '_') |
| 572 | fitimage_emit_section_dtb $1 $DTB $DTB_PATH |
| 573 | done |
| 574 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 575 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 576 | if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then |
| 577 | dtbcount=1 |
| 578 | for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do |
| 579 | # Skip DTB if we've picked it up previously |
| 580 | echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 581 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 582 | DTBS="$DTBS $DTB" |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 583 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 584 | # Also skip if a symlink. We'll later have each config section point at it |
| 585 | [ $(symlink_points_below $DTB "${EXTERNAL_KERNEL_DEVICETREE}") ] && continue |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 586 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 587 | DTB=$(echo $DTB | tr '/' '_') |
| 588 | fitimage_emit_section_dtb $1 $DTB "${EXTERNAL_KERNEL_DEVICETREE}/$DTB" |
| 589 | done |
| 590 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 591 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 592 | # |
| 593 | # Step 3: Prepare a u-boot script section |
| 594 | # |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 595 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 596 | if [ -n "${UBOOT_ENV}" ] && [ -d "${STAGING_DIR_HOST}/boot" ]; then |
| 597 | if [ -e "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY}" ]; then |
| 598 | cp ${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} ${B} |
| 599 | bootscr_id="${UBOOT_ENV_BINARY}" |
| 600 | fitimage_emit_section_boot_script $1 "$bootscr_id" ${UBOOT_ENV_BINARY} |
| 601 | else |
| 602 | bbwarn "${STAGING_DIR_HOST}/boot/${UBOOT_ENV_BINARY} not found." |
| 603 | fi |
| 604 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 605 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 606 | # |
| 607 | # Step 4: Prepare a setup section. (For x86) |
| 608 | # |
| 609 | if [ -e ${KERNEL_OUTPUT_DIR}/setup.bin ]; then |
| 610 | setupcount=1 |
| 611 | fitimage_emit_section_setup $1 $setupcount ${KERNEL_OUTPUT_DIR}/setup.bin |
| 612 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 613 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 614 | # |
| 615 | # Step 5: Prepare a ramdisk section. |
| 616 | # |
| 617 | if [ "x${ramdiskcount}" = "x1" ] && [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then |
| 618 | # Find and use the first initramfs image archive type we find |
| 619 | found= |
| 620 | for img in ${FIT_SUPPORTED_INITRAMFS_FSTYPES}; do |
| 621 | initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img" |
| 622 | if [ -e "$initramfs_path" ]; then |
| 623 | bbnote "Found initramfs image: $initramfs_path" |
| 624 | found=true |
| 625 | fitimage_emit_section_ramdisk $1 "$ramdiskcount" "$initramfs_path" |
| 626 | break |
| 627 | else |
| 628 | bbnote "Did not find initramfs image: $initramfs_path" |
| 629 | fi |
| 630 | done |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 631 | |
| 632 | if [ -z "$found" ] && [ -e ${INITRAMFS_IMAGE} ]; then |
| 633 | found=true |
| 634 | bbnote "Found initramfs image: ${INITRAMFS_IMAGE}" |
| 635 | fitimage_emit_section_ramdisk $1 "$ramdiskcount" "${INITRAMFS_IMAGE}" |
| 636 | fi |
| 637 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 638 | if [ -z "$found" ]; then |
| 639 | bbfatal "Could not find a valid initramfs type for ${INITRAMFS_IMAGE_NAME}, the supported types are: ${FIT_SUPPORTED_INITRAMFS_FSTYPES}" |
| 640 | fi |
| 641 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 642 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 643 | fitimage_emit_section_maint $1 sectend |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 644 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 645 | # Force the first Kernel and DTB in the default config |
| 646 | kernelcount=1 |
| 647 | if [ -n "$dtbcount" ]; then |
| 648 | dtbcount=1 |
| 649 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 650 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 651 | # |
| 652 | # Step 6: Prepare a configurations section |
| 653 | # |
| 654 | fitimage_emit_section_maint $1 confstart |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 655 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 656 | # kernel-fitimage.bbclass currently only supports a single kernel (no less or |
| 657 | # more) to be added to the FIT image along with 0 or more device trees and |
| 658 | # 0 or 1 ramdisk. |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 659 | # It is also possible to include an initramfs bundle (kernel and rootfs in one binary) |
| 660 | # When the initramfs bundle is used ramdisk is disabled. |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 661 | # If a device tree is to be part of the FIT image, then select |
| 662 | # the default configuration to be used is based on the dtbcount. If there is |
| 663 | # no dtb present than select the default configuation to be based on |
| 664 | # the kernelcount. |
| 665 | if [ -n "$DTBS" ]; then |
| 666 | i=1 |
| 667 | for DTB in ${DTBS}; do |
| 668 | dtb_ext=${DTB##*.} |
| 669 | if [ "$dtb_ext" = "dtbo" ]; then |
| 670 | fitimage_emit_section_config $1 "" "$DTB" "" "$bootscr_id" "" "`expr $i = $dtbcount`" |
| 671 | else |
| 672 | fitimage_emit_section_config $1 $kernelcount "$DTB" "$ramdiskcount" "$bootscr_id" "$setupcount" "`expr $i = $dtbcount`" |
| 673 | fi |
| 674 | i=`expr $i + 1` |
| 675 | done |
| 676 | else |
| 677 | defaultconfigcount=1 |
| 678 | fitimage_emit_section_config $1 $kernelcount "" "$ramdiskcount" "$bootscr_id" "$setupcount" $defaultconfigcount |
| 679 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 680 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 681 | fitimage_emit_section_maint $1 sectend |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 682 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 683 | fitimage_emit_section_maint $1 fitend |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 684 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 685 | # |
| 686 | # Step 7: Assemble the image |
| 687 | # |
| 688 | ${UBOOT_MKIMAGE} \ |
| 689 | ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ |
| 690 | -f $1 \ |
| 691 | ${KERNEL_OUTPUT_DIR}/$2 |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 692 | |
Patrick Williams | af48f63 | 2023-03-20 10:13:55 -0500 | [diff] [blame] | 693 | # |
| 694 | # Step 8: Sign the image |
| 695 | # |
| 696 | if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then |
| 697 | ${UBOOT_MKIMAGE_SIGN} \ |
| 698 | ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \ |
| 699 | -F -k "${UBOOT_SIGN_KEYDIR}" \ |
| 700 | -r ${KERNEL_OUTPUT_DIR}/$2 \ |
| 701 | ${UBOOT_MKIMAGE_SIGN_ARGS} |
| 702 | fi |
Patrick Williams | e479e92 | 2023-01-06 13:45:20 -0600 | [diff] [blame] | 703 | } |