Upgrade: include filesystem RW update scripts 90/103990/1 accepted/tizen/3.0/common/20161213.163658 accepted/tizen/3.0/ivi/20161213.024655 accepted/tizen/3.0/mobile/20161213.024616 accepted/tizen/3.0/tv/20161213.024629 accepted/tizen/3.0/wearable/20161213.024639 submit/tizen_3.0/20161212.074914
authorSunmin Lee <sunm.lee@samsung.com>
Mon, 12 Dec 2016 04:45:18 +0000 (13:45 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Mon, 12 Dec 2016 04:45:18 +0000 (13:45 +0900)
Because filesystem has some issues to include update script in itself,
these are migrated into tizen-platform-config package.

Change-Id: Ia8375e8ee4021ec00cc46724cb6fec5bffcefd5d
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
packaging/200.filesystem-pre.patch.sh [new file with mode: 0644]
packaging/799.filesystem-post.patch.sh [new file with mode: 0644]
packaging/tizen-platform-config.spec

diff --git a/packaging/200.filesystem-pre.patch.sh b/packaging/200.filesystem-pre.patch.sh
new file mode 100644 (file)
index 0000000..ad7b965
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# RW update filesystem-pre script
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+OWNER_HOME=/opt/usr/home/owner
+
+rm -rf /var/lock
+ln -snf /run/lock /var/lock
+
+# The operations of generic-base.post
+chown root:root /opt/var/log
+chsmack -a '*' -t /opt/var/log
diff --git a/packaging/799.filesystem-post.patch.sh b/packaging/799.filesystem-post.patch.sh
new file mode 100644 (file)
index 0000000..3a6e9a0
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# RW update filesystem-post script
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+rm -rf /opt/usr/live
+rm -rf /opt/driver
+rm -rf /opt/storage
+
+# Migrate user contents to 3.0 path
+. /etc/tizen-platform.conf
+export `tzplatform-get --user $TZ_SYS_DEFAULT_USER TZ_USER_CONTENT`
+CONTENTS24=/opt/usr/media
+CONTENTS30=$TZ_USER_CONTENT
+
+cp -rT --preserve=mode,timestamps $CONTENTS24/DCIM      $CONTENTS30/Camera
+cp -rT --preserve=mode,timestamps $CONTENTS24/Documents $CONTENTS30/Documents
+cp -rT --preserve=mode,timestamps $CONTENTS24/Downloads $CONTENTS30/Downloads
+cp -rT --preserve=mode,timestamps $CONTENTS24/Images    $CONTENTS30/Images
+cp -rT --preserve=mode,timestamps $CONTENTS24/Music     $CONTENTS30/Music
+cp -rT --preserve=mode,timestamps $CONTENTS24/Others    $CONTENTS30/Others
+cp -rT --preserve=mode,timestamps $CONTENTS24/Sounds    $CONTENTS30/Sounds
+cp -rT --preserve=mode,timestamps $CONTENTS24/Videos    $CONTENTS30/Videos
+
+# Remove remain garbage files
+rm -rf $CONTENTS24
+mkdir -m 755 $CONTENTS24
+chsmack -a '_' $CONTENTS24
+rm -rf /opt/home/app
index 12c114c..45d5741 100644 (file)
@@ -1,6 +1,5 @@
 %define libname libtzplatform-config
 %define keepstatic 1
-%define upgrade 201.tizen-platform-config_upgrade.sh
 
 Name:           tizen-platform-config
 Version:        2.1
@@ -12,6 +11,9 @@ Group:          System/Configuration
 Source0:        %{name}-%{version}.tar.gz
 Source1:        %{name}-rpmlintrc
 Source1001:     %{name}.manifest
+Source1002:     201.tizen-platform-config_upgrade.sh
+Source2001:     200.filesystem-pre.patch.sh
+Source2002:     799.filesystem-post.patch.sh
 BuildRequires:  tizen-platform-wrapper >= 2
 BuildRequires:  tizen-platform-config-meta
 Requires(post): smack
@@ -62,7 +64,9 @@ cp %{SOURCE1001} .
 
 %install
 %make_install
-install -m 755 %{_sourcedir}/%{upgrade} -D %{buildroot}%{_datadir}/upgrade/scripts/%{upgrade}
+install -m 755 %{SOURCE1002} -D %{buildroot}%{_datadir}/upgrade/scripts/201.tizen-platform-config_upgrade.sh
+install -m 755 %{SOURCE2001} -D %{buildroot}%{_datadir}/upgrade/scripts/200.filesystem-pre.patch.sh
+install -m 755 %{SOURCE2002} -D %{buildroot}%{_datadir}/upgrade/scripts/799.filesystem-post.patch.sh
 
 %post
 ##############################################
@@ -158,7 +162,7 @@ HOME="$saveHOME"
 %manifest %{name}.manifest
 %license LICENSE
 %config %{_sysconfdir}/tizen-platform.conf
-%{_datadir}/upgrade/scripts/%{upgrade}
+%{_datadir}/upgrade/scripts/*
 
 %files -n %{libname}
 %manifest %{name}.manifest