From 8f6f792b009118f15a3a4ab2f40b7b1051144e35 Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Mon, 13 Sep 2021 11:04:24 +0900 Subject: [PATCH] [Service][VD] Apply DeviceHome as squashfs format 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: I8b00c5c742b862f394e3269c483cea926b4311e2 Signed-off-by: DongHyun Song --- device_home/config.xml | 2 +- packaging/wrtjs.spec | 21 +++++++++++++++------ tizen/build/build_app.sh | 13 +++++++++---- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/device_home/config.xml b/device_home/config.xml index c2a3e42..d354aef 100755 --- 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 index 1e5a941..3129a72 100755 --- a/packaging/wrtjs.spec +++ b/packaging/wrtjs.spec @@ -33,6 +33,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) @@ -183,14 +186,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 0644 %{buildroot}/%{_d2d_app_file_name} %{buildroot}%{_appdir}/.preload-rw-wgt/ + rm -f %{buildroot}/%{_d2d_app_file_name} %endif %if 0%{?_use_nmt} @@ -232,7 +241,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 @@ -245,7 +254,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 fc900a7..2c1a7d3 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.7.4