Skip to content

Commit

Permalink
flash kernel-cssu if the currently running kernel does not workaround
Browse files Browse the repository at this point in the history
errata 430973

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
  • Loading branch information
freemangordon committed May 5, 2014
1 parent afae0ce commit 751c577
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 4 deletions.
40 changes: 36 additions & 4 deletions community-ssu-enabler
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,46 @@ dpkg -i --force-all $debfile
echo -e "\nUpdating repository lists..."
apt-get update

# Check if we have to install a kernel which workarounds errata 430973
# Assume upstream kernels support it
KERNEL_VERSION=`uname -r`
KERNEL_ERRATA_430973=1

case $KERNEL_VERSION in
2.6.28*)
if [ ! -f "/sys/kernel/errata_430973" ]
then
KERNEL_ERRATA_430973=0
fi
;;
*)
;;
esac

if [ "$?" = "0" ]
then
echo "backing up transistions.ini"
mv /usr/share/hildon-desktop/transitions.ini /usr/share/hildon-desktop/transitions.ini.precssu
echo "Community SSU successfully enabled. Launching Application Manager..."
run-standalone.sh dbus-send --print-reply --type=method_call --dest=com.nokia.hildon_application_manager /com/nokia/hildon_application_manager com.nokia.hildon_application_manager.show_check_for_updates_view
cleanup
exit 0
if [ "$KERNEL_ERRATA_430973" = "0" ]
then
apt-get -y --force-yes install kernel-cssu kernel-cssu-modules kernel-cssu-flasher
if [ "$?" = "0" ]
then
cleanup
echo "Rebooting..."
run-standalone.sh reboot
while [ 1 ]; do sleep 1; done
else
echo "Community SSU enabled, but CSSU kernel installation failed."
echo "Press any key to exit..."
read keypress
fi
else
echo "Community SSU successfully enabled. Launching Application Manager..."
run-standalone.sh dbus-send --print-reply --type=method_call --dest=com.nokia.hildon_application_manager /com/nokia/hildon_application_manager com.nokia.hildon_application_manager.show_check_for_updates_view
cleanup
exit 0
fi
else
echo "Community SSU enabled, but package was not installed. Errors have occured."
echo "Press any key to exit..."
Expand Down
29 changes: 29 additions & 0 deletions debian/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,33 @@ echo "Please accept the license agreement displayed on your N900's screen."
maemo-confirm-text "Maemo 5 Community SSU Agreement" $LICENSE
res=$?
rm -f $LICENSE

#Check if we run under kernel which workarounds errata 430973
KERNEL_VERSION=`uname -r`
KERNEL_ERRATA_430973=1

case $KERNEL_VERSION in
2.6.28*)
if [ ! -f "/sys/kernel/errata_430973" ]; then
KERNEL_ERRATA_430973=0
fi
;;
*)
;;
esac

if [ "$KERNEL_ERRATA_430973" = "0" ]; then
cat > $LICENSE << EOF
The currently running kernel does not have Cortex A8 errata 430973
workaround, which is needed for thumb2 binaries to function properly.
A custom kernel will be flashed and the system will be automatically
rebooted from within the enabler.
EOF
echo "Please confirm the kernel replacement on your N900's screen."
maemo-confirm-text "Maemo 5 Community SSU kernel requirements" $LICENSE
res=$?
rm -f $LICENSE
fi

exit $res

0 comments on commit 751c577

Please sign in to comment.