diff --git a/update_kernel.sh b/update_kernel.sh index e0b428c1e4..7f48e5d63a 100755 --- a/update_kernel.sh +++ b/update_kernel.sh @@ -95,6 +95,16 @@ copy_kernelimage() { remote_sh dd if=/tmp/new_kern.bin of="${FLAGS_partition}" } +check_kernelbuildtime() { + local version=$(readlink "/build/${FLAGS_board}/boot/vmlinuz" | cut -d- -f2-) + local build_dir="/build/${FLAGS_board}/lib/modules/${version}/build" + if [ "${build_dir}/Makefile" -nt "/build/${FLAGS_board}/boot/vmlinuz" ]; then + warn "Your build directory has been built more recently than" + warn "the installed kernel being updated to. Did you forget to" + warn "run 'cros_workon_make chromeos-kernel --install'?" + fi +} + main() { trap cleanup EXIT @@ -114,6 +124,8 @@ main() { old_kernel="${REMOTE_OUT}" + check_kernelbuildtime + make_kernelimage if [[ ${REMOTE_VERITY} -eq ${FLAGS_FALSE} ]]; then