Modify 3.0 to 4.0 upgrade script 41/144841/2 accepted/tizen/4.0/unified/20170829.020039 accepted/tizen/unified/20170822.023827 submit/tizen/20170821.062931 submit/tizen_4.0/20170828.100004
authorYunmi Ha <yunmi.ha@samsung.com>
Fri, 18 Aug 2017 06:30:41 +0000 (15:30 +0900)
committerYunmi Ha <yunmi.ha@samsung.com>
Fri, 18 Aug 2017 09:12:38 +0000 (18:12 +0900)
Change-Id: I9308d10eed667bc7fe7085f5c9f004db1e94f06b
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
packaging/200.filesystem-pre.patch.sh [deleted file]
packaging/201.tizen-platform-config_upgrade.sh [deleted file]
packaging/799.filesystem-post.patch.sh [deleted file]
packaging/tizen-platform-config.spec
scripts/200.filesystem-pre_24to30.patch.sh [new file with mode: 0644]
scripts/200.filesystem-pre_30to40.patch.sh [new file with mode: 0644]
scripts/201.tizen-platform-config_upgrade_24to30.sh [new file with mode: 0644]
scripts/799.filesystem-post_24to30.patch.sh [new file with mode: 0644]

diff --git a/packaging/200.filesystem-pre.patch.sh b/packaging/200.filesystem-pre.patch.sh
deleted file mode 100644 (file)
index ad7b965..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/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/201.tizen-platform-config_upgrade.sh b/packaging/201.tizen-platform-config_upgrade.sh
deleted file mode 100644 (file)
index b0f5606..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-#
-# RW update: tizen-platform-config
-#
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
-# tizen-platform-config post script
-. "/etc/tizen-platform.conf"
-cat << ENDOFCAT |
-MODE 777
-SMACK System::Shared true
-$TZ_SYS_STORAGE
-$TZ_SYS_MEDIA
-
-MODE 775
-SMACK User::Home false
-$TZ_SYS_DB
-$TZ_SYS_RW_PACKAGES
-$TZ_SYS_RW_APP
-
-SMACK System::Shared false
-$TZ_SYS_ETC
-
-ENDOFCAT
-while read s1 s2 s3; do
-  case "$s1" in
-    MODE) m="$s2";;
-    SMACK) c="$s2"; t="$s3";;
-    "") ;;
-    *) echo "$s1 ${m:-700} ${c:-_} ${t:-false}";;
-  esac
-done |
-LANG=C sort |
-while read dirname mode context transmute; do
-        if [ -e "$dirname" ]; then
-                chmod "$mode" "$dirname"
-        else
-                mkdir -p -m "$mode" "$dirname"
-        fi
-        if [ "$transmute" = true ]; then
-                chsmack -a "$context" -t "$dirname"
-        else
-                chsmack -a "$context" "$dirname"
-        fi >&2
-done
diff --git a/packaging/799.filesystem-post.patch.sh b/packaging/799.filesystem-post.patch.sh
deleted file mode 100644 (file)
index 3a6e9a0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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 154389450a82e7ed895e59f9e0f856b16c39e462..e9e451a4033901582e5b8d58d7b99105f53ef655 100644 (file)
@@ -11,9 +11,6 @@ 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-config-meta
 BuildRequires:  gperf
 # for sha256sum
@@ -66,9 +63,7 @@ cp %{SOURCE1001} .
 
 %install
 %make_install
-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
+install -m 755 scripts/200.filesystem-pre_30to40.patch.sh -D %{buildroot}%{_datadir}/upgrade/scripts/200.filesystem-pre.patch.sh
 rm %{buildroot}%{_libdir}/*.a
 
 %post
diff --git a/scripts/200.filesystem-pre_24to30.patch.sh b/scripts/200.filesystem-pre_24to30.patch.sh
new file mode 100644 (file)
index 0000000..2deb476
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# RW update filesystem-pre script (2.4 -> 3.0)
+#
+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/scripts/200.filesystem-pre_30to40.patch.sh b/scripts/200.filesystem-pre_30to40.patch.sh
new file mode 100644 (file)
index 0000000..88815df
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# RW update filesystem-pre script (3.0 -> 4.0)
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+source /usr/share/upgrade/rw-update-macro.inc
+source /etc/tizen-platform.conf
+
+# Make /opt/usr/media_shared directory
+if [ ! -e $TZ_SYS_MEDIASHARED ]; then
+    restore_backup_file -r $TZ_SYS_MEDIASHARED/
+fi
diff --git a/scripts/201.tizen-platform-config_upgrade_24to30.sh b/scripts/201.tizen-platform-config_upgrade_24to30.sh
new file mode 100644 (file)
index 0000000..adac2f0
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# RW update: tizen-platform-config (2.4 -> 3.0)
+#
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+# tizen-platform-config post script
+. "/etc/tizen-platform.conf"
+cat << ENDOFCAT |
+MODE 777
+SMACK System::Shared true
+$TZ_SYS_STORAGE
+$TZ_SYS_MEDIA
+
+MODE 775
+SMACK User::Home false
+$TZ_SYS_DB
+$TZ_SYS_RW_PACKAGES
+$TZ_SYS_RW_APP
+
+SMACK System::Shared false
+$TZ_SYS_ETC
+
+ENDOFCAT
+while read s1 s2 s3; do
+  case "$s1" in
+    MODE) m="$s2";;
+    SMACK) c="$s2"; t="$s3";;
+    "") ;;
+    *) echo "$s1 ${m:-700} ${c:-_} ${t:-false}";;
+  esac
+done |
+LANG=C sort |
+while read dirname mode context transmute; do
+        if [ -e "$dirname" ]; then
+                chmod "$mode" "$dirname"
+        else
+                mkdir -p -m "$mode" "$dirname"
+        fi
+        if [ "$transmute" = true ]; then
+                chsmack -a "$context" -t "$dirname"
+        else
+                chsmack -a "$context" "$dirname"
+        fi >&2
+done
diff --git a/scripts/799.filesystem-post_24to30.patch.sh b/scripts/799.filesystem-post_24to30.patch.sh
new file mode 100644 (file)
index 0000000..328ac04
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# RW update filesystem-post script (2.4 -> 3.0)
+#
+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