+# check free space
+root_free=`df | grep '/$' | sed -e '2~1d' | awk '{print $4}'`
+if [ "$root_free" -lt 20000 ]; then
+ zenity --error --text "There is not enough free space left in root partition
+(at least 20MB is required).
+This usually means your NAND is almost full.
+
+Delete some files and try again. Alternatively you can do a full reflash."
+ exit 1
+fi
+
+# check for default angstrom feeds
+if cat /etc/opkg/*.conf | awk -F# '{printf $1}' | grep -q www.angstrom-distribution.org; then
+ zenity --error --text "There seem to be Angstrom feeds in your opkg configs, \
+upgraging from them is known to make the system unbootable.
+Aborting."
+ exit 1
+fi
+