#!/bin/sh tmp=/tmp/kernel-deinstall cat > $tmp < /dev/null; then dbusbox "Error: Application Manager is running. Please close it before uninstallation." exit 1 fi if pgrep -f apt-worker > /dev/null || pgrep -f apt-get; then dbusbox "Error: apt is running. Please wait and try again later." exit 1 fi dbusmsg "Please wait while Nokia kernel will be restored..." 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 uninstallation: 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 package \"Linux kernel for BFS user\"..." apt-get remove --auto-remove -y kernel-bfs-flasher > $tmp ok=$? cat $tmp if test $ok = 0; then dbusbox "Linux kernel for BFS user was sucessfully uninstalled. Nokia kernel was restored." else dbusbox "Warning: Nokia kernel was restored but removing package \"Linux kernel for BFS user\" failed." fi rm $tmp exit $ok