From 71f4fa016c4f0a987e76b0cff9279667c4f455a7 Mon Sep 17 00:00:00 2001 From: liwei Date: Fri, 24 Sep 2021 18:53:30 +0800 Subject: [PATCH] [Service][VD] Apply DeviceHome as squashfs format 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 --- device_home/config.xml | 2 +- packaging/wrtjs.spec | 21 +++++++++++++++------ tizen/build/build_app.sh | 13 +++++++++---- 3 files changed, 25 insertions(+), 11 deletions(-) mode change 100755 => 100644 device_home/config.xml mode change 100755 => 100644 packaging/wrtjs.spec diff --git a/device_home/config.xml b/device_home/config.xml old mode 100755 new mode 100644 index c2a3e423..d354aef4 --- a/device_home/config.xml +++ b/device_home/config.xml @@ -13,7 +13,7 @@ - + DeviceHomeService DeviceHomeService diff --git a/packaging/wrtjs.spec b/packaging/wrtjs.spec old mode 100755 new mode 100644 index 0f871d86..bdb6e240 --- a/packaging/wrtjs.spec +++ b/packaging/wrtjs.spec @@ -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 diff --git a/tizen/build/build_app.sh b/tizen/build/build_app.sh index fc900a7f..2c1a7d3f 100755 --- a/tizen/build/build_app.sh +++ b/tizen/build/build_app.sh @@ -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} -- 2.34.1