version26
[kernel-power] / kernel-power-2.6.28 / debian / kernel-power-deinstall
1 #!/bin/sh
2
3 f=/tmp/kernel-power-msg
4 cat > $f <<EOF
5 This program will remove the enhanced power-user Linux kernel
6 and restore the original Nokia kernel.
7 The settings will be kept but will have no effect.
8
9 For the deinstallation please make sure that you are connected to
10 the Internet and that Application Manager is not running.
11
12 If you want keep the enhanced kernel, cancel the installation now
13 by tapping the blurred area above this dialog.
14 Otherwise confirm the dialog to proceed with the deinstallation.
15
16 After the installation, you need to shutdown your device and
17 boot it again to activate the original Nokia kernel.
18 EOF
19 maemo-confirm-text "Kernel-Power Flasher" $f
20 res=$?
21 rm -f $f
22 dbusmsg="run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint"
23
24 if test ! "$res" = 0; then
25     $dbusmsg string:"User has cancelled the deinstallation. No changes were made."
26     exit 1
27 fi
28
29 if pgrep -f /usr/bin/hildon-application-manager > /dev/null; then
30     $dbusmsg string:"Error: Application Manager is running. Please close it before deinstallation."
31     exit 1
32 fi
33
34 $dbusmsg string:"Please wait while deinstalling enhanced kernel..."
35
36 if apt-get install --reinstall -y kernel kernel-flasher | grep "cannot be downloaded"; then
37     $dbusmsg string:"Error during deinstallation. Could not install Nokia kernel."
38     exit 1
39 fi
40 if ! apt-get remove -y kernel-power kernel-power-modules; then
41     $dbusmsg string:"Warning: Could not remove enhanced kernel."
42 else
43     $dbusmsg string:"Kernel sucessfully deinstalled. Nokia kernel was restored."
44 fi
45