diff options
author | Rick Altherr <raltherr@google.com> | 2017-01-20 11:28:53 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-23 12:05:23 +0000 |
commit | 4aa6644f92975ded908ef99cf313466e0845e071 (patch) | |
tree | b1f50bb28630fa5259094f4ef81adcf258abc966 /meta/classes/kernel-fitimage.bbclass | |
parent | d6484006627b6dfba7f58e2cb2bd26aa7015eb20 (diff) | |
download | poky-4aa6644f92975ded908ef99cf313466e0845e071.tar.gz |
kernel-fitimage: Use compressed ramdisks in FIT images if available
kernel-fitimage:fitimage_assemble() was calling copy_initramfs from
kernel.bbclass which decompresses the initramfs cpio. Assume that if
INITRAMFS_FSTYPES includes a compressed cpio, that is what it desired in
the FIT image.
(From OE-Core rev: 842ad404b36e00c89f615a3f7db4a2d30062effa)
Signed-off-by: Rick Altherr <raltherr@google.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-fitimage.bbclass')
-rw-r--r-- | meta/classes/kernel-fitimage.bbclass | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass index c15ded523c..1c3b4b7fb3 100644 --- a/meta/classes/kernel-fitimage.bbclass +++ b/meta/classes/kernel-fitimage.bbclass | |||
@@ -178,6 +178,7 @@ EOF | |||
178 | fitimage_emit_section_ramdisk() { | 178 | fitimage_emit_section_ramdisk() { |
179 | 179 | ||
180 | ramdisk_csum="sha1" | 180 | ramdisk_csum="sha1" |
181 | ramdisk_ctype="none" | ||
181 | ramdisk_loadline="" | 182 | ramdisk_loadline="" |
182 | ramdisk_entryline="" | 183 | ramdisk_entryline="" |
183 | 184 | ||
@@ -188,14 +189,32 @@ fitimage_emit_section_ramdisk() { | |||
188 | ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;" | 189 | ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;" |
189 | fi | 190 | fi |
190 | 191 | ||
192 | case $3 in | ||
193 | *.gz) | ||
194 | ramdisk_ctype="gzip" | ||
195 | ;; | ||
196 | *.bz2) | ||
197 | ramdisk_ctype="bzip2" | ||
198 | ;; | ||
199 | *.lzma) | ||
200 | ramdisk_ctype="lzma" | ||
201 | ;; | ||
202 | *.lzo) | ||
203 | ramdisk_ctype="lzo" | ||
204 | ;; | ||
205 | *.lz4) | ||
206 | ramdisk_ctype="lz4" | ||
207 | ;; | ||
208 | esac | ||
209 | |||
191 | cat << EOF >> ${1} | 210 | cat << EOF >> ${1} |
192 | ramdisk@${2} { | 211 | ramdisk@${2} { |
193 | description = "ramdisk image"; | 212 | description = "${INITRAMFS_IMAGE}"; |
194 | data = /incbin/("${3}"); | 213 | data = /incbin/("${3}"); |
195 | type = "ramdisk"; | 214 | type = "ramdisk"; |
196 | arch = "${UBOOT_ARCH}"; | 215 | arch = "${UBOOT_ARCH}"; |
197 | os = "linux"; | 216 | os = "linux"; |
198 | compression = "none"; | 217 | compression = "${ramdisk_ctype}"; |
199 | ${ramdisk_loadline} | 218 | ${ramdisk_loadline} |
200 | ${ramdisk_entryline} | 219 | ${ramdisk_entryline} |
201 | hash@1 { | 220 | hash@1 { |
@@ -341,8 +360,15 @@ fitimage_assemble() { | |||
341 | # Step 4: Prepare a ramdisk section. | 360 | # Step 4: Prepare a ramdisk section. |
342 | # | 361 | # |
343 | if [ "x${ramdiskcount}" = "x1" ] ; then | 362 | if [ "x${ramdiskcount}" = "x1" ] ; then |
344 | copy_initramfs | 363 | # Find and use the first initramfs image archive type we find |
345 | fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio | 364 | for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do |
365 | initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${img}" | ||
366 | echo "Using $initramfs_path" | ||
367 | if [ -e "${initramfs_path}" ]; then | ||
368 | fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}" | ||
369 | break | ||
370 | fi | ||
371 | done | ||
346 | fi | 372 | fi |
347 | 373 | ||
348 | fitimage_emit_section_maint ${1} sectend | 374 | fitimage_emit_section_maint ${1} sectend |