@@ -165,12 +165,12 @@ EOF
# $1 ... .its filename
# $2 ... Image counter
# $3 ... Path to kernel image
-# $4 ... Compression type
fitimage_emit_section_kernel() {
kernel_csum="${FIT_HASH_ALG}"
kernel_sign_algo="${FIT_SIGN_ALG}"
kernel_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}"
+ get_linux_comp
ENTRYPOINT="${UBOOT_ENTRYPOINT}"
if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
@@ -186,7 +186,7 @@ fitimage_emit_section_kernel() {
type = "${UBOOT_MKIMAGE_KERNEL_TYPE}";
arch = "${UBOOT_ARCH}";
os = "linux";
- compression = "$4";
+ compression = "$linux_comp";
load = <${UBOOT_LOADADDRESS}>;
entry = <$ENTRYPOINT>;
hash-1 {
@@ -585,8 +585,6 @@ fitimage_assemble() {
# Step 1: Prepare a kernel image section.
#
fitimage_emit_section_maint $1 imagestart
-
- uboot_prep_kimage
fitimage_emit_section_kernel $1 $kernelcount "$(readlink -f linux.bin)" "$linux_comp"
#
@@ -785,6 +783,7 @@ fitimage_assemble() {
do_assemble_fitimage() {
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
cd ${B}
+ uboot_prep_kimage
fitimage_assemble fit-image.its "${KERNEL_OUTPUT_DIR}/fitImage-none" ""
if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
ln -sf fitImage-none "${B}/${KERNEL_OUTPUT_DIR}/fitImage"
@@ -806,6 +805,7 @@ do_assemble_fitimage_initramfs() {
if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \
test -n "${INITRAMFS_IMAGE}" ; then
cd ${B}
+ uboot_prep_kimage
if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
fitimage_assemble "fit-image-${INITRAMFS_IMAGE}.its" "${KERNEL_OUTPUT_DIR}/fitImage-bundle" ""
ln -sf fitImage-bundle "${B}/${KERNEL_OUTPUT_DIR}/fitImage"
@@ -47,3 +47,20 @@ uboot_prep_kimage() {
echo "${linux_comp}"
}
+
+# Get the linux_comp variable back from the linux.bin file
+# which was created by uboot_prep_kimage
+get_linux_comp() {
+ if [ ! -e linux.bin ]; then
+ bbfatal "linux.bin does not exist $(pwd)"
+ fi
+
+ linux_comp=none
+ if gzip -l linux.bin> /dev/null 2>&1; then
+ linux_comp=gzip
+ elif lzop -l linux.bin> /dev/null 2>&1; then
+ linux_comp=lzo
+ fi
+
+ echo "${linux_comp}"
+}