Patchwork [v2,2/2] connman: make useradd parameters consistent with rootless X

login
register
mail settings
Submitter Laurentiu Palcu
Date June 13, 2012, 4:01 a.m.
Message ID <1339560104-10189-3-git-send-email-laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/29771/
State New
Headers show

Comments

Laurentiu Palcu - June 13, 2012, 4:01 a.m.
Both connman and rootless X share the same xuser. However, useradd
parameters are not consistent and if connman runs useradd first,
rootless X will be broken.

[Yocto #2467]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/recipes-connectivity/connman/connman.inc      |    6 ++++--
 .../x11-common/xserver-nodm-init.bb                |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)
Ross Burton - June 13, 2012, 10:30 a.m.
On 13 June 2012 05:01, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> Both connman and rootless X share the same xuser. However, useradd
> parameters are not consistent and if connman runs useradd first,
> rootless X will be broken.

You'll also want to bump PR, or even better use INC_PR in the .inc:

INC_PR="r6" (current PR is 5, so bump when moving)

And then use that variable in the .bb:

PR = "${INC_PR}.0"

Ross

Patch

diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
index 4fb7b43..acc57ea 100644
--- a/meta/recipes-connectivity/connman/connman.inc
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -46,9 +46,11 @@  EXTRA_OECONF += "\
 INITSCRIPT_NAME = "connman"
 INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
 
+# IMPORTANT: because xuser is shared with rootless X, please make sure the
+# USERADD_PARAM is in sync with the one in xserver-nodm-init.bb
 USERADD_PACKAGES = "${PN}"
-USERADD_PARAM_${PN} = "--system --no-create-home \
-                       --shell /bin/false --groups video,tty,audio \
+USERADD_PARAM_${PN} = "--create-home \
+                       --groups video,tty,audio \
                        --user-group xuser"
 
 inherit autotools pkgconfig update-rc.d useradd
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
index 1b95261..8fca056 100644
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
@@ -30,6 +30,8 @@  INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
 
 # Use fixed Xusername of xuser for now, this will need to be
 # fixed if the Xusername changes from xuser
+# IMPORTANT: because xuser is shared with connman, please make sure the
+# USERADD_PARAM is in sync with the one in connman.inc
 USERADD_PACKAGES = "${PN}"
 USERADD_PARAM_${PN} = "--create-home \
                        --groups video,tty,audio \