From 825dfd63ee103b55ccb5e09c2586392f64715c5b Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 17 Jan 2014 21:05:06 -0800 Subject: [PATCH] fix(build_image): Remount via new stand-alone units. Replaces the old dev-mode script that sorta took a shotgun "remount and hope for the best" approach. New units provided by coreos-init. --- build_library/dev_image_util.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build_library/dev_image_util.sh b/build_library/dev_image_util.sh index 50d6ed491f..ebf442b63f 100755 --- a/build_library/dev_image_util.sh +++ b/build_library/dev_image_util.sh @@ -36,6 +36,16 @@ install_dev_packages() { sudo mkdir -p "${root_fs_dir}/root" sudo touch "${root_fs_dir}/root/.dev_mode" + # Remount the system partition read-write by default. + # The remount services are provided by coreos-base/coreos-init + local fs_wants="${root_fs_dir}/usr/lib/systemd/system/local-fs.target.wants" + sudo mkdir -p "${fs_wants}" + if [[ "${disk_layout}" == *-usr ]]; then + sudo ln -s ../remount-usr.service "${fs_wants}" + else + sudo ln -s ../remount-root.service "${fs_wants}" + fi + # Zero all fs free space, not fatal since it won't work on linux < 3.2 sudo fstrim "${root_fs_dir}" || true if [[ -d "${root_fs_dir}/media/state" ]]; then