adjust user session and weston startup for multiuser mode
authorStephane Desneux <stephane.desneux@open.eurogiciel.org>
Fri, 21 Mar 2014 17:43:35 +0000 (18:43 +0100)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Thu, 10 Apr 2014 23:22:50 +0000 (01:22 +0200)
- weston started as 'display'
- 'tizen' user renamed 'guest'
- weston-clients and weston-generic-tz-launcher packages added

Change-Id: If8d943e9c324e152af2e0c3bde79378322f17783
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
generic.yaml
packaging/rpmlintrc [new file with mode: 0644]
patterns/generic-wayland.yaml
scripts/generic-base.post
scripts/generic-crosswalk.post
scripts/generic-wayland.post

index 85bcca9..a3faca9 100644 (file)
@@ -1,14 +1,13 @@
 Default:
     Baseline: tizen-3.0
     Active: True
-    Architecture: ia32
     Mic2Options: -f raw --fstab=uuid --copy-kernel --compress-disk-image=bz2 --generate-bmap
     Part: generic-mbr
     Language: en_US.UTF-8
     Keyboard: us
     Timezone: America/Los_Angeles
     RootPass: tizen
-    DefaultUser: tizen
+    DefaultUser: guest
     DefaultUserPass: tizen
     BootLoader: True
     BootloaderAppend: "rw vga=current splash rootwait rootfstype=ext4 plymouth.enable=0"
@@ -36,7 +35,7 @@ Minimal:
 
 Wayland:
     Part: generic-mbr
-    UserGroups: "audio,video,weston-launch"
+    UserGroups: "audio,video"
     Groups:
         - Generic Wayland
         - Generic Adaptation
diff --git a/packaging/rpmlintrc b/packaging/rpmlintrc
new file mode 100644 (file)
index 0000000..a785645
--- /dev/null
@@ -0,0 +1,3 @@
+# suppress warnings about shebangs not present in scripts
+
+addFilter("script-without-shebang")
index 146041d..2e694ae 100644 (file)
@@ -5,7 +5,10 @@ Packages:
 - cantarell-fonts
 - dejavu-fonts
 - weston
+- weston-generic
 - weston-generic-config
+- weston-clients
+- weston-generic-tz-launcher
 - mesa
 - xkeyboard-config
 - tizen-branding-default
index 2bd307b..9c3d9eb 100644 (file)
@@ -1,8 +1,11 @@
 ################ generic-base.post ##################
 
-# was base-general-minimal.post - not used actually
-#rm /usr/lib/systemd/system/default.target
-#ln -sf multi-user.target  /usr/lib/systemd/system/default.target
+# setup systemd default target for user session
+cat <<'EOF' >>/lib/systemd/user/default.target
+[Unit]
+Description=User session default target
+EOF
+mkdir -p /lib/systemd/user/default.target.wants
 
 # Run prelink to speed up dynamic binary/library loading
 /usr/sbin/prelink --all
@@ -68,3 +71,16 @@ diff -urN bad/etc/pam.d/systemd-user good/etc/pam.d/systemd-user
  auth required pam_deny.so
  password required pam_deny.so
 EOF
+
+######### multiuser mode: create additional users
+tizen_crypted_pass=$(perl -e 'print crypt("tizen", "aa")')
+uid=5001
+
+for user in alice bob carol; do
+       useradd -u $uid -d /home/$user -g users -G audio,video,users,display -m --password "$tizen_crypted_pass" $user
+       chsmack -a User /home/$user
+       uid=$(( $uid + 1 ))
+done
+# fix guest homedir
+chsmack -a User /home/guest
+
index e3ea16d..f32a535 100644 (file)
@@ -12,22 +12,22 @@ cat <<EOF >/lib/systemd/user/xwalk_widgets_preinstall.service
 [Unit]
 Description=Installation of pre-installed widgets
 After=dbus.service
-ConditionPathExists=!/home/app/.config/xwalk-service/applications.db
+ConditionPathExists=!%h/.config/xwalk-service/applications.db
 
 [Service]
 Type=oneshot
 ExecStart=/usr/bin/install_widgets.sh
 
 [Install]
-WantedBy=weston.target
+WantedBy=default.target
 EOF
 
-mkdir -p /lib/systemd/user/xwalk.target.wants
-ln -sf ../xwalk_widgets_preinstall.service /lib/systemd/user/weston.target.wants/xwalk_widgets_preinstall.service
-
+# run xwalk and xwalk_widgets_preinstall services in default target
+mkdir -p /lib/systemd/user/default.target.wants
+ln -sf ../xwalk_widgets_preinstall.service /lib/systemd/user/default.target.wants/
+ln -sf ../xwalk.service /lib/systemd/user/default.target.wants/
 
 # add launchers to weston.ini
-
 if [ -f /usr/bin/weston ]; then
 
        cat >>/etc/xdg/weston/weston.ini <<EOF
index 89c8367..883b8c6 100644 (file)
@@ -1,22 +1,22 @@
 #################### generic-wayland.post ##################
 
-# Add 'app' user to the weston-launch group
-/usr/sbin/groupmod -A app weston-launch
+# Add 'app' user to the display group
+/usr/sbin/groupmod -A app display
 
-# Enable a logind session for 'app' user on seat0 (the default seat for
-# graphical sessions)
-mkdir -p /usr/lib/systemd/system/graphical.target.wants
-ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service
-ln -sf weston.target  /usr/lib/systemd/user/default.target
+# add other users to display group
+for user in alice bob carol guest; do
+       /usr/sbin/groupmod -A $user display
+done
 
-# Add a rule to ensure the app user has permissions to
-# open the graphics device
-cat > /etc/udev/rules.d/99-dri.rules <<EOF
-SUBSYSTEM=="drm", MODE="0666"
-EOF
+# Enable a logind session for users on seat0 (the default seat for
+# graphical sessions)
+unitdir=/usr/lib/systemd/system
+mkdir -p $unitdir/graphical.target.wants
+for user in app alice bob carol guest; do
+       uid=$(getent passwd $user|cut -f3 -d':')
+       ln -s ../user-session-launch@.service $unitdir/graphical.target.wants/user-session-launch@seat0-$uid.service
+done
 
-# sdx: user 'app' must own /dev/tty1 for weston to start correctly
-cat >/usr/lib/udev/rules.d/99-tty.rules <<EOF
-SUBSYSTEM=="tty", KERNEL=="tty1", GROUP="app", OWNER="app"
-EOF
+# clean weston target inside user session (installed by weston)
+rm -f /usr/lib/systemd/user/weston.target