2 tmp=/tmp/kernel-deinstall
4 This program will remove the enhanced power-user Linux kernel
5 and restore the original Nokia kernel.
6 The settings will be kept but will have no effect.
8 For the deinstallation please make sure that you are connected to
9 the Internet and that Application Manager is not running.
11 If you want keep the enhanced kernel, cancel the installation now
12 by tapping the blurred area above this dialog.
13 Otherwise confirm the dialog to proceed with the deinstallation.
15 After the installation, you need to unplug the USB cable,
16 completely shutdown your device, and boot again to activate the original Nokia kernel.
18 maemo-confirm-text "Kernel-Power Flasher" $tmp
21 dbus="run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications"
22 dbusmsg () { $dbus org.freedesktop.Notifications.SystemNoteInfoprint string:"$1"; }
23 dbusbox () { $dbus org.freedesktop.Notifications.SystemNoteDialog string:"$1" uint32:0 string:OK; }
25 if test "$res" != 0; then
26 dbusmsg "User has cancelled the deinstallation. No changes were made."
30 if pgrep -f /usr/bin/hildon-application-manager > /dev/null; then
31 dbusbox "Error: Application Manager is running. Please close it before deinstallation."
34 if pgrep -f apt-worker > /dev/null; then
35 dbusbox "Error: apt is running. Please wait and try again later."
39 dbusmsg "Please wait while restoring Nokia kernel..."
41 apt-get install --reinstall -y kernel kernel-flasher > $tmp
44 if grep -qE "(Could not resolve host|cannot be downloaded)" $tmp; then
45 dbusbox "Error during deinstallation: Could not download Nokia kernel. Please make sure the internet connection is working."
49 if test $ok = 0 && grep -q "Image flashed successfully" $tmp; then :
51 dbusbox "Error during deinstallation: Could not install Nokia kernel."
55 dbusmsg "Nokia kernel was restored. Removing enhanced kernel packages..."
56 apt-get remove -y kernel-power kernel-power-modules > $tmp
60 dbusbox "Kernel sucessfully deinstalled. Nokia kernel was restored."
62 dbusbox "Warning: Nokia kernel was restored but could not remove enhanced kernel."