summaryrefslogtreecommitdiffstats
path: root/tools/umount-live
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-03-15 13:58:31 +0000
committerOlivier Blin <blino@mageia.org>2011-03-15 13:58:31 +0000
commit4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5 (patch)
treef6d8d18d835eb7a25088d351663a29c5058532d5 /tools/umount-live
downloaddraklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar.gz
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar.bz2
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.tar.xz
draklive-config-4c4328833cb84e7e5e4eccbb385c9d4851bfd7b5.zip
import initial live config
Diffstat (limited to 'tools/umount-live')
-rw-r--r--tools/umount-live48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/umount-live b/tools/umount-live
new file mode 100644
index 0000000..098c82e
--- /dev/null
+++ b/tools/umount-live
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: umount-live
+# Default-Stop: 0 6
+# Should-Stop: $remote_fs
+# Short-Description: Umounts live-system-specific mountpoints on
+#halt/reboot
+# Description: This service umounts live-system-specific mountpoints
+#on halt/reboot.
+### END INIT INFO
+
+mypath=$_
+
+case "$1" in
+ *start)
+ ;;
+ *stop)
+ exit
+ ;;
+ *)
+ gprintf "Usage: %s\n" "$(basename $0) {start}"
+ exit 1
+ ;;
+esac
+
+roottype=`awk '$2 == "/" { print $3 }' /etc/fstab`
+
+if [ "$roottype" != unionfs ]; then
+ # disable self during first halt when installed
+ chkconfig --del $(basename $0)
+ #rm -f $mypath
+ exit
+fi
+
+maybe_umount() {
+ eval d=\$$#
+ [ -e $d ] && umount $@
+}
+
+maybe_umount -l /live/distrib
+maybe_umount -l /live/memory
+maybe_umount -l /live/system
+maybe_umount -l /live/media
+
+maybe_umount /var/lib/rpm
+maybe_umount /tmp/rpm/real
+maybe_umount /tmp/rpm