2 echo "#################### generic-base.post ####################"
4 build_ts=$(date -u +%s)
5 build_date=$(date -u --date @$build_ts +%Y%m%d_%H%M%S)
6 build_time=$(date -u --date @$build_ts +%H:%M:%S)
9 -e 's|@BUILD_ID[@]|@BUILD_ID@|g' \
10 -e "s|@BUILD_DATE[@]|$build_date|g" \
11 -e "s|@BUILD_TIME[@]|$build_time|g" \
12 -e "s|@BUILD_TS[@]|$build_ts|g" \
15 # setup systemd default target for user session
16 cat <<'EOF' >>/lib/systemd/user/default.target
18 Description=User session default target
20 mkdir -p /lib/systemd/user/default.target.wants
23 ln -s ../dbus.service /lib/systemd/user/default.target.wants/
25 # Run prelink to speed up dynamic binary/library loading
26 /usr/sbin/prelink --all
28 ln -sf /proc/self/mounts /etc/mtab
30 # sdx: fix smack labels on /var/log
31 chsmack -a '*' /var/log
33 # workaround for bug PTREL-763
34 patch -b -p1 -d/ <<'EOF'
35 --- bad/etc/pam.d/systemd-user 2014-03-20 10:01:36.657843073 +0100
36 +++ good/etc/pam.d/systemd-user 2014-03-20 10:06:51.586121696 +0100
39 account include system-auth
40 session include system-auth
41 +session required pam_systemd.so
42 auth required pam_deny.so
43 password required pam_deny.so
46 # create appfw dirs inside homes
47 function generic_base_user_exists() {
49 getent passwd | grep -q ^${user}:
52 function generic_base_user_home() {
54 getent passwd | grep ^${user}: | cut -f6 -d':'
57 function generic_base_fix_user_homedir() {
59 generic_base_user_exists $user || return 1
61 homedir=$(generic_base_user_home $user)
62 mkdir -p $homedir/apps_rw
63 for appdir in desktop manifest dbspace; do
64 mkdir -p $homedir/.applications/$appdir
66 find $homedir -type d -exec chsmack -a User {} \;
67 chown -R $user:users $homedir
72 . /etc/tizen-build.conf
73 [ "${TZ_BUILD_WITH_EMULATOR}" == "1" ] && generic_base_fix_user_homedir developer
75 # Add info.ini for system-info CAPI (TC-2047)
76 /usr/bin/make_info_file.sh