summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-07-16 14:56:10 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-07-20 05:31:13 -0700
commit2c75f7e143834bded8e49887edb3ca4610150d98 (patch)
tree5af8d3f4234dd20a224c6f55dcd9e87200f2f0de
parent4f0c7a0428296c7a9d2629b544a4a71c9d3f5470 (diff)
downloadvboot-2c75f7e143834bded8e49887edb3ca4610150d98.tar.gz
image_singing: Add '--nodefault_rw_root' for make_dev_ssd.sh.
When the root is default RW mounted, we found that the system is more fragile due to suspend and resume tests. It is found that in early builds, many projects tend to need minor fixes in test image rootfs, for example kernel modules or files read by kernel. Currently the only way to update those files is to reflash whole images, but that's not very practical when the network in manufacturing line is pretty slow. It would be better if we can change a single file. As a result, we want to allow setting the default root mount option when running make_dev_ssd.sh. The new --nodefault_rw_root allows disabling rootfs verification but still mounting rootfs as RO, which makes better chances for system to be stable, and changes can still be made by an explicit 'mount -o rw,remount /'. BUG=None TEST=./make_dev_ssd.sh --remove_rootfs_verification --nodefault_rw_root Change-Id: Ie2675e25b77e638ba6c3be8e2a2a3887a95582fc Reviewed-on: https://chromium-review.googlesource.com/1137966 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rwxr-xr-xscripts/image_signing/make_dev_ssd.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/image_signing/make_dev_ssd.sh b/scripts/image_signing/make_dev_ssd.sh
index d395b1c9..b08ca48c 100755
--- a/scripts/image_signing/make_dev_ssd.sh
+++ b/scripts/image_signing/make_dev_ssd.sh
@@ -42,6 +42,8 @@ DEFINE_string partitions "" \
DEFINE_boolean recovery_key "$FLAGS_FALSE" \
"Use recovery key to sign image (to boot from USB)" ""
DEFINE_boolean force "$FLAGS_FALSE" "Skip sanity checks and make the change" "f"
+DEFINE_boolean default_rw_root "${FLAGS_TRUE}" \
+ "When --remove_rootfs_verification is set, change root mount option to RW." ""
# Parse command line
FLAGS "$@" || exit 1
@@ -66,13 +68,18 @@ EXEC_LOG="$(make_temp_file)"
remove_rootfs_verification() {
local new_root="PARTUUID=%U/PARTNROFF=1"
# the first line in sed is to strip out bootcache details
+ local rw_root_opt="s| ro | rw |"
+ if [ "${FLAGS_default_rw_root}" = "${FLAGS_FALSE}" ]; then
+ rw_root_opt="s| rw | ro |"
+ fi
+
echo "$*" | sed '
s| dm=\"2 [^"]*bootcache[^"]* vroot | dm=\"1 vroot |
s| root=/dev/dm-[0-9] | root='"$new_root"' |
s| dm_verity.dev_wait=1 | dm_verity.dev_wait=0 |
s| payload=PARTUUID=%U/PARTNROFF=1 | payload=ROOT_DEV |
s| hashtree=PARTUUID=%U/PARTNROFF=1 | hashtree=HASH_DEV |
- s| ro | rw |'
+ '"${rw_root_opt}"
}
remove_legacy_boot_rootfs_verification() {