summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes-recipe/kernel-uboot.bbclass40
-rw-r--r--meta/classes-recipe/kernel-uimage.bbclass3
2 files changed, 26 insertions, 17 deletions
diff --git a/meta/classes-recipe/kernel-uboot.bbclass b/meta/classes-recipe/kernel-uboot.bbclass
index 6d4aff6b11..d2a63524ec 100644
--- a/meta/classes-recipe/kernel-uboot.bbclass
+++ b/meta/classes-recipe/kernel-uboot.bbclass
@@ -12,19 +12,27 @@ FIT_KERNEL_COMP_ALG_EXTENSION ?= ".gz"
12UBOOT_MKIMAGE_KERNEL_TYPE ?= "kernel" 12UBOOT_MKIMAGE_KERNEL_TYPE ?= "kernel"
13 13
14uboot_prep_kimage() { 14uboot_prep_kimage() {
15 if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then 15 output_dir=$1
16 # For backward compatibility with kernel-fitimage.bbclass and kernel-uboot.bbclass
17 # support calling without parameter as well
18 if [ -z "$output_dir" ]; then
19 output_dir='.'
20 fi
21
22 linux_bin=$output_dir/linux.bin
23 if [ -e "arch/${ARCH}/boot/compressed/vmlinux" ]; then
16 vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux" 24 vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
17 linux_suffix="" 25 linux_suffix=""
18 linux_comp="none" 26 linux_comp="none"
19 elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then 27 elif [ -e "arch/${ARCH}/boot/vmlinuz.bin" ]; then
20 rm -f linux.bin 28 rm -f "$linux_bin"
21 cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin 29 cp -l "arch/${ARCH}/boot/vmlinuz.bin" "$linux_bin"
22 vmlinux_path="" 30 vmlinux_path=""
23 linux_suffix="" 31 linux_suffix=""
24 linux_comp="none" 32 linux_comp="none"
25 else 33 else
26 vmlinux_path="vmlinux" 34 vmlinux_path="vmlinux"
27 # Use vmlinux.initramfs for linux.bin when INITRAMFS_IMAGE_BUNDLE set 35 # Use vmlinux.initramfs for $linux_bin when INITRAMFS_IMAGE_BUNDLE set
28 # As per the implementation in kernel.bbclass. 36 # As per the implementation in kernel.bbclass.
29 # See do_bundle_initramfs function 37 # See do_bundle_initramfs function
30 if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ] && [ -e vmlinux.initramfs ]; then 38 if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ] && [ -e vmlinux.initramfs ]; then
@@ -34,18 +42,18 @@ uboot_prep_kimage() {
34 linux_comp="${FIT_KERNEL_COMP_ALG}" 42 linux_comp="${FIT_KERNEL_COMP_ALG}"
35 fi 43 fi
36 44
37 [ -n "${vmlinux_path}" ] && ${KERNEL_OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin 45 [ -n "$vmlinux_path" ] && ${KERNEL_OBJCOPY} -O binary -R .note -R .comment -S "$vmlinux_path" "$linux_bin"
38 46
39 if [ "${linux_comp}" != "none" ] ; then 47 if [ "$linux_comp" != "none" ] ; then
40 if [ "${linux_comp}" = "gzip" ] ; then 48 if [ "$linux_comp" = "gzip" ] ; then
41 gzip -9 linux.bin 49 gzip -9 "$linux_bin"
42 elif [ "${linux_comp}" = "lzo" ] ; then 50 elif [ "$linux_comp" = "lzo" ] ; then
43 lzop -9 linux.bin 51 lzop -9 "$linux_bin"
44 elif [ "${linux_comp}" = "lzma" ] ; then 52 elif [ "$linux_comp" = "lzma" ] ; then
45 xz --format=lzma -f -6 linux.bin 53 xz --format=lzma -f -6 "$linux_bin"
46 fi 54 fi
47 mv -f "linux.bin${linux_suffix}" linux.bin 55 mv -f "$linux_bin$linux_suffix" "$linux_bin"
48 fi 56 fi
49 57
50 echo "${linux_comp}" 58 printf "$linux_comp" > "$output_dir/linux_comp"
51} 59} \ No newline at end of file
diff --git a/meta/classes-recipe/kernel-uimage.bbclass b/meta/classes-recipe/kernel-uimage.bbclass
index 1a599e656c..e353232a0e 100644
--- a/meta/classes-recipe/kernel-uimage.bbclass
+++ b/meta/classes-recipe/kernel-uimage.bbclass
@@ -29,6 +29,7 @@ python __anonymous () {
29do_uboot_mkimage[dirs] += "${B}" 29do_uboot_mkimage[dirs] += "${B}"
30do_uboot_mkimage() { 30do_uboot_mkimage() {
31 uboot_prep_kimage 31 uboot_prep_kimage
32 linux_comp="$(cat linux_comp)"
32 33
33 ENTRYPOINT=${UBOOT_ENTRYPOINT} 34 ENTRYPOINT=${UBOOT_ENTRYPOINT}
34 if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then 35 if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
@@ -36,6 +37,6 @@ do_uboot_mkimage() {
36 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'` 37 awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
37 fi 38 fi
38 39
39 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T ${UBOOT_MKIMAGE_KERNEL_TYPE} -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage 40 uboot-mkimage -A ${UBOOT_ARCH} -O linux -T ${UBOOT_MKIMAGE_KERNEL_TYPE} -C "$linux_comp" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage
40 rm -f linux.bin 41 rm -f linux.bin
41} 42}