Add generic-users.post(script) 18/189218/2 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.030824 accepted/tizen/unified/20180917.195207 submit/tizen/20180914.113308 submit/tizen_5.0/20181101.000007
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 14 Sep 2018 08:51:24 +0000 (10:51 +0200)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Mon, 17 Sep 2018 14:50:55 +0000 (16:50 +0200)
This script will create standard 'owner' user.  It's supposed to be
used by all profile wanting standard Tizen user(s).

Change-Id: I3db0ea3a9bc2366a8ad9d3dd26d64fe48f3d9579

scripts/generic-users.post [new file with mode: 0644]

diff --git a/scripts/generic-users.post b/scripts/generic-users.post
new file mode 100644 (file)
index 0000000..cb2a242
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+echo "#################### generic-users.post ####################"
+
+if ! generic_base_user_exists owner; then
+        # By default GUM will create users in /opt/etc/passwd, which is
+        # additional users database suitable for end-user created accounts.
+        # However, the 'owner' user is shipped by Tizen system itself and
+        # it's its default user.  Consequently, it should always be available
+        # and thus, it should be added to /etc/passwd.
+        conf=/etc/gumd/gumd.conf
+        origf=${conf}.orig
+        mv -v $conf $origf
+        sed -e 's,^\(PASSWD_FILE\).*,\1=/etc/passwd,' -e 's,^\(SHADOW_FILE\).*,\1=/etc/shadow,' <$origf >$conf
+        gum-utils --offline --add-user --username=owner --usertype=admin --usecret=tizen
+        mv -v $origf $conf
+fi
+
+