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

Unified Diff: scripts/image_signing/common.sh

Issue 3563001: set_lsb_release.sh: Make it mount rootfs r/w only if necessary. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git
Patch Set: Created 10 years, 3 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
« no previous file with comments | « no previous file | scripts/image_signing/set_lsb_release.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/image_signing/common.sh
diff --git a/scripts/image_signing/common.sh b/scripts/image_signing/common.sh
index 37834dc541493dfedb067e514a46af9208a1ee8b..c4824c61cc39b35367cad9b84055d1bf1dac1403 100755
--- a/scripts/image_signing/common.sh
+++ b/scripts/image_signing/common.sh
@@ -27,6 +27,16 @@ partsize() {
sudo $GPT show -s -i $2 $1
}
+# Mount a partition read-only from an image into a local directory
+# Args: IMAGE PARTNUM MOUNTDIRECTORY
+mount_image_partition_ro() {
+ local image=$1
+ local partnum=$2
+ local mount_dir=$3
+ local offset=$(partoffset "$image" "$partnum")
+ sudo mount -o loop,ro,offset=$((offset * 512)) "$image" "$mount_dir"
+}
+
# Mount a partition from an image into a local directory
# Args: IMAGE PARTNUM MOUNTDIRECTORY
mount_image_partition() {
« no previous file with comments | « no previous file | scripts/image_signing/set_lsb_release.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698