Don't sudo in mk_memento_images.sh

Review URL: http://chromereview.prom.corp.google.com/1178018

git-svn-id: svn://chrome-svn/chromeos/trunk@93 06c00378-0e64-4dae-be16-12b19f9950a1
This commit is contained in:
rtc@google.com 2009-10-26 22:58:45 +00:00
parent d26178fa7e
commit c3cfe2cccd

View File

@ -18,21 +18,20 @@ fi
if [ $(whoami) = "root" ] if [ $(whoami) = "root" ]
then then
echo "run $0 as non root" echo "running $0 as root which is unneccessary"
exit 1
fi fi
FINAL_OUT_FILE=$(dirname "$1")/update.gz FINAL_OUT_FILE=$(dirname "$1")/update.gz
UNCOMPRESSED_OUT_FILE="$FINAL_OUT_FILE.uncompressed" UNCOMPRESSED_OUT_FILE="$FINAL_OUT_FILE.uncompressed"
ORIGINAL_LABEL=$(sudo /sbin/e2label "$1") ORIGINAL_LABEL=$(/sbin/e2label "$1")
# copy original over to the new file # copy original over to the new file
cp "$1" "$UNCOMPRESSED_OUT_FILE" cp "$1" "$UNCOMPRESSED_OUT_FILE"
# Fix up the file system label. We prefix with 'A' # Fix up the file system label. We prefix with 'A'
NEW_LABEL="A${ORIGINAL_LABEL}" NEW_LABEL="A${ORIGINAL_LABEL}"
sudo /sbin/tune2fs -L "$NEW_LABEL" "$UNCOMPRESSED_OUT_FILE" /sbin/tune2fs -L "$NEW_LABEL" "$UNCOMPRESSED_OUT_FILE"
# compress and hash # compress and hash
CS_AND_RET_CODES=$(gzip -c "$UNCOMPRESSED_OUT_FILE" | \ CS_AND_RET_CODES=$(gzip -c "$UNCOMPRESSED_OUT_FILE" | \