Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: mount_gpt_image.sh

Issue 3916002: cros_make_image_bootable, mount_gpt_image, common.sh: root filesystem changes: ext2, ro by default (Closed)
Patch Set: line len Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« common.sh ('K') | « common.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mount_gpt_image.sh
diff --git a/mount_gpt_image.sh b/mount_gpt_image.sh
index ee7b3cc6f60de363332c1434e045b212a4ffec35..be95dc5dcf3d0fda1e94cd27963f02b7f5ac967a 100755
--- a/mount_gpt_image.sh
+++ b/mount_gpt_image.sh
@@ -79,7 +79,14 @@ function get_gpt_partitions() {
# Mount the rootfs partition using a loopback device.
local offset=$(partoffset "${FLAGS_from}/${filename}" 3)
local ro_flag=""
- [ ${FLAGS_read_only} -eq ${FLAGS_TRUE} ] && ro_flag="-o ro"
+ if [ ${FLAGS_read_only} -eq ${FLAGS_TRUE} ]; then
+ ro_flag="-o ro"
+ else
+ # Make sure any callers can actually mount and modify the fs
+ # if desired.
+ # cros_make_image_bootable should restore the bit if needed.
+ enable_rw_mount "${FLAGS_from}/${filename}" "$(( offset * 512 ))"
+ fi
sudo mount ${ro_flag} -o loop,offset=$(( offset * 512 )) \
"${FLAGS_from}/${filename}" "${FLAGS_rootfs_mountpt}"
« common.sh ('K') | « common.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698