From 32a16fa5dbe578ca2d4e2411ff0cc8e434a727c2 Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Wed, 11 Jul 2018 13:17:36 +0800 Subject: [PATCH] fix overlay lowerdir order kernel document says: Multiple lower layers can now be given using the the colon (":") as a separator character between the directory names. For example: mount -t overlay overlay -olowerdir=/lower1:/lower2:/lower3 /merged As the example shows, "upperdir=" and "workdir=" may be omitted. In that case the overlay will be read-only. The specified lower directories will be stacked beginning from the rightmost one and going left. In the above example lower1 will be the top, lower2 the middle and lower3 the bottom layer. The user directory should be on top, so that user can override the file in original rootfs image. Signed-off-by: Shengjing Zhu --- src/anbox/cmds/container_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/anbox/cmds/container_manager.cpp b/src/anbox/cmds/container_manager.cpp index ee05fcf..da6b924 100644 --- a/src/anbox/cmds/container_manager.cpp +++ b/src/anbox/cmds/container_manager.cpp @@ -240,7 +240,7 @@ bool anbox::cmds::ContainerManager::setup_rootfs_overlay() { fs::create_directories(overlay_path); const auto rootfs_path = SystemConfiguration::instance().rootfs_dir(); - const auto overlay_config = utils::string_format("lowerdir=%s:%s", rootfs_path, overlay_path); + const auto overlay_config = utils::string_format("lowerdir=%s:%s", overlay_path, rootfs_path); auto m = common::MountEntry::create("overlay", combined_rootfs_path, "overlay", MS_RDONLY, overlay_config.c_str()); if (!m) { ERROR("Failed to setup rootfs overlay");