#!/bin/sh
log "Starting F10-cleanup..."
log "======================="

#=============================================
# 10) first stage done, cleanup and save level
#---------------------------------------------
# 10.1) reverse umount file systems...
awk '/ \/mnt/{ print $2 }' /proc/mounts | sort -r | xargs --no-run-if-empty umount
# 10.2) turn off swap space (files and partitions)
swapoff -a
# 10.3) unmount update filesystem
if [ "$UPDATE_MOUNTED" = true ];then
	umount /y2update
fi

#=============================================
# 10.4) write exit code for evaluation
#---------------------------------------------
log "\tYaST2 exit code on level (1): $yast2exitcode"
echo $yast2exitcode > /tmp/YaST2-First-Stage-Exit-Code
stop_unicode
