From 9b7cb51697bddf086fd6a697b5280be20ed2e1dc Mon Sep 17 00:00:00 2001 From: Will Drewry Date: Wed, 20 Oct 2010 18:11:24 -0500 Subject: [PATCH] common.sh: switch out echo -ne for printf and fix incorrect offset echo -ne isn't portable but printf with octals is so this makes the switch. In addition, the current offset is off by 3 and is updating the UUID space. This was from style cleanup and all functional test passed - of course. This change fixes that too. TEST=built and installed and checked ro enforcement works BUG=chromium-os:7972 Change-Id: Ifb3cb2c6f3219af819baff5750453439e1ba6edf Review URL: http://codereview.chromium.org/3997001 --- common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common.sh b/common.sh index 24862aa407..9a9699ede7 100644 --- a/common.sh +++ b/common.sh @@ -475,8 +475,8 @@ setup_symlinks_on_root() { disable_rw_mount() { local rootfs="$1" local offset="${2-0}" # in bytes - local ro_compat_offset=$((0x467 + 3)) # Set 'highest' byte - echo -ne '\xff' | + local ro_compat_offset=$((0x464 + 3)) # Set 'highest' byte + printf '\377' | sudo dd of="$rootfs" seek=$((offset + ro_compat_offset)) \ conv=notrunc count=1 bs=1 } @@ -484,8 +484,8 @@ disable_rw_mount() { enable_rw_mount() { local rootfs="$1" local offset="${2-0}" - local ro_compat_offset=$((0x467 + 3)) # Set 'highest' byte - echo -ne '\x00' | + local ro_compat_offset=$((0x464 + 3)) # Set 'highest' byte + printf '\000' | sudo dd of="$rootfs" seek=$((offset + ro_compat_offset)) \ conv=notrunc count=1 bs=1 }