Skip to content

Commit

Permalink
Better handle the restore scripts (bsc#1089643) (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed May 2, 2018
1 parent 823cd43 commit 54ac889
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
9 changes: 9 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Apr 27 13:22:53 UTC 2018 - lslezak@suse.cz

- Better handle the restore scripts when YaST is aborted or
crashes (bsc#1089643)
- Delete the .repo files accidentally saved into inst-sys
(fixes problems when restarting YaST after abort or crash)
- 4.0.54

-------------------------------------------------------------------
Wed Apr 25 10:43:58 UTC 2018 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-installation
Version: 4.0.53
Version: 4.0.54
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
4 changes: 4 additions & 0 deletions startup/First-Stage/F09-start
Expand Up @@ -17,6 +17,10 @@ callHooks preFirstCall
# Using /dev/null - If there is nothing to do, let it fail silently
SUSEConnect --cleanup > /dev/null 2>&1

# delete the repositories accidentally saved into inst-sys
# they make troubles when restarting YaST
rm -fv /etc/zypp/repos.d/*.repo

#=============================================
# 9.1) check for driver update mode
#---------------------------------------------
Expand Down
11 changes: 10 additions & 1 deletion startup/YaST2.call
Expand Up @@ -277,7 +277,9 @@ function ssh_reboot_message()
function restore_backup () {
# restores backup if it is available
if [ -d /mnt/var/adm/backup/system-upgrade ]; then
log "\tStarting restore scripts"
for i in /mnt/var/adm/backup/system-upgrade/restore-*.sh; do
log "\tStarting $i"
sh $i /mnt
done
fi
Expand Down Expand Up @@ -334,6 +336,7 @@ function start_yast () {
tee /var/log/YaST2/gdb-log
Y2_EXIT_CODE=$?
fi
log "\tY2_EXIT_CODE: $Y2_EXIT_CODE"

Y2_ABORT_MESSAGE="YaST seems to be aborted abnormally !"
Y2_OK_MESSAGE="YaST procedure ended successfully"
Expand All @@ -344,7 +347,6 @@ function start_yast () {
cat /etc/yast.inf | grep -q -i "Aborted: 1"
if [ $? = 0 ];then
log "\t$Y2_ABORT_MESSAGE"
restore_backup
fi
else
#=============================================
Expand Down Expand Up @@ -658,6 +660,13 @@ if [ "$server_running" = 1 ];then
done
fi

if [ -s /etc/yast.inf ];then
# aborted, restore the upgrade backup
grep -q -i "^Aborted:[ \t]*1" /etc/yast.inf && restore_backup
# no abort, not reboot status => YaST crashed, restore the upgrade backup
grep -q -i -v -e "^Aborted:" -e "^Root:" /etc/yast.inf && restore_backup
fi

#=============================================
# 10) exit with YaST2 exit code
#---------------------------------------------
Expand Down

0 comments on commit 54ac889

Please sign in to comment.