update_kernel: Don't make fake bootloader stub in 'latest'

The build_image script isn't able to overcome the fact that
update_kernel.sh makes a non-symlink directory for 'latest' in the
images directory when it makes a fake bootloader stub. Usually this
isn't a problem because developers build an image first and then
update_kernel from it, but if you build an image after running
update_kernel you'll see that it fails to build the image when trying to
repoint the 'latest' symlink.

Make a bootloader stub in /tmp instead and remove it when we're done to
avoid this problem.

BUG=None
TEST=update_kernel to DUT without image, build_image after and see it
work

Change-Id: I28b87dafb0af7b73151875053a55857d74dfa1d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/2029135
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Stephen Boyd <swboyd@chromium.org>
diff --git a/update_kernel.sh b/update_kernel.sh
index a08f927..78df51a 100755
--- a/update_kernel.sh
+++ b/update_kernel.sh
@@ -162,8 +162,8 @@
     # build_kernel_image.sh.  If we wanted to be super paranoid, we could copy
     # and extract it from the remote image, if it had one.
     if [[ ! -e "${bootloader_path}" ]]; then
-      warn "Bootloader does not exist; creating a stub: ${bootloader_path}"
-      mkdir -p "${bootloader_path%/*}"
+      warn "Bootloader does not exist; creating a stub"
+      bootloader_path="${TMP}/${name}"
       truncate -s 512 "${bootloader_path}"
     fi
     kernel_image="/build/${FLAGS_board}/boot/vmlinux.uimg"