move user/group settings to setup_board
Update a few more hardcoded cases to use the active user details rather
than the compile-time constants.
BUG=b:20895978
diff --git a/setup_board b/setup_board
index 099b926..15bf3a0 100755
--- a/setup_board
+++ b/setup_board
@@ -8,6 +8,8 @@
from __future__ import print_function
import argparse
+import getpass
+import grp
import logging
import multiprocessing
import os
@@ -67,6 +69,10 @@
'gprefix': os.path.join(source_root, 'src', 'third_party',
'portage-prefix'),
'ncpus': multiprocessing.cpu_count(),
+ 'username': getpass.getuser(),
+ 'groupname': grp.getgrgid(os.getgid()).gr_name,
+ 'uid': os.getuid(),
+ 'gid': os.getgid(),
}
# Create /etc/portage/make.conf.
@@ -111,6 +117,13 @@
CBUILD="x86_64-pc-linux-gnu"
CHOST="x86_64-android-linux-gnu"
+
+# TODO: These should be pushed back into portage itself.
+PORTAGE_USER='%(username)s'
+PORTAGE_GROUP='%(groupname)s'
+PORTAGE_ROOT_USER='%(username)s'
+PORTAGE_INST_UID='%(uid)s'
+PORTAGE_INST_GID='%(gid)s'
""" % settings)
# Now a few bin wrappers.
diff --git a/usr/share/portage/config/make.globals b/usr/share/portage/config/make.globals
index 47524bb..44c0f98 100644
--- a/usr/share/portage/config/make.globals
+++ b/usr/share/portage/config/make.globals
@@ -120,13 +120,13 @@
USE_ORDER="env:pkg:conf:defaults:pkginternal:repo:env.d"
# Default portage user/group
-PORTAGE_USER='vapier'
-PORTAGE_GROUP='eng'
-PORTAGE_ROOT_USER='vapier'
+#PORTAGE_USER=
+#PORTAGE_GROUP=
+#PORTAGE_ROOT_USER=
# Default ownership of installed files.
-PORTAGE_INST_UID="145691"
-PORTAGE_INST_GID="5000"
+#PORTAGE_INST_UID=
+#PORTAGE_INST_GID=
# Default PATH for ebuild env
DEFAULT_PATH="${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin"
@@ -144,9 +144,9 @@
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo"
-PORTAGE_ELOG_MAILURI="vapier"
+PORTAGE_ELOG_MAILURI="localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
-PORTAGE_ELOG_MAILFROM="vapier@localhost"
+PORTAGE_ELOG_MAILFROM="nobody@localhost"
# Signing command used by repoman
PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --digest-algo SHA256 --clearsign --yes --default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" \"\${FILE}\""