diff options
author | Stephane Desneux <stephane.desneux@open.eurogiciel.org> | 2014-03-21 18:43:35 +0100 |
---|---|---|
committer | Stephane Desneux <stephane.desneux@open.eurogiciel.org> | 2014-04-11 01:22:50 +0200 |
commit | 0af59873d1fe87f8d972ab1be792be6f29288d16 (patch) | |
tree | 56fc1f6ac7099cd07770105a608045831b66edb4 | |
parent | ce46b2b5e92dceb5872b9d2ec41a61f215c065d4 (diff) | |
download | meta-0af59873d1fe87f8d972ab1be792be6f29288d16.tar.gz meta-0af59873d1fe87f8d972ab1be792be6f29288d16.tar.bz2 meta-0af59873d1fe87f8d972ab1be792be6f29288d16.zip |
adjust user session and weston startup for multiuser mode
- 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>
-rw-r--r-- | generic.yaml | 5 | ||||
-rw-r--r-- | packaging/rpmlintrc | 3 | ||||
-rw-r--r-- | patterns/generic-wayland.yaml | 3 | ||||
-rw-r--r-- | scripts/generic-base.post | 22 | ||||
-rw-r--r-- | scripts/generic-crosswalk.post | 12 | ||||
-rw-r--r-- | scripts/generic-wayland.post | 32 |
6 files changed, 49 insertions, 28 deletions
diff --git a/generic.yaml b/generic.yaml index 85bcca9..a3faca9 100644 --- a/generic.yaml +++ b/generic.yaml @@ -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 index 0000000..a785645 --- /dev/null +++ b/packaging/rpmlintrc @@ -0,0 +1,3 @@ +# suppress warnings about shebangs not present in scripts + +addFilter("script-without-shebang") diff --git a/patterns/generic-wayland.yaml b/patterns/generic-wayland.yaml index 146041d..2e694ae 100644 --- a/patterns/generic-wayland.yaml +++ b/patterns/generic-wayland.yaml @@ -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 diff --git a/scripts/generic-base.post b/scripts/generic-base.post index 2bd307b..9c3d9eb 100644 --- a/scripts/generic-base.post +++ b/scripts/generic-base.post @@ -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 + diff --git a/scripts/generic-crosswalk.post b/scripts/generic-crosswalk.post index e3ea16d..f32a535 100644 --- a/scripts/generic-crosswalk.post +++ b/scripts/generic-crosswalk.post @@ -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 diff --git a/scripts/generic-wayland.post b/scripts/generic-wayland.post index 89c8367..883b8c6 100644 --- a/scripts/generic-wayland.post +++ b/scripts/generic-wayland.post @@ -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 |