blob: 87f02654fa5f3f836c3d6f5e556bf29136a6899c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001uboot_prep_kimage() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002 if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003 vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
4 linux_suffix=""
5 linux_comp="none"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05006 elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then
7 rm -f linux.bin
8 cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin
9 vmlinux_path=""
10 linux_suffix=""
11 linux_comp="none"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012 else
13 vmlinux_path="vmlinux"
14 linux_suffix=".gz"
15 linux_comp="gzip"
16 fi
17
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018 [ -n "${vmlinux_path}" ] && ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019
20 if [ "${linux_comp}" != "none" ] ; then
21 gzip -9 linux.bin
22 mv -f "linux.bin${linux_suffix}" linux.bin
23 fi
24
25 echo "${linux_comp}"
26}