blob: 2364053f311e50538829628bd87a74bd62d656ea [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 Bishopd7bf8c12018-02-25 22:55:05 -05006 elif [ -e arch/${ARCH}/boot/Image ] ; then
7 vmlinux_path="vmlinux"
8 linux_suffix=""
9 linux_comp="none"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010 elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then
11 rm -f linux.bin
12 cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin
13 vmlinux_path=""
14 linux_suffix=""
15 linux_comp="none"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016 else
17 vmlinux_path="vmlinux"
18 linux_suffix=".gz"
19 linux_comp="gzip"
20 fi
21
Brad Bishop6e60e8b2018-02-01 10:27:11 -050022 [ -n "${vmlinux_path}" ] && ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023
24 if [ "${linux_comp}" != "none" ] ; then
25 gzip -9 linux.bin
26 mv -f "linux.bin${linux_suffix}" linux.bin
27 fi
28
29 echo "${linux_comp}"
30}