systemd: check mounting before sending booting-done signal 42/87042/3
authorKichan Kwon <k_c.kwon@samsung.com>
Tue, 6 Sep 2016 04:43:57 +0000 (13:43 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Fri, 9 Sep 2016 04:23:07 +0000 (13:23 +0900)
- In current, lazy mount is applied at the mobile profile
- To check whether /opt/usr is mounted, we use specific file made by lazy_mount

Change-Id: Icf9e575607886e824e37deadf44d53bf944968c2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
CMakeLists.txt
packaging/deviced.spec
systemd/zbooting-done.path [new file with mode: 0644]
systemd/zbooting-done.service.in [moved from systemd/zbooting-done.service with 100% similarity]
systemd/zbooting-done_lazy_mount.service.in [new file with mode: 0644]

index 2cdb2f0..4c5eec2 100755 (executable)
@@ -263,6 +263,18 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/systemd/ DESTINATION lib/systemd/s
                PATTERN "sdb-prestart.service" EXCLUDE
                PATTERN "deviced-vibrator.service" EXCLUDE)
 
+# zbooting-done
+IF(${TIZEN_FEATURE_LAZY_MOUNT} STREQUAL on)
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/zbooting-done_lazy_mount.service.in
+               DESTINATION lib/systemd/system
+               RENAME zbooting-done.service)
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/zbooting-done.path DESTINATION lib/systemd/system)
+ELSE()
+       INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/zbooting-done.service.in
+               DESTINATION lib/systemd/system
+               RENAME zbooting-done.service)
+ENDIF()
+
 ADD_SUBDIRECTORY(src/shared)
 ADD_SUBDIRECTORY(src/libdeviced)
 ADD_SUBDIRECTORY(src/devicectl)
index 5228be9..ff83431 100644 (file)
@@ -26,6 +26,9 @@
 # Support two pattern combination vibration
 %define standard_mix off
 
+# Start zbooting-done after lazy mount is finished
+%define TIZEN_FEATURE_LAZY_MOUNT off
+
 %if "%{?profile}" == "mobile"
 %define battery_module on
 %define haptic_module on
@@ -34,6 +37,7 @@
 %define touchscreen_module on
 %define tzip_module on
 %define usbhost_module on
+%define TIZEN_FEATURE_LAZY_MOUNT on
 %endif
 %if "%{?profile}" == "wearable"
 %define battery_module on
@@ -187,6 +191,7 @@ Deviced library for device control (devel)
        -DTZIP_MODULE=%{tzip_module} \
        -DUSB_MODULE=%{usb_module} \
        -DUSBHOST_MODULE=%{usbhost_module} \
+       -DTIZEN_FEATURE_LAZY_MOUNT=%{TIZEN_FEATURE_LAZY_MOUNT} \
        #eol
 
 %build
@@ -200,7 +205,12 @@ rm -rf %{buildroot}
 
 %install_service multi-user.target.wants deviced.service
 %install_service sockets.target.wants deviced.socket
+
+%if %{?TIZEN_FEATURE_LAZY_MOUNT} == on
+%install_service graphical.target.wants zbooting-done.path
+%else
 %install_service graphical.target.wants zbooting-done.service
+%endif
 
 %if %{?haptic_module} == on
 %install_service multi-user.target.wants deviced-vibrator.service
@@ -257,7 +267,12 @@ systemctl daemon-reload
 %{_bindir}/deviced-vibrator
 %endif
 %{_unitdir}/sockets.target.wants/deviced.socket
+%if %{?TIZEN_FEATURE_LAZY_MOUNT} == on
+%{_unitdir}/graphical.target.wants/zbooting-done.path
+%{_unitdir}/zbooting-done.path
+%else
 %{_unitdir}/graphical.target.wants/zbooting-done.service
+%endif
 %{_unitdir}/deviced.service
 %{_unitdir}/deviced.socket
 %{_unitdir}/zbooting-done.service
diff --git a/systemd/zbooting-done.path b/systemd/zbooting-done.path
new file mode 100644 (file)
index 0000000..92ddc5f
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=Booting done
+
+[Path]
+PathExists=/run/.unlock_mnt
diff --git a/systemd/zbooting-done_lazy_mount.service.in b/systemd/zbooting-done_lazy_mount.service.in
new file mode 100644 (file)
index 0000000..ad48c2e
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Booting Done
+After=default.target
+
+[Service]
+Type=oneshot
+SmackProcessLabel=System
+ExecStart=/usr/bin/dbus-send --type=signal --system /Org/Tizen/System/DeviceD/Core org.tizen.system.deviced.core.BootingDone
+User=system_share
+Group=system_share