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

Unified Diff: src/scripts/enable_localaccount.sh

Issue 1699015: Don't assume this is run from the chroot and point explicity to it. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: localacctfix Created 10 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/enable_localaccount.sh
diff --git a/src/scripts/enable_localaccount.sh b/src/scripts/enable_localaccount.sh
index fc0a84eecd0fb7427230ca766d062b68cbf6ca4a..ea54b41af3cc510f5a6b4df58f2804d61ed9c6d4 100755
--- a/src/scripts/enable_localaccount.sh
+++ b/src/scripts/enable_localaccount.sh
@@ -6,10 +6,13 @@ set -e
if [ -z $1 ]
then
- echo "Usage: $0 localaccount_username"
+ echo "Usage: $0 localaccount_username [chroot_path]"
exit 1
fi
+# Default chroot_path to its standard location
+chroot_path=${2:-"../../chroot"}
+
echo "Enabling local account $1@gmail.com."
echo "Remove these files to disable:"
@@ -36,10 +39,12 @@ EOF
done
# Add CHROMEOS_LOCAL_ACCOUNT var to /etc/make.conf.user
+echo "Setting CHROMEOS_LOCAL_ACCOUNT in $chroot_path/etc/make.conf.user..."
VAR_NAME=CHROMEOS_LOCAL_ACCOUNT
-if grep -q ${VAR_NAME} /etc/make.conf.user; then
+if grep -q ${VAR_NAME} $chroot_path/etc/make.conf.user; then
regex="s/${VAR_NAME}=.*/${VAR_NAME}=$1@gmail.com/"
- sudo sed -i -e "${regex}" /etc/make.conf.user
+ sudo sed -i -e "${regex}" $chroot_path/etc/make.conf.user
else
- sudo sh -c "echo ""${VAR_NAME}=$1@gmail.com"" >> /etc/make.conf.user"
+ sudo sh -c "echo ""${VAR_NAME}=$1@gmail.com"" >> \
+ $chroot_path/etc/make.conf.user"
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698