diff --git a/config/common.mk b/config/common.mk index 0833b9a3..1d91d6cf 100644 --- a/config/common.mk +++ b/config/common.mk @@ -54,6 +54,10 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ frameworks/base/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml +# Don't export PS1 in /system/etc/mkshrc. +PRODUCT_COPY_FILES += \ + vendor/cm/prebuilt/common/etc/mkshrc:system/etc/mkshrc + # Required CM packages PRODUCT_PACKAGES += \ Camera \ diff --git a/prebuilt/common/etc/mkshrc b/prebuilt/common/etc/mkshrc new file mode 100644 index 00000000..e2a55d37 --- /dev/null +++ b/prebuilt/common/etc/mkshrc @@ -0,0 +1,29 @@ +# Copyright (c) 2010 +# Thorsten Glaser +# This file is provided under the same terms as mksh. +#- +# Minimal /system/etc/mkshrc for Android + +: ${TERM:=vt100} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=android} +: ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})} +if (( USER_ID )); then PS1='$'; else PS1='#'; fi +function precmd { + typeset e=$? + + (( e )) && print -n "$e|" +} +PS1='$(precmd)$USER@$HOSTNAME:${PWD:-?} '"$PS1 " +export HOME HOSTNAME MKSH SHELL TERM USER +alias l='ls' +alias la='l -a' +alias ll='l -l' +alias lo='l -a -l' + +for p in ~/.bin; do + [[ -d $p/. ]] || continue + [[ :$PATH: = *:$p:* ]] || PATH=$p:$PATH +done + +unset p + +: place customisations above this line