NEW_USER=$1
export `tzplatform-get --user $NEW_USER TZ_USER_SHARE`
export `tzplatform-get --user $NEW_USER TZ_USER_DB`
+export `tzplatform-get --user $NEW_USER TZ_SYS_USER_GROUP`
+if [ ! -e /system-update ]
+then
/usr/bin/touch $TZ_USER_DB/.media.db
/usr/bin/chown multimedia_fw:multimedia_fw $TZ_USER_DB/.media.db
-/usr/bin/chmod 2644 $TZ_USER_DB/.media.db
+/usr/bin/chmod 0644 $TZ_USER_DB/.media.db
+/usr/bin/chsmack -a 'User::Home' $TZ_USER_DB/.media.db
-/usr/bin/mkdir -p $TZ_USER_SHARE/media/.thumb/phone
-/usr/bin/mkdir -p $TZ_USER_SHARE/media/.thumb/mmc
+/usr/bin/mkdir -p $TZ_USER_SHARE/media/.thumb
/usr/bin/chown -R multimedia_fw:multimedia_fw $TZ_USER_SHARE/media
-/usr/bin/chsmack -a 'User::App::Shared' -t
-/usr/bin/chmod 2775 $TZ_USER_SHARE/media
-/usr/bin/chmod -R 2777 $TZ_USER_SHARE/media/.thumb
-/usr/bin/find $NEW_USER $TZ_USER_SHARE/media/.thumb -type d -exec /usr/bin/chsmack -a 'User::App::Shared' -t {} +
+/usr/bin/chsmack -a 'User::App::Shared' -t $TZ_USER_SHARE/media
+/usr/bin/chmod 0775 $TZ_USER_SHARE/media
+/usr/bin/chmod -R 0777 $TZ_USER_SHARE/media/.thumb
+/usr/bin/find $TZ_USER_SHARE/media/.thumb -type d -exec /usr/bin/chsmack -a 'User::App::Shared' -t {} +
+
+/usr/bin/mkdir $TZ_USER_SHARE/media/.ebook
+/usr/bin/chown $NEW_USER:$TZ_SYS_USER_GROUP $TZ_USER_SHARE/media/.ebook
+/usr/bin/chmod 0775 $TZ_USER_SHARE/media/.ebook
+/usr/bin/chsmack -a 'User::App::Shared' -t $TZ_USER_SHARE/media/.ebook
+fi