[Service][VD] Apply DeviceHome as squashfs format 68/264568/1
authorliwei <wei90727.li@samsung.com>
Fri, 24 Sep 2021 10:53:30 +0000 (18:53 +0800)
committerliwei <wei90727.li@samsung.com>
Fri, 24 Sep 2021 11:00:29 +0000 (19:00 +0800)
This patch is uploaded again, and chmod 755 to
/usr/apps/.preload-rw-wgt/device_home.tmg to avoid
create image fail in Cosmos.

Apply squashfs app to reduce app size in TV profile.
This will reduce DeviceHome application 9.2MB(unzipped) --> 1.9MB

Plus, this removes DeviceHome's onboot option either. DeviceHome will
be launched by wrt-service-broker.

Note.
privileged-service should add mount policies for wgt-backend first.
Then, this patch can release to VD p4

Change-Id: Ief92f8a780b3b7cd28596f86c5239c96f25e3aba
Signed-off-by: liwei <wei90727.li@samsung.com>
device_home/config.xml [changed mode: 0755->0644]
packaging/wrtjs.spec [changed mode: 0755->0644]
tizen/build/build_app.sh

old mode 100755 (executable)
new mode 100644 (file)
index c2a3e42..d354aef
@@ -13,7 +13,7 @@
     <tizen:privilege name="http://tizen.org/privilege/filesystem.write"/>
     <tizen:privilege name="http://tizen.org/privilege/internet"/>
     <tizen:privilege name="http://tizen.org/privilege/mediastorage"/>
-    <tizen:service id="9z6IujVul3.DeviceHome" type="global" auto-restart="true" on-boot="true">
+    <tizen:service id="9z6IujVul3.DeviceHome" type="global">
         <tizen:content src="service.js"/>
         <tizen:name>DeviceHomeService</tizen:name>
         <tizen:description>DeviceHomeService</tizen:description>
old mode 100755 (executable)
new mode 100644 (file)
index 0f871d8..bdb6e24
@@ -37,6 +37,9 @@ BuildRequires: pkgconfig(dlog)
 
 %if "%{?profile}" == "tv"
 BuildRequires: app-signer
+%if 0%{?_use_d2d}
+BuildRequires: squashfs
+%endif
 %endif
 BuildRequires: hash-signer, zip
 BuildRequires: pkgconfig(libtzplatform-config)
@@ -192,14 +195,20 @@ cp -r %{app_dir}/* %{buildroot}%{_resourcedir}/
 %endif
 
 %if 0%{?_use_d2d}
-  %define _d2d_wgt_file_name device_home.wgt
+%if "%{?tizen_profile_name}" == "tv"
+  %define _d2d_app_file_name device_home.tmg
+  %define _d2d_app_extension tmg
+%else
+  %define _d2d_app_file_name device_home.wgt
+  %define _d2d_app_extension wgt
+%endif
   install -m 0644 key.pem device_home/signaling_server/gen/
   install -m 0644 cert.pem device_home/signaling_server/gen/
-  tizen/build/build_app.sh %{buildroot} device_home %{_d2d_wgt_file_name} wgt platform %{?profile}
+  tizen/build/build_app.sh %{buildroot} device_home %{_d2d_app_file_name} %{_d2d_app_extension} platform %{?profile}
 
   install -d %{buildroot}%{_appdir}/.preload-rw-wgt/
-  install -m 0644 %{buildroot}/%{_d2d_wgt_file_name} %{buildroot}%{_appdir}/.preload-rw-wgt/
-  rm -f %{buildroot}/%{_d2d_wgt_file_name}
+  install -m 0755 %{buildroot}/%{_d2d_app_file_name} %{buildroot}%{_appdir}/.preload-rw-wgt/
+  rm -f %{buildroot}/%{_d2d_app_file_name}
 %endif
 
 %if 0%{?_use_nmt}
@@ -248,7 +257,7 @@ fi
 %post
 %if "%{?_local_build}" == "1"
 %if 0%{?_use_d2d}
-  pkgcmd -i -t wgt -p %{_appdir}/.preload-rw-wgt/%{_d2d_wgt_file_name}
+  pkgcmd -i -t wgt -p %{_appdir}/.preload-rw-wgt/%{_d2d_app_file_name}
 %endif
 %endif
 
@@ -261,7 +270,7 @@ rm -fr %{buildroot}
 %manifest packaging/wrtjs.manifest
 %license LICENSE
 %if 0%{?_use_d2d}
-  %{_appdir}/.preload-rw-wgt/%{_d2d_wgt_file_name}
+  %{_appdir}/.preload-rw-wgt/%{_d2d_app_file_name}
 %endif
 %if "%{?tizen_profile_name}" != "tv"
   %caps(cap_setgid,cap_sys_admin=ei) %{_bindir}/wrt-loader
index fc900a7..2c1a7d3 100755 (executable)
@@ -26,7 +26,7 @@ if [ "${file_extension}" == "tpk" ]; then
   install -m 0644 packaging/tizen-manifest-tpk.xml ${source_path}/tizen-manifest.xml
   install -m 0644 LICENSE ${source_path}/license
   cp -rf out/gen/app ${source_path}/shared/res/wrt/app
-elif [ "${file_extension}" == "wgt" ]; then
+elif [ "${file_extension}" == "wgt" -o "${file_extension}" == "tmg" ]; then
   # DeviceHome
   cp -rf device_home ${source_path}
 else
@@ -37,14 +37,19 @@ fi
 # Test signing
 /usr/bin/hash-signer.sh -a -d -p ${privilege} -b ${output_path} ${source_dir_name}
 
+if [ "${file_extension}" == "wgt" ]; then
 pushd ${source_path}
 echo "* zip"
-zip -yr $file_name .
-mv $file_name ../
+zip -yr ${file_name} .
+mv ${file_name} ../
 popd
+elif [ "${file_extension}" == "tmg" ]; then
+echo "mksquashfs ${source_path} ${output_path}/${file_name} -comp gzip"
+mksquashfs ${source_path} ${output_path}/${file_name} -comp gzip
+fi
 
 # tpkresigning from app-signer package
-if [ "${profile}" == "tv" -a "${privilege}" != "public" ]; then
+if [ "${profile}" == "tv" -a "${privilege}" != "public" -a "${file_extension}" == "wgt" ]; then
   tpkresigner -a -d -p ${privilege} -n %{4} ${output_path}/${file_name}
 fi
 ls ${output_path}