rootfs: Allow caching of the raw rootfs

In flaky network environments, rebuilding the rootfs raw image becomes a
significant pain and in some cases, nearly impossible. This change allows us to
bypass the need to regenerate the raw rootfs every build and instead use a
rootfs placed in the cache directory.

Change-Id: Iaf0476ce835a379f2fdd69906f0cb3c0a190635d
diff --git a/rootfs.mk b/rootfs.mk
index 92064b6..15e15e5 100644
--- a/rootfs.mk
+++ b/rootfs.mk
@@ -82,6 +82,10 @@
 $(ROOTFS_RAW_IMG): $(TARBALL_FETCH_ROOT_DIRECTORY)/$(ROOTFS_REVISION)/rootfs.raw.img
 	mkdir -p $(dir $(ROOTFS_RAW_IMG))
 	cp $< $<.sha256sum $(dir $(ROOTFS_RAW_IMG))
+else ifeq ($(shell test -f $(ROOTDIR)/cache/rootfs.raw.img && echo found),found)
+$(ROOTFS_RAW_IMG): $(ROOTDIR)/cache/rootfs.raw.img
+	cp $(ROOTDIR)/cache/rootfs.raw.img $(ROOTFS_RAW_IMG)
+	sha256sum $(ROOTFS_RAW_IMG) > $(ROOTFS_RAW_IMG).sha256sum
 else
 $(ROOTFS_RAW_IMG): $(ROOTDIR)/build/preamble.mk $(ROOTDIR)/build/rootfs.mk /usr/bin/qemu-aarch64-static
 	mkdir -p $(ROOTFS_DIR)