diff options
Diffstat (limited to 'recipes/navit/files/shr/navit.launcher')
-rw-r--r-- | recipes/navit/files/shr/navit.launcher | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/recipes/navit/files/shr/navit.launcher b/recipes/navit/files/shr/navit.launcher new file mode 100644 index 0000000000..68baaeb956 --- /dev/null +++ b/recipes/navit/files/shr/navit.launcher @@ -0,0 +1,57 @@ +#! /bin/sh +# +# Copyright Matthias Hentges <devel@hentges.net> (c) 2008 +# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license) +# +# Filename: navit.launcher +# Date: 20080105 (YMD) +# +################################################################################# +# +# 20080105 - v0.0.1 - Initial release +# 20090818 - - Zoff <zoff@zoff.cc> addons and fixes +# 20091025 - - Zoff check if navit already running +# 20091122 - - Zoff use fsoraw, use correct LANG setting +# +# +################################################################################# + +# On devices with low memory (< 512Mb?) Navit will segfault on start. +# This can be worked around by doing +# "echo 1 > /proc/sys/vm/overcommit_memory" + +# check if navit already running: +pgrep '^navit$' +not_running=$? + +if [ $not_running == 0 ]; then + echo "navit already running !!" +else + echo "ok starting navit ..." + + # HINT: to get correct LANG setting + . /etc/profile + + # HINT: we need that for streetname search + export LC_ALL='' + unset LC_ALL + + # HINT: that should be set in illume, but atm its not + # export LANG=de_AT.utf8 + + if test "`cat /proc/meminfo | grep ^MemTotal | awk '{print $2}'`" -lt "500000" + then + if test "$USER" = "root" + then + echo "Enabling low-mem workaround..." + OLD=`cat /proc/sys/vm/overcommit_memory` + echo 1 > /proc/sys/vm/overcommit_memory + navit.real $* + echo ${OLD} > /proc/sys/vm/overcommit_memory + exit + else + echo "I need root-privs to enable the low-mem workaround!" + fi + fi + navit.real $* +fi |