AU: Update Downloader to support our image formats.
The downloader used to be dumb in the sense that it would pipe output
to either a DirectFileWriter or a DirectFileWriter via a
GzipDecompressingFileWriter, depending on if we were downloading an
update that was compressed or not. Sadly, things have gotten more
complex: we need to download to two partitions (kernel + rootfs), and
we may stream data via a DeltaPerformer (a type of FileWriter) to the
disk. Thus, the Downloader streams to either
1. gzip decompress->split_writer->direct to disk OR
2. delta performer
Other misc changes: Change FilesystemCopierAction to support
optionally copying the kernel partition rather than root partition.
InstallPlan struct: add an entry for destiation kernel partition.
Test Utils: a new ScopedTempFile class
Utils: support for getting the booted kernel partition device.
BUG=None
TEST=attached unittests
Review URL: http://codereview.chromium.org/1694025
diff --git a/utils.h b/utils.h
index 7983eec..e5d099f 100644
--- a/utils.h
+++ b/utils.h
@@ -135,11 +135,19 @@
}
}
-// Returns the currently booted device. "/dev/sda1", for example.
+// Returns the currently booted device. "/dev/sda3", for example.
// This will not interpret LABEL= or UUID=. You'll need to use findfs
// or something with equivalent funcionality to interpret those.
const std::string BootDevice();
+// Returns the currently booted kernel device, "dev/sda2", for example.
+// Client must pass in the boot device. The suggested calling convention
+// is: BootKernelDevice(BootDevice()).
+// This function works by doing string modification on boot_device.
+// Returns empty string on failure.
+const std::string BootKernelDevice(const std::string& boot_device);
+
+
} // namespace utils
// Class to unmount FS when object goes out of scope