test "$1" = install || exit 0 # upgrades are fine
# Detect environment
-#if test ! -e /proc/component_version
if test -d /scratchbox; then
echo "busybox-power: Scratchbox environment detected"
ENVIRONMENT="SDK"
else
- PROD=$(cat /proc/component_version | grep product | cut -d" " -f 6)
+ if test -e /proc/component_version; then
+ PROD=$(cat /proc/component_version | grep product | cut -d" " -f 6)
+ else
+ PROD=$(/usr/bin/sysinfoclient --get /component/product | awk '{ print $3 }')
+ fi
+
case $PROD in
+ RX-34|RX-44)
+ echo "busybox-power: Maemo4 (N8x0) environment detected"
+ ENVIRONMENT="DIABLO"
+ ;;
RX-51)
- echo "busybox-power: Maemo (N900) environment detected"
+ echo "busybox-power: Maemo5 (N900) environment detected"
ENVIRONMENT="FREMANTLE"
;;
+ RM-680|RM-696)
+ echo "busybox-power: MeeGo/Harmattan (N9/50) environment detected"
+ ENVIRONMENT="HARMATTAN"
+ ;;
*)
- # Unsupported, use the least strict environment (SDK)
- echo "busybox-power: unsupported environment, using SDK codepath.."
- ENVIRONMENT="SDK"
+ echo "busybox-power: unsupported environment: $PROD"
+ exit 1
;;
esac
fi
+# Don't show the warning message when the user wants an unattended installation,
+# if $DISPLAY is not set or $SSH_TTY is set
+if test -z "$DISPLAY" || test -n "$SSH_TTY" || test -e /tmp/.bbp-unattended
+ then exit 0; fi
+
+# Warning message
case $ENVIRONMENT in
SDK)
# Extra warning doesn't apply to SDK, just exit
exit 0
;;
- FREMANTLE)
+ DIABLO|FREMANTLE)
f=/tmp/busybox-power-msg
cat > $f <<EOF
Warning: This package touches an essential system binary!
-Even though installation should be safe, a reflash might be required if something does go wrong (i.e. worst-case scenario).
+Even though installation should be safe, a reflash might be required
+if something does go wrong (i.e. worst-case scenario).
Files overwritten by this package:
bin/busybox
rm -f $f
exit $res
;;
+ HARMATTAN)
+ f=/tmp/busybox-power-msg
+ cat > $f <<EOF
+Warning: This package touches an essential system binary!
+Even though installation should be safe, a reflash might be required if something does go wrong (i.e. worst-case scenario).
+
+Please back up all your valuable data before installing busybox-power.
+
+Files overwritten by this package:
+bin/busybox
+EOF
+ echo "Please confirm the text on the screen of your device"
+ meego-confirm-text "Installation notes" $f > /dev/null 2>&1
+ res=$?
+ rm -f $f
+ exit $res
+ ;;
esac