update_kernel: Use fixed partition numbers as fallback

When updating kernel on a device with a R57 image, update_kernel
succeeds without any error, but the kernel is mysteriously not

The issue is that older images built before
has no PARTITION_NUM_* in /usr/sbin/write_gpt.sh which is
read by update_kernel since

So new_kern.bin is dd-ed to /dev/mmcblk0p instead of
/dev/mmcblk0p2 or /dev/mmcblk0p4.

This patch adds the fixed partition numbers as fallback
in case the target image provides none.

TEST=update_kernel to a R57 image on Kip and see local
kernel changes are applied on device.

Change-Id: I3931ef447e3e0f4314ba2b295b32dd4b531b37bd
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/540741
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed