-# kernel_image_gz_from_image() and kernel_version_from_image() are helpers
-# for arm* kernels which produce zImage files which cannot be read from
-# get_kernel_version -> get rid of this workaround if possible
-kernel_image_gz_from_image() {
- local arch=$(uname -i)
- local r=${1}.gz
-
- # uImage kernels can't be extracted directly. Use the vmlinux.gz instead
- r=${r//uImage/vmlinux}
-
- # on ARM a zImage can't be extracted directly. Other platforms define it
- # as a gzipped vmlinux file, but not ARM. So only on ARM, use vmlinux.gz.
- if [[ $arch =~ arm ]] || [[ $arch =~ aarch ]]; then
- r=${r//zImage/vmlinux}
- fi
-
- echo $r
-}
-