blob: 179185b6b236157987e91ae80e487eb31e207ed6 [file] [log] [blame]
Patrick Williamsc0f7c042017-02-23 20:41:17 -06001inherit kernel-uboot uboot-sign
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002
3python __anonymous () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -05004 kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
He Zhefe76b1e2016-05-25 04:47:16 -04005 if 'fitImage' in kerneltypes.split():
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006 depends = d.getVar("DEPENDS")
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007 depends = "%s u-boot-mkimage-native dtc-native" % depends
8 d.setVar("DEPENDS", depends)
9
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010 if d.getVar("UBOOT_ARCH") == "mips":
11 replacementtype = "vmlinuz.bin"
12 elif d.getVar("UBOOT_ARCH") == "x86":
Patrick Williamsc0f7c042017-02-23 20:41:17 -060013 replacementtype = "bzImage"
14 else:
15 replacementtype = "zImage"
16
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017 # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
18 # to kernel.bbclass . We have to override it, since we pack zImage
19 # (at least for now) into the fitImage .
Brad Bishop6e60e8b2018-02-01 10:27:11 -050020 typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
He Zhefe76b1e2016-05-25 04:47:16 -040021 if 'fitImage' in typeformake.split():
Patrick Williamsc0f7c042017-02-23 20:41:17 -060022 d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024 image = d.getVar('INITRAMFS_IMAGE')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025 if image:
George McCollister185c8ae2016-05-26 08:55:16 -050026 d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
27
Patrick Williamsc0f7c042017-02-23 20:41:17 -060028 # Verified boot will sign the fitImage and append the public key to
Brad Bishop6e60e8b2018-02-01 10:27:11 -050029 # U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling
Patrick Williamsc0f7c042017-02-23 20:41:17 -060030 # the fitImage:
Brad Bishop6e60e8b2018-02-01 10:27:11 -050031 if d.getVar('UBOOT_SIGN_ENABLE') == "1":
32 uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
Patrick Williamsc0f7c042017-02-23 20:41:17 -060033 d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034}
35
Yannick Gicqueld5813b42016-04-27 16:20:55 +020036# Options for the device tree compiler passed to mkimage '-D' feature:
37UBOOT_MKIMAGE_DTCOPTS ??= ""
38
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039#
40# Emit the fitImage ITS header
41#
George McCollister185c8ae2016-05-26 08:55:16 -050042# $1 ... .its filename
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043fitimage_emit_fit_header() {
George McCollister185c8ae2016-05-26 08:55:16 -050044 cat << EOF >> ${1}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045/dts-v1/;
46
47/ {
48 description = "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}";
49 #address-cells = <1>;
50EOF
51}
52
53#
54# Emit the fitImage section bits
55#
George McCollister185c8ae2016-05-26 08:55:16 -050056# $1 ... .its filename
57# $2 ... Section bit type: imagestart - image section start
Patrick Williamsc124f4f2015-09-15 14:41:29 -050058# confstart - configuration section start
59# sectend - section end
60# fitend - fitimage end
61#
62fitimage_emit_section_maint() {
George McCollister185c8ae2016-05-26 08:55:16 -050063 case $2 in
Patrick Williamsc124f4f2015-09-15 14:41:29 -050064 imagestart)
George McCollister185c8ae2016-05-26 08:55:16 -050065 cat << EOF >> ${1}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066
67 images {
68EOF
69 ;;
70 confstart)
George McCollister185c8ae2016-05-26 08:55:16 -050071 cat << EOF >> ${1}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050072
73 configurations {
74EOF
75 ;;
76 sectend)
George McCollister185c8ae2016-05-26 08:55:16 -050077 cat << EOF >> ${1}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 };
79EOF
80 ;;
81 fitend)
George McCollister185c8ae2016-05-26 08:55:16 -050082 cat << EOF >> ${1}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083};
84EOF
85 ;;
86 esac
87}
88
89#
90# Emit the fitImage ITS kernel section
91#
George McCollister185c8ae2016-05-26 08:55:16 -050092# $1 ... .its filename
93# $2 ... Image counter
94# $3 ... Path to kernel image
95# $4 ... Compression type
Patrick Williamsc124f4f2015-09-15 14:41:29 -050096fitimage_emit_section_kernel() {
97
98 kernel_csum="sha1"
99
100 ENTRYPOINT=${UBOOT_ENTRYPOINT}
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500101 if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
102 ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \
103 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500104 fi
105
George McCollister185c8ae2016-05-26 08:55:16 -0500106 cat << EOF >> ${1}
107 kernel@${2} {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108 description = "Linux kernel";
George McCollister185c8ae2016-05-26 08:55:16 -0500109 data = /incbin/("${3}");
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500110 type = "kernel";
111 arch = "${UBOOT_ARCH}";
112 os = "linux";
George McCollister185c8ae2016-05-26 08:55:16 -0500113 compression = "${4}";
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500114 load = <${UBOOT_LOADADDRESS}>;
115 entry = <${ENTRYPOINT}>;
116 hash@1 {
117 algo = "${kernel_csum}";
118 };
119 };
120EOF
121}
122
123#
124# Emit the fitImage ITS DTB section
125#
George McCollister185c8ae2016-05-26 08:55:16 -0500126# $1 ... .its filename
127# $2 ... Image counter
128# $3 ... Path to DTB image
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500129fitimage_emit_section_dtb() {
130
131 dtb_csum="sha1"
132
George McCollister185c8ae2016-05-26 08:55:16 -0500133 cat << EOF >> ${1}
134 fdt@${2} {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500135 description = "Flattened Device Tree blob";
George McCollister185c8ae2016-05-26 08:55:16 -0500136 data = /incbin/("${3}");
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500137 type = "flat_dt";
138 arch = "${UBOOT_ARCH}";
139 compression = "none";
140 hash@1 {
141 algo = "${dtb_csum}";
142 };
143 };
144EOF
145}
146
147#
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600148# Emit the fitImage ITS setup section
149#
150# $1 ... .its filename
151# $2 ... Image counter
152# $3 ... Path to setup image
153fitimage_emit_section_setup() {
154
155 setup_csum="sha1"
156
157 cat << EOF >> ${1}
158 setup@${2} {
159 description = "Linux setup.bin";
160 data = /incbin/("${3}");
161 type = "x86_setup";
162 arch = "${UBOOT_ARCH}";
163 os = "linux";
164 compression = "none";
165 load = <0x00090000>;
166 entry = <0x00090000>;
167 hash@1 {
168 algo = "${setup_csum}";
169 };
170 };
171EOF
172}
173
174#
George McCollister185c8ae2016-05-26 08:55:16 -0500175# Emit the fitImage ITS ramdisk section
176#
177# $1 ... .its filename
178# $2 ... Image counter
179# $3 ... Path to ramdisk image
180fitimage_emit_section_ramdisk() {
181
182 ramdisk_csum="sha1"
Rick Altherrbc1b8802017-01-20 11:28:53 -0800183 ramdisk_ctype="none"
Nathan Rossib4a4dc02016-10-21 22:07:27 +1000184 ramdisk_loadline=""
185 ramdisk_entryline=""
186
187 if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then
188 ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;"
189 fi
190 if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then
191 ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;"
192 fi
George McCollister185c8ae2016-05-26 08:55:16 -0500193
Rick Altherrbc1b8802017-01-20 11:28:53 -0800194 case $3 in
195 *.gz)
196 ramdisk_ctype="gzip"
197 ;;
198 *.bz2)
199 ramdisk_ctype="bzip2"
200 ;;
201 *.lzma)
202 ramdisk_ctype="lzma"
203 ;;
204 *.lzo)
205 ramdisk_ctype="lzo"
206 ;;
207 *.lz4)
208 ramdisk_ctype="lz4"
209 ;;
210 esac
211
George McCollister185c8ae2016-05-26 08:55:16 -0500212 cat << EOF >> ${1}
213 ramdisk@${2} {
Rick Altherrbc1b8802017-01-20 11:28:53 -0800214 description = "${INITRAMFS_IMAGE}";
George McCollister185c8ae2016-05-26 08:55:16 -0500215 data = /incbin/("${3}");
216 type = "ramdisk";
217 arch = "${UBOOT_ARCH}";
218 os = "linux";
Rick Altherrbc1b8802017-01-20 11:28:53 -0800219 compression = "${ramdisk_ctype}";
Nathan Rossib4a4dc02016-10-21 22:07:27 +1000220 ${ramdisk_loadline}
221 ${ramdisk_entryline}
George McCollister185c8ae2016-05-26 08:55:16 -0500222 hash@1 {
223 algo = "${ramdisk_csum}";
224 };
225 };
226EOF
227}
228
229#
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500230# Emit the fitImage ITS configuration section
231#
George McCollister185c8ae2016-05-26 08:55:16 -0500232# $1 ... .its filename
233# $2 ... Linux kernel ID
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500234# $3 ... DTB image name
George McCollister185c8ae2016-05-26 08:55:16 -0500235# $4 ... ramdisk ID
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600236# $5 ... config ID
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500237# $6 ... default flag
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500238fitimage_emit_section_config() {
239
240 conf_csum="sha1"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600241 if [ -n "${UBOOT_SIGN_ENABLE}" ] ; then
242 conf_sign_keyname="${UBOOT_SIGN_KEYNAME}"
243 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500244
245 # Test if we have any DTBs at all
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600246 conf_desc="Linux kernel"
247 kernel_line="kernel = \"kernel@${2}\";"
248 fdt_line=""
249 ramdisk_line=""
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500250 setup_line=""
251 default_line=""
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600252
253 if [ -n "${3}" ]; then
254 conf_desc="${conf_desc}, FDT blob"
George McCollister185c8ae2016-05-26 08:55:16 -0500255 fdt_line="fdt = \"fdt@${3}\";"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600256 fi
257
258 if [ -n "${4}" ]; then
259 conf_desc="${conf_desc}, ramdisk"
George McCollister185c8ae2016-05-26 08:55:16 -0500260 ramdisk_line="ramdisk = \"ramdisk@${4}\";"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500261 fi
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600262
263 if [ -n "${5}" ]; then
264 conf_desc="${conf_desc}, setup"
265 setup_line="setup = \"setup@${5}\";"
266 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500267
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500268 if [ "${6}" = "1" ]; then
269 default_line="default = \"conf@${3}\";"
270 fi
271
George McCollister185c8ae2016-05-26 08:55:16 -0500272 cat << EOF >> ${1}
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500273 ${default_line}
274 conf@${3} {
275 description = "${6} ${conf_desc}";
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500276 ${kernel_line}
277 ${fdt_line}
George McCollister185c8ae2016-05-26 08:55:16 -0500278 ${ramdisk_line}
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600279 ${setup_line}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500280 hash@1 {
281 algo = "${conf_csum}";
282 };
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600283EOF
284
285 if [ ! -z "${conf_sign_keyname}" ] ; then
286
287 sign_line="sign-images = \"kernel\""
288
289 if [ -n "${3}" ]; then
290 sign_line="${sign_line}, \"fdt\""
291 fi
292
293 if [ -n "${4}" ]; then
294 sign_line="${sign_line}, \"ramdisk\""
295 fi
296
297 if [ -n "${5}" ]; then
298 sign_line="${sign_line}, \"setup\""
299 fi
300
301 sign_line="${sign_line};"
302
303 cat << EOF >> ${1}
304 signature@1 {
305 algo = "${conf_csum},rsa2048";
306 key-name-hint = "${conf_sign_keyname}";
307 ${sign_line}
308 };
309EOF
310 fi
311
312 cat << EOF >> ${1}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500313 };
314EOF
315}
316
George McCollister185c8ae2016-05-26 08:55:16 -0500317#
318# Assemble fitImage
319#
320# $1 ... .its filename
321# $2 ... fitImage name
322# $3 ... include ramdisk
323fitimage_assemble() {
324 kernelcount=1
325 dtbcount=""
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500326 DTBS=""
George McCollister185c8ae2016-05-26 08:55:16 -0500327 ramdiskcount=${3}
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600328 setupcount=""
George McCollister185c8ae2016-05-26 08:55:16 -0500329 rm -f ${1} arch/${ARCH}/boot/${2}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500330
George McCollister185c8ae2016-05-26 08:55:16 -0500331 fitimage_emit_fit_header ${1}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500332
George McCollister185c8ae2016-05-26 08:55:16 -0500333 #
334 # Step 1: Prepare a kernel image section.
335 #
336 fitimage_emit_section_maint ${1} imagestart
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500337
George McCollister185c8ae2016-05-26 08:55:16 -0500338 uboot_prep_kimage
339 fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500340
George McCollister185c8ae2016-05-26 08:55:16 -0500341 #
342 # Step 2: Prepare a DTB image section
343 #
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500344 if [ -n "${KERNEL_DEVICETREE}" ]; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500345 dtbcount=1
George McCollister185c8ae2016-05-26 08:55:16 -0500346 for DTB in ${KERNEL_DEVICETREE}; do
347 if echo ${DTB} | grep -q '/dts/'; then
348 bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
349 DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
350 fi
351 DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
352 if [ ! -e "${DTB_PATH}" ]; then
353 DTB_PATH="arch/${ARCH}/boot/${DTB}"
354 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500355
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500356 DTB=$(echo "${DTB}" | tr '/' '_')
357 DTBS="${DTBS} ${DTB}"
358 fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
George McCollister185c8ae2016-05-26 08:55:16 -0500359 done
360 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500361
George McCollister185c8ae2016-05-26 08:55:16 -0500362 #
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600363 # Step 3: Prepare a setup section. (For x86)
364 #
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500365 if [ -e arch/${ARCH}/boot/setup.bin ]; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600366 setupcount=1
367 fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin
368 fi
369
370 #
371 # Step 4: Prepare a ramdisk section.
George McCollister185c8ae2016-05-26 08:55:16 -0500372 #
373 if [ "x${ramdiskcount}" = "x1" ] ; then
Rick Altherrbc1b8802017-01-20 11:28:53 -0800374 # Find and use the first initramfs image archive type we find
375 for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500376 initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
Rick Altherrbc1b8802017-01-20 11:28:53 -0800377 echo "Using $initramfs_path"
378 if [ -e "${initramfs_path}" ]; then
379 fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}"
380 break
381 fi
382 done
George McCollister185c8ae2016-05-26 08:55:16 -0500383 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500384
George McCollister185c8ae2016-05-26 08:55:16 -0500385 fitimage_emit_section_maint ${1} sectend
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500386
George McCollister185c8ae2016-05-26 08:55:16 -0500387 # Force the first Kernel and DTB in the default config
388 kernelcount=1
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500389 if [ -n "${dtbcount}" ]; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600390 dtbcount=1
391 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500392
George McCollister185c8ae2016-05-26 08:55:16 -0500393 #
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600394 # Step 5: Prepare a configurations section
George McCollister185c8ae2016-05-26 08:55:16 -0500395 #
396 fitimage_emit_section_maint ${1} confstart
397
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500398 if [ -n "${DTBS}" ]; then
399 i=1
400 for DTB in ${DTBS}; do
401 fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
402 i=`expr ${i} + 1`
403 done
404 fi
George McCollister185c8ae2016-05-26 08:55:16 -0500405
406 fitimage_emit_section_maint ${1} sectend
407
408 fitimage_emit_section_maint ${1} fitend
409
410 #
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600411 # Step 6: Assemble the image
George McCollister185c8ae2016-05-26 08:55:16 -0500412 #
413 uboot-mkimage \
414 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
415 -f ${1} \
416 arch/${ARCH}/boot/${2}
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600417
418 #
419 # Step 7: Sign the image and add public key to U-Boot dtb
420 #
421 if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then
422 uboot-mkimage \
423 ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
424 -F -k "${UBOOT_SIGN_KEYDIR}" \
425 -K "${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_BINARY}" \
426 -r arch/${ARCH}/boot/${2}
427 fi
George McCollister185c8ae2016-05-26 08:55:16 -0500428}
429
430do_assemble_fitimage() {
431 if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
432 cd ${B}
433 fitimage_assemble fit-image.its fitImage
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500434 fi
435}
436
437addtask assemble_fitimage before do_install after do_compile
438
George McCollister185c8ae2016-05-26 08:55:16 -0500439do_assemble_fitimage_initramfs() {
440 if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \
441 test -n "${INITRAMFS_IMAGE}" ; then
442 cd ${B}
443 fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1
444 fi
445}
446
447addtask assemble_fitimage_initramfs before do_deploy after do_install
448
449
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500450kernel_do_deploy[vardepsexclude] = "DATETIME"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500451kernel_do_deploy_append() {
452 # Update deploy directory
He Zhefe76b1e2016-05-25 04:47:16 -0400453 if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500454 cd ${B}
455 echo "Copying fit-image.its source file..."
He Zhefe76b1e2016-05-25 04:47:16 -0400456 its_base_name="fitImage-its-${PV}-${PR}-${MACHINE}-${DATETIME}"
457 its_symlink_name=fitImage-its-${MACHINE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500458 install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its
He Zhefe76b1e2016-05-25 04:47:16 -0400459 linux_bin_base_name="fitImage-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}"
460 linux_bin_symlink_name=fitImage-linux.bin-${MACHINE}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500461 install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin
462
George McCollister185c8ae2016-05-26 08:55:16 -0500463 if [ -n "${INITRAMFS_IMAGE}" ]; then
464 echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500465 its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
466 its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE_NAME}
George McCollister185c8ae2016-05-26 08:55:16 -0500467 install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500468 fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
469 fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE_NAME}
George McCollister185c8ae2016-05-26 08:55:16 -0500470 install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin
471 fi
472
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500473 cd ${DEPLOYDIR}
474 ln -sf ${its_base_name}.its ${its_symlink_name}.its
475 ln -sf ${linux_bin_base_name}.bin ${linux_bin_symlink_name}.bin
George McCollister185c8ae2016-05-26 08:55:16 -0500476
477 if [ -n "${INITRAMFS_IMAGE}" ]; then
478 ln -sf ${its_initramfs_base_name}.its ${its_initramfs_symlink_name}.its
479 ln -sf ${fit_initramfs_base_name}.bin ${fit_initramfs_symlink_name}.bin
480 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500481 fi
482}