Mount the new system as 'postinstall_file' in postinstall.
When mounting the new filesystem on /postinstall, we need to override
the file attributes from the new system (unknown to the current selinux
policies) with a consistent label that will be used only in the context
of postinstall. This patch passes an extra option to mount(2) in
Brillo and Android to achieve this.
Bug: 27177071
TEST=Deployed a postinstall script with `ls -laZ`, contents show "postinstall_file".
Change-Id: Ia43b45c92e4c4cd340a884818ac00f24a418f9e7
diff --git a/common/utils.h b/common/utils.h
index 8da0726..df06ef1 100644
--- a/common/utils.h
+++ b/common/utils.h
@@ -177,7 +177,8 @@
bool MountFilesystem(const std::string& device,
const std::string& mountpoint,
unsigned long flags, // NOLINT(runtime/int)
- const std::string& type);
+ const std::string& type,
+ const std::string& fs_mount_options);
bool UnmountFilesystem(const std::string& mountpoint);
// Returns the block count and the block byte size of the file system on