diff options
author | Sunmin Lee <sunm.lee@samsung.com> | 2016-08-11 15:48:43 +0900 |
---|---|---|
committer | Sunmin Lee <sunm.lee@samsung.com> | 2016-08-11 03:23:50 -0700 |
commit | c87a3b281d50ba1b25a8fbaf1dd4cb7d1c7dcddc (patch) | |
tree | 8b75a6bc2e9d658f93923b8e9e7d799cfcfc1cbb | |
parent | 4d47f99b2e37f14b324d7e46826a765f0360fe54 (diff) | |
download | system-plugin-c87a3b281d50ba1b25a8fbaf1dd4cb7d1c7dcddc.tar.gz system-plugin-c87a3b281d50ba1b25a8fbaf1dd4cb7d1c7dcddc.tar.bz2 system-plugin-c87a3b281d50ba1b25a8fbaf1dd4cb7d1c7dcddc.zip |
Upgrade: update initialize - create home directorysubmit/tizen/20160812.055757submit/tizen/20160812.014407accepted/tizen/wearable/20160812.065557accepted/tizen/wearable/20160812.065442accepted/tizen/tv/20160812.065555accepted/tizen/tv/20160812.065445accepted/tizen/mobile/20160812.065600accepted/tizen/mobile/20160812.065440accepted/tizen/ivi/20160812.065602accepted/tizen/ivi/20160812.065448accepted/tizen/common/20160812.141035
Because the home directory path is different between 2.4 and 3.0,
some additional actions for home directory is needed.
The init-update.service (init-update.sh) does it.
It preserves (not move) the previous home directory (/opt/home),
and just add new home directory (/opt/usr/home).
Change-Id: I5823c2d5902557f4b703a030ea5b144f65901222
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
-rw-r--r-- | packaging/system-plugin.spec | 5 | ||||
-rw-r--r-- | units/init-update.service | 8 | ||||
-rw-r--r-- | units/offline-update.service | 2 | ||||
-rwxr-xr-x | upgrade/update-init.sh | 15 | ||||
-rwxr-xr-x | upgrade/update.sh | 5 |
5 files changed, 33 insertions, 2 deletions
diff --git a/packaging/system-plugin.spec b/packaging/system-plugin.spec index ea3a330..0692726 100644 --- a/packaging/system-plugin.spec +++ b/packaging/system-plugin.spec @@ -155,8 +155,9 @@ install -m 755 scripts/tizen-fstrim-on-charge.sh %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_datadir} cp -r upgrade %{buildroot}%{_datadir} mkdir -p %{buildroot}%{_unitdir}/system-update.target.wants +install -m 644 units/init-update.service %{buildroot}%{_unitdir} install -m 644 units/offline-update.service %{buildroot}%{_unitdir} -#ln -s ../offline-update.service %{buildroot}%{_unitdir}/system-update.target.wants/offline-update.service +ln -s ../init-update.service %{buildroot}%{_unitdir}/system-update.target.wants/init-update.service ln -s %{_datadir}/upgrade %{buildroot}/system-update install -m 644 rules/99-sdb-switch.rules %{buildroot}%{_prefix}/lib/udev/rules.d/ @@ -262,6 +263,8 @@ mv %{_sysconfdir}/fstab_initrd %{_sysconfdir}/fstab %files -n system-upgrade %{_datadir}/upgrade %{_unitdir}/offline-update.service +%{_unitdir}/init-update.service #%{_unitdir}/system-update.target.wants/offline-update.service +%{_unitdir}/system-update.target.wants/init-update.service /system-update %{_prefix}/lib/udev/rules.d/99-sdb-switch.rules diff --git a/units/init-update.service b/units/init-update.service new file mode 100644 index 0000000..e438cb3 --- /dev/null +++ b/units/init-update.service @@ -0,0 +1,8 @@ +[Unit] +Description=System update initialize service +Requires=sysinit.target +After=sysinit.target + +[Service] +Type=simple +ExecStart=/system-update/update-init.sh diff --git a/units/offline-update.service b/units/offline-update.service index c90b4e0..ed00616 100644 --- a/units/offline-update.service +++ b/units/offline-update.service @@ -1,7 +1,7 @@ [Unit] Description=System update script service Requires=sysinit.target -After=sysinit.target +After=sysinit.target init-update.service [Service] Type=simple diff --git a/upgrade/update-init.sh b/upgrade/update-init.sh new file mode 100755 index 0000000..5c414ad --- /dev/null +++ b/upgrade/update-init.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# +# RW update initialize script +# +PATH=/bin:/usr/bin:/sbin:/usr/sbin +OWNER_HOME=/opt/usr/home/owner + +# Create home directory +test ! -e /opt/usr/home && mkdir -p /opt/usr/home + +if [ ! -d ${OWNER_HOME} ] +then + gum-utils --offline --delete-user --uid=5001 + gum-utils --offline --add-user --username=owner --usertype=admin --usecret=tizen +fi diff --git a/upgrade/update.sh b/upgrade/update.sh index 672b4cc..1aeb2e9 100755 --- a/upgrade/update.sh +++ b/upgrade/update.sh @@ -1,14 +1,18 @@ #!/bin/sh +# # RW update script +# PATH=/bin:/usr/bin:/sbin:/usr/sbin PATCH_DIR=/usr/share/upgrade/scripts RESULT_FILE=/upgrade_result RUN=/bin/sh +# Change to normal mode from next booting rm /system-update rm /usr/lib/udev/rules.d/99-sdb-switch.rules +# Execute update scripts if [ ! -d ${PATCH_DIR} ] then echo "FAIL: Upgrade directory does not exist" > ${RESULT_FILE} @@ -22,4 +26,5 @@ else echo "SUCCESS: Upgrade successfully finished" > ${RESULT_FILE} fi +# Reboot systemctl reboot |