summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyoungJune Park <mj2004.park@samsung.com>2017-11-02 08:19:37 (GMT)
committerMyoungJune Park <mj2004.park@samsung.com>2017-11-02 08:20:43 (GMT)
commite6011c76ced62504364024c2bfd856deab1f65af (patch)
tree73ed785b73f410db8a0cfe654369f5a528a78ea8
parenta7a5b789b81570c4cc106faaea9899403a979327 (diff)
parent3f07f2cda3e23c51979b0bbf83f4b2ca2a4de1a1 (diff)
downloadfactory-reset-accepted/tizen/4.0/unified/20171103.030250.zip
factory-reset-accepted/tizen/4.0/unified/20171103.030250.tar.gz
factory-reset-accepted/tizen/4.0/unified/20171103.030250.tar.bz2
Change-Id: Idbdf974a747664573889fc1a32e5026a9c2e4564 Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
-rw-r--r--CMakeLists.txt47
-rw-r--r--packaging/factory-reset.service1
-rwxr-xr-xpackaging/factory-reset.spec17
-rwxr-xr-xscript/run-factory-reset.sh4
4 files changed, 6 insertions, 63 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 992c58a..a18208b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,44 +10,12 @@ SET(VERSION 0.1)
SET(SRCS_RESET_CCMODE src/resetCCMode.c)
SET(SRCS_RSTSMACK src/rstsmack.c)
-SET(SRCS_UTIL src/factory-reset-util.c)
SET(SRCS src/factory-reset.c)
-SET(EDJ_SRCS ${CMAKE_SOURCE_DIR}/data/factory-reset-util.edc)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-#IF("$ENV{CFLAGS}" MATCHES "-DTELEPHONY_DISABLE")
-# MESSAGE("add -DTELEPHONY_DISABLE")
-#ELSE()
-# SET(PKG_MODULES ${PKG_MODULES}
-# tapi modem
-# )
-#ENDIF()
-
-#IF("$ENV{CFLAGS}" MATCHES "-DCSC_DISABLE")
-# MESSAGE("add -DCSC_DISABLE")
-#ELSE()
-# SET(PKG_MODULES ${PKG_MODULES}
-# csc-manager
-# )
-#ENDIF()
-
-IF("${DISPLAY_RESOLUTION}" STREQUAL "320x320")
- MESSAGE("font size is 22")
- ADD_DEFINITIONS("-DFACTORY_RESET_FONT_SIZE=22")
- SET(EDJ_SRCS ${CMAKE_SOURCE_DIR}/data/factory-reset-util-small-display.edc)
-ELSEIF("${DISPLAY_RESOLUTION}" STREQUAL "360x480")
- MESSAGE("font size is 24")
- ADD_DEFINITIONS("-DFACTORY_RESET_FONT_SIZE=24")
- SET(EDJ_SRCS ${CMAKE_SOURCE_DIR}/data/factory-reset-util-small-display.edc)
-ELSEIF("${DISPLAY_RESOLUTION}" STREQUAL "480x800")
- MESSAGE("font size is 24")
- ADD_DEFINITIONS("-DFACTORY_RESET_FONT_SIZE=24")
-ENDIF()
-
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED appcore-efl evas edje elementary
- libsmack dbus-1 dbus-glib-1 ${PKG_MODULES} )
+pkg_check_modules(pkgs REQUIRED libsmack dbus-1 dbus-glib-1 ${PKG_MODULES} )
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -73,19 +41,10 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
ADD_EXECUTABLE(resetCCMode ${SRCS_RESET_CCMODE})
ADD_EXECUTABLE(rstsmack ${SRCS_RSTSMACK})
-ADD_EXECUTABLE(factory-reset-util ${SRCS_UTIL})
ADD_EXECUTABLE(factory-reset ${SRCS})
TARGET_LINK_LIBRARIES(rstsmack ${pkgs_LDFLAGS} -pie)
-TARGET_LINK_LIBRARIES(factory-reset-util ${pkgs_LDFLAGS} -pie)
TARGET_LINK_LIBRARIES(factory-reset ${pkgs_LDFLAGS} -pie)
-ADD_CUSTOM_TARGET(factory-reset-util.edj
- COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images
- ${EDJ_SRCS} ${CMAKE_BINARY_DIR}/data/factory-reset-util.edj
- DEPENDS ${EDJ_SRCS}
-)
-ADD_DEPENDENCIES(factory-reset-util factory-reset-util.edj)
-
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/script/run-factory-reset.sh DESTINATION bin)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/script/factoryreset-verify.sh DESTINATION bin)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/script/factoryreset-verify-result.sh DESTINATION bin)
@@ -93,13 +52,11 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/script/build-backup-data.sh DESTINATIO
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/script/dump-frlog.sh DESTINATION /opt/etc/dump.d/module.d)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/factory-reset.rule DESTINATION /etc/smack/accesses2.d)
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/rstsmack DESTINATION bin)
-INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/factory-reset-util DESTINATION bin)
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/factory-reset DESTINATION bin)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/data/factory-reset-util.edj DESTINATION ${EDJDIR})
IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_CC")
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/resetCCMode DESTINATION bin)
ENDIF()
#add sub directory
-ADD_SUBDIRECTORY(po)
+#ADD_SUBDIRECTORY(po)
diff --git a/packaging/factory-reset.service b/packaging/factory-reset.service
index bc51fab..ab6a4a4 100644
--- a/packaging/factory-reset.service
+++ b/packaging/factory-reset.service
@@ -5,6 +5,7 @@ ConditionPathExists=|/opt/.factoryreset
[Service]
Type=oneshot
+ExecStartPre=/usr/bin/rm -f /opt/.factoryreset
ExecStart=/usr/bin/factory-reset
SmackProcessLabel=System
diff --git a/packaging/factory-reset.spec b/packaging/factory-reset.spec
index 685543b..0662111 100755
--- a/packaging/factory-reset.spec
+++ b/packaging/factory-reset.spec
@@ -10,15 +10,6 @@ Source2: factory-reset-launch.service
Source3: org.tizen.factory-reset.service
ExclusiveArch: %{arm}
BuildRequires: cmake
-BuildRequires: gettext-tools
-BuildRequires: edje-bin
-BuildRequires: embryo-bin
-BuildRequires: pkgconfig(appcore-efl)
-BuildRequires: pkgconfig(elementary)
-#BuildRequires: pkgconfig(ecore-x)
-#BuildRequires: pkgconfig(utilX)
-BuildRequires: pkgconfig(evas)
-BuildRequires: pkgconfig(edje)
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dbus-glib-1)
@@ -80,7 +71,6 @@ install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/factory-reset.ser
install -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/factory-reset-launch.service
ln -s ../factory-reset.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/factory-reset.service
mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
-#install -m 0644 %SOURCE3 %{buildroot}%{_datadir}/dbus-1/services/org.tizen.factory-reset.service
install -m 0644 %SOURCE3 %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.factory-reset.service
%post
@@ -96,11 +86,7 @@ install -m 0644 %SOURCE3 %{buildroot}%{_datadir}/dbus-1/system-services/org.tize
/etc/smack/accesses2.d/%{name}.rule
%attr(700,root,root) %{_bindir}/*.sh
%attr(755,root,root) %{_bindir}/rstsmack
-%attr(700,root,root) %{_bindir}/factory-reset-util
%attr(744,root,root) %{_bindir}/factory-reset
-%{_datadir}/edje/factory-reset-util.edj
-%{_datadir}/locale/*/*/*.mo
-#%{_datadir}/dbus-1/services/org.tizen.factory-reset.service
%{_datadir}/dbus-1/system-services/org.tizen.factory-reset.service
%manifest factory-reset.manifest
%attr(110,root,root) /opt/etc/dump.d/module.d/dump-frlog.sh
@@ -108,6 +94,3 @@ install -m 0644 %SOURCE3 %{buildroot}%{_datadir}/dbus-1/system-services/org.tize
%if 0%{?sec_product_feature_security_mdfpp_enable}
%attr(700,root,root) %{_bindir}/resetCCMode
%endif
-
-
-
diff --git a/script/run-factory-reset.sh b/script/run-factory-reset.sh
index 800a413..5486906 100755
--- a/script/run-factory-reset.sh
+++ b/script/run-factory-reset.sh
@@ -125,7 +125,8 @@ fs_ready() {
/bin/mkdir -p $USRDATADIR
/bin/mount $USRDATADIR
mret=`/bin/grep "$USRDATADIR " /proc/mounts | /usr/bin/awk '{print $1}'`
- device=`/bin/grep "$USRDATADIR" /etc/fstab | /usr/bin/awk '{print $1}'`
+ #device=`/bin/grep "$USRDATADIR" /etc/fstab | /usr/bin/awk '{print $1}'`
+ device=`blkid --match-token PARTLABEL=user -o device`
device=`/usr/bin/readlink -f $device`
if [[ "z$mret" != "z" && "$mret" != "$device" ]]; then
echo "$mret != $device" >> $logfile
@@ -136,6 +137,7 @@ fs_ready() {
# mount failed. format and remount
echo "$USRDATADIR mount failed. format and retry to mount again" >> $logfile
fstype=`/bin/grep "$USRDATADIR " /etc/fstab | /usr/bin/awk '{print $3}'`
+ fstype=`blkid --match-token PARTLABEL=user -o device`
/sbin/mkfs.$fstype $device -F
/bin/mount -t $fstype $device $USRDATADIR
fi