summaryrefslogtreecommitdiffstats
path: root/rescue/restore-image-lib.sh
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-09-25 18:35:38 +0000
committerOlivier Blin <oblin@mandriva.com>2008-09-25 18:35:38 +0000
commit74f05c5a4d1010f388bb7f360464f32a5d75ef92 (patch)
tree30a31758b55ac66b708d803e8d158088afca20e8 /rescue/restore-image-lib.sh
parentfd8293630e710c3da9ce840c57384639c4289209 (diff)
downloaddrakx-74f05c5a4d1010f388bb7f360464f32a5d75ef92.tar
drakx-74f05c5a4d1010f388bb7f360464f32a5d75ef92.tar.gz
drakx-74f05c5a4d1010f388bb7f360464f32a5d75ef92.tar.bz2
drakx-74f05c5a4d1010f388bb7f360464f32a5d75ef92.tar.xz
drakx-74f05c5a4d1010f388bb7f360464f32a5d75ef92.zip
add image restoration scripts ("restore" command line parameter) from Classmate installer (Caio Begotti)
Diffstat (limited to 'rescue/restore-image-lib.sh')
-rwxr-xr-xrescue/restore-image-lib.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/rescue/restore-image-lib.sh b/rescue/restore-image-lib.sh
new file mode 100755
index 000000000..a56ac27e8
--- /dev/null
+++ b/rescue/restore-image-lib.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+TITLE=" Classmate Installation "
+BACKTITLE="Mandriva - Intel"
+
+debug="/dev/null"
+
+function _msgbox()
+{
+ dialog --timeout 60 --backtitle "$BACKTITLE" --title "$TITLE" --msgbox \
+ "$1" 0 0
+
+ return $?
+}
+
+function _infobox()
+{
+ dialog --backtitle "$BACKTITLE" --title "$TITLE" --sleep 2 \
+ --infobox "$1" 0 0
+
+ return $?
+}
+
+function _yesno()
+{
+ dialog --backtitle "$BACKTITLE" --title "$TITLE" \
+ --yes-label "Yes" --no-label "No" --yesno "$1" 0 0
+
+ return $?
+}
+
+function _mount()
+{
+ mount $1 $2 > $debug 2>&1
+
+ return $?
+}
+
+function _umount()
+{
+ umount $1 > $debug 2>&1
+
+ return $?
+}
+
+function _bind()
+{
+ mount --bind $1 $2 > $debug 2>&1
+
+ return $?
+}
+
+function _eject()
+{
+ eject $1 > $debug 2>&1
+
+ return $?
+}
+
+function _shutdown()
+{
+ clear
+ sync
+ echo s > /proc/sysrq-trigger
+ echo o > /proc/sysrq-trigger
+ exit
+}
+
+function _reboot()
+{
+ clear
+ sync
+ echo s > /proc/sysrq-trigger
+ echo b > /proc/sysrq-trigger
+ exit
+}
+