From: Jiyong Min Date: Wed, 24 Aug 2016 00:46:30 +0000 (+0900) Subject: Add media-server.path for lazy mount issue X-Git-Tag: accepted/tizen/common/20160825.152046^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a92e9d8a5ce85dbea13bd045f8150f706643baa1;p=platform%2Fcore%2Fmultimedia%2Fmedia-server.git Add media-server.path for lazy mount issue Change-Id: I369363077d721211b8e5a7cc7373517029cfa998 Signed-off-by: Jiyong Min --- diff --git a/packaging/media-server.path b/packaging/media-server.path new file mode 100644 index 0000000..8755610 --- /dev/null +++ b/packaging/media-server.path @@ -0,0 +1,5 @@ +[Unit] +Description=media-server path activation + +[Path] +PathExists=/run/.unlock_mnt diff --git a/packaging/media-server.spec b/packaging/media-server.spec index 279f61a..51060f4 100755 --- a/packaging/media-server.spec +++ b/packaging/media-server.spec @@ -8,6 +8,7 @@ Source0: %{name}-%{version}.tar.gz Source1: media-server.service Source2: media-server-user.service Source3: media-server-user.path +Source4: media-server.path Source1001: %{name}.manifest Source1002: libmedia-utils.manifest Source1003: libmedia-utils-devel.manifest @@ -68,8 +69,12 @@ cp po/* . %if 0%{?product_tv} export CFLAGS="$CFLAGS -D_USE_SENIOR_MODE -D_USE_RECORDED_CONTENT -D_USE_SUSPEND_MODE" %else +%if "%{?profile}" == "mobile" +export CFLAGS="$CFLAGS -D_USE_MULTI_USER -D_USE_META_UPDATE -D_USE_DEVICED_DBUS -D_USE_SDCARD" +%else export CFLAGS="$CFLAGS -D_USE_MULTI_USER -D_USE_META_UPDATE -D_USE_DEVICED_DBUS" %endif +%endif export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -DSYSCONFDIR=\\\"%{_sysconfdir}\\\"" rm -rf autom4te.cache rm -f aclocal.m4 ltmain.sh @@ -235,7 +240,11 @@ install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/media-server.service mkdir -p %{buildroot}%{_unitdir_user} install -m 644 %{SOURCE2} %{buildroot}%{_unitdir_user}/media-server-user.service install -m 644 %{SOURCE3} %{buildroot}%{_unitdir_user}/media-server-user.path +%if "%{?profile}" == "mobile" +install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/media-server.path +%else ln -s ../media-server.service %{buildroot}%{_unitdir}/multi-user.target.wants/media-server.service +%endif #ini file mkdir -p %{buildroot}/etc/multimedia %if 0%{?product_tv} @@ -257,6 +266,9 @@ cp -rf %{_builddir}/%{name}-%{version}/data/media.db %{buildroot}/etc/multimedia # setup dbupdate in user session mkdir -p %{_unitdir_user}/basic.target.wants/ ln -sf ../media-server-user.path %{_unitdir_user}/basic.target.wants/ +%if "%{?profile}" == "mobile" +ln -sf ../media-server.path %{_unitdir}/multi-user.target.wants/ +%endif chmod 755 /etc/gumd/useradd.d/30_media-server-add.post buxton2ctl -i -u 100 create-int32 "system" "db/filemanager/dbupdate" "1" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public" buxton2ctl -i -u 100 create-int32 "system" "db/private/extractstatus" "1" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/public" @@ -280,7 +292,11 @@ buxton2ctl -i -u 100 create-int32 "system" "db/mediascanner/poweroff_status" "0" %{_bindir}/media-scanner-v2 %{_bindir}/mediadb-update %{_unitdir}/media-server.service +%if "%{?profile}" == "mobile" +%{_unitdir}/media-server.path +%else %{_unitdir}/multi-user.target.wants/media-server.service +%endif %{_unitdir_user}/media-server-user.service %{_unitdir_user}/media-server-user.path /etc/multimedia/media_content_config.ini diff --git a/src/server/media-server-main.c b/src/server/media-server-main.c index 31c6091..81d0842 100644 --- a/src/server/media-server-main.c +++ b/src/server/media-server-main.c @@ -47,12 +47,6 @@ #include "media-server-db-manage.h" #define MS_VCONF_KEY_RESET_STATUS "db/media_server/reset_status" -#ifdef _USE_SENIOR_MODE -#define DO_SCAN_ON_BOOT 1 /* 0: Don't scan on boot, 1: Do scan on boot */ -#else -#define DO_SCAN_ON_BOOT 0 /* 0: Don't scan on boot, 1: Do scan on boot */ -#endif - extern GMutex scanner_mutex; GMainLoop *mainloop = NULL; @@ -62,13 +56,11 @@ bool power_off; /*If this is TRUE, poweroff notification received*/ bool smarthub_reset_start; bool smarthub_reset; -#if DO_SCAN_ON_BOOT == 1 static void __ms_check_mediadb(void); #ifdef _USE_SDCARD static int __ms_check_mmc_status(void); #endif static int __ms_check_usb_status(void); -#endif static void __ms_add_signal_handler(void); static void __ms_add_event_receiver(GIOChannel *channel); static void __ms_add_request_receiver(GMainLoop *mainloop, GIOChannel **channel); @@ -400,10 +392,8 @@ int main(int argc, char **argv) sleep(1); } -#if DO_SCAN_ON_BOOT == 1 /* update media DB */ __ms_check_mediadb(); -#endif /*Active flush */ malloc_trim(0); @@ -540,7 +530,6 @@ static void __ms_add_signal_handler(void) } //////////////////////////////////////////////////////////////////// -#if DO_SCAN_ON_BOOT == 1 static char* __ms_get_path(uid_t uid) { int len = 0; @@ -645,8 +634,9 @@ static int __ms_check_usb_status(void) static void __ms_check_mediadb(void) { - uid_t uid = MEDIA_DEFAULT_UID; #ifndef _USE_MULTI_USER + uid_t uid = MEDIA_DEFAULT_UID; + void **db_handle = NULL; int ret = MS_MEDIA_ERR_NONE; @@ -683,10 +673,10 @@ static void __ms_check_mediadb(void) ms_disconnect_db(&db_handle); ms_unload_functions(); #endif - +/* ms_sys_get_uid(&uid); ms_send_storage_scan_request(__ms_get_path(uid), INTERNAL_STORAGE_ID, MS_SCAN_PART, uid); - +*/ #ifdef _USE_SENIOR_MODE if(ms_is_support_senior_mode()) { ms_send_storage_scan_request_senior_mode(db_handle); @@ -699,7 +689,6 @@ static void __ms_check_mediadb(void) #endif __ms_check_usb_status(); } -#endif static bool __ms_is_dcm_supported() {