update_kernel: Let users override the rootfs that's updated

In some kernel development workflows the device doesn't boot far enough
with the new test kernel to get a network connection up and running. It
could crash early on in the boot process, requiring the developer to
reboot into a netboot kernel or usb stick rootfs+kernel to dd the "good"
kernel back to the on-board storage. This is time consuming to do, and
requires things like usb stick and network connections.

Let's introduce a new option --rootfs that lets the user specify the
rootfs they want to copy the firmware and kernel modules to. We already
have an option to target a particular kernel partition with --partition,
so this new option allows someone to do something like:

   update_kernel.sh --remote=<IP> --partition=/dev/sda4 --rootfs=/dev/sda5 --bootonce

to try out an experimental kernel on the B copy of the kernel. If the
kernel crashes early in boot then it should reboot and the bootloader
will pick the A copy of the kernel and rootfs.

BUG=None
TEST=run update_kernel with just --remote, run it with example above,
and with the A version too (sda2+sda3)

Change-Id: I73098a110c4d4248976870fa12ced0d1500cfb8b
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1511953
Reviewed-by: Douglas Anderson <dianders@chromium.org>
1 file changed