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

Unified Diff: init_cryptohome_data.sh

Issue 2645008: Update on feedback, update dbus API, add unit tests. TEST=manual,unit,BVT BUG=3628 323 (Closed) Base URL: ssh://git@chromiumos-git/cryptohome.git
Patch Set: Address second round of feedback. Created 10 years, 6 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 | « etc/Cryptohome.conf ('k') | interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: init_cryptohome_data.sh
diff --git a/init_cryptohome_data.sh b/init_cryptohome_data.sh
index 3a9a16d292ff815686422051bec56748c372b09c..cd5c08d58a66cc25d141ea36b866d08c2394499c 100755
--- a/init_cryptohome_data.sh
+++ b/init_cryptohome_data.sh
@@ -14,29 +14,20 @@
# call this script to create their test data.
#
-# mock dmsetup because we don't have it in the chroot and don't need it here.
-function dmsetup { exit 255; }
-
-CH_LIB="./lib"
-source "$CH_LIB/common"
-source "$CH_LIB/utils/declare_commands"
-
-utils::declare_commands sha256sum
-
USERNAME="testuser@invalid.domain"
PASSWORDS="zero one two"
function usage {
- $echo "Usage: $0 [-q] <image-dir>"
- $echo
- $echo "Initialize a directory of sample cryptohome data containing "
- $echo "system salt, and a single user named $USERNAME."
- $echo "The user will have three master keys, encrypted with the "
- $echo "passwords: $PASSWORDS."
- $echo
- $echo " -q Quiet mode"
- $echo " <image-dir> Directory to store cryptohome data"
- $echo
+ echo "Usage: $0 [-q] <image-dir>"
+ echo
+ echo "Initialize a directory of sample cryptohome data containing "
+ echo "system salt, and a single user named $USERNAME."
+ echo "The user will have three master keys, encrypted with the "
+ echo "passwords: $PASSWORDS."
+ echo
+ echo " -q Quiet mode"
+ echo " <image-dir> Directory to store cryptohome data"
+ echo
exit 1
}
@@ -75,24 +66,24 @@ if [ -d "$IMAGE_DIR" ]; then
fi
$info "Initializing sample crpytohome image root: $IMAGE_DIR"
-$mkdir -p "$IMAGE_DIR"
+mkdir -p "$IMAGE_DIR"
$info "Creating system salt."
SYSTEM_SALT_FILE="$IMAGE_DIR/salt"
-$head -c 16 /dev/urandom > $SYSTEM_SALT_FILE
+head -c 16 /dev/urandom > $SYSTEM_SALT_FILE
$info "Creating user directory"
-USERID=$($cat "$SYSTEM_SALT_FILE" <($echo -n $USERNAME) \
- | $openssl sha1)
+USERID=$(cat "$SYSTEM_SALT_FILE" <(echo -n $USERNAME) \
+ | openssl sha1)
$info "USERNAME: $USERNAME"
$info "USERID: $USERID"
-$mkdir -p "$IMAGE_DIR/skel/sub_path"
+mkdir -p "$IMAGE_DIR/skel/sub_path"
echo -n "testfile" > "$IMAGE_DIR/skel/sub_path/.testfile"
-$mkdir -p "$IMAGE_DIR/$USERID"
+mkdir -p "$IMAGE_DIR/$USERID"
$info "Creating master keys..."
INDEX=0
« no previous file with comments | « etc/Cryptohome.conf ('k') | interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698