#!/bin/sh tmp=/tmp/kernel-deinstall cat > $tmp < /dev/null; then dbusbox "Error: Application Manager is running. Please close it before deinstallation." exit 1 fi if pgrep -f apt-worker > /dev/null; then dbusbox "Error: apt is running. Please wait and try again later." exit 1 fi dbusmsg "Please wait while restoring Nokia kernel..." apt-get install --reinstall -y kernel kernel-flasher > $tmp ok=$? cat $tmp if grep -qE "(Could not resolve host|cannot be downloaded)" $tmp; then dbusbox "Error during deinstallation: Could not download Nokia kernel. Please make sure the internet connection is working." rm $tmp exit 1 fi if test $ok = 0 && grep -q "Image flashed successfully" $tmp; then : else dbusbox "Error during deinstallation: Could not install Nokia kernel." rm $tmp exit 1 fi dbusmsg "Nokia kernel was restored. Removing enhanced kernel packages..." apt-get remove -y kernel-bfs kernel-bfs-modules > $tmp ok=$? cat $tmp if test $ok = 0; then dbusbox "Kernel sucessfully deinstalled. Nokia kernel was restored." else dbusbox "Warning: Nokia kernel was restored but could not remove enhanced kernel." fi rm $tmp exit $ok