2 tmp=/tmp/kernel-deinstall
4 This program will remove the BFS Linux kernel
5 and restore the original Nokia kernel.
6 The settings will be kept but will have no effect.
7 Warning: This deinstallation method is currently experimental and could lead to a bricked device.
8 For a safe but manual deinstallation method please visit http://wiki.maemo.org/Kernel_Power
10 For the deinstallation please make sure that you are connected to
11 the Internet and that Application Manager is not running.
13 If you want keep the enhanced kernel, cancel the installation now
14 by tapping the blurred area above this dialog.
15 Otherwise confirm the dialog to proceed with the deinstallation.
17 After the installation, you need to unplug the USB cable,
18 completely shutdown your device, and boot again to activate the original Nokia kernel.
20 maemo-confirm-text "Kernel-Power Flasher" $tmp
23 dbus="run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications"
24 dbusmsg () { $dbus org.freedesktop.Notifications.SystemNoteInfoprint string:"$1"; }
25 dbusbox () { $dbus org.freedesktop.Notifications.SystemNoteDialog string:"$1" uint32:0 string:OK; }
27 if test "$res" != 0; then
28 dbusmsg "User has cancelled the deinstallation. No changes were made."
32 if pgrep -f /usr/bin/hildon-application-manager > /dev/null; then
33 dbusbox "Error: Application Manager is running. Please close it before deinstallation."
36 if pgrep -f apt-worker > /dev/null; then
37 dbusbox "Error: apt is running. Please wait and try again later."
41 dbusmsg "Please wait while restoring Nokia kernel..."
43 apt-get install --reinstall -y kernel kernel-flasher > $tmp
46 if grep -qE "(Could not resolve host|cannot be downloaded)" $tmp; then
47 dbusbox "Error during deinstallation: Could not download Nokia kernel. Please make sure the internet connection is working."
51 if test $ok = 0 && grep -q "Image flashed successfully" $tmp; then :
53 dbusbox "Error during deinstallation: Could not install Nokia kernel."
57 dbusmsg "Nokia kernel was restored. Removing enhanced kernel packages..."
58 apt-get remove -y kernel-bfs kernel-bfs-modules > $tmp
62 dbusbox "Kernel sucessfully deinstalled. Nokia kernel was restored."
64 dbusbox "Warning: Nokia kernel was restored but could not remove enhanced kernel."