summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinstall.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/install.sh b/install.sh
index 0ed3c41..b9933b0 100755
--- a/install.sh
+++ b/install.sh
@@ -45,11 +45,6 @@ APT_RECOMMENDS=${APT_RECOMMENDS:-false}
DASH_BINSH=${DASH_BINSH:-true}
DISPLAY_MANAGER=${DISPLAY_MANAGER:-nodm}
FSO_MIRROR=${FSO_MIRROR:-http://pkg-fso.alioth.debian.org/debian}
-FSO_DEVICE=${FSO_DEVICE:-gta02}
-HOSTNAME=${HOSTNAME:-debian}
-if [ "$HOSTNAME" = debian ]; then
- HOSTNAME="debian-$FSO_DEVICE"
-fi
INST_DIR=${INST_DIR:-/mnt/debian}
INST_MIRROR=${INST_MIRROR:-http://ftp2.de.debian.org/debian}
LOCALEPURGE=${LOCALEPURGE:-}
@@ -67,6 +62,22 @@ ZHONE=${ZHONE:-true}
# hardening for the case that a user uses capitals
lc SD_PART1_FS SD_PART2_FS APT_RECOMMENDS QI QI_VERBOSE_BOOT FSO_DEVICE
+# device autodetection if the user has not set FSO_DEVICE
+FSO_DEVICE_AUTODETECTED=`grep GTA /proc/cpuinfo | awk '{print $3}' | tr "[:upper:]" "[:lower:]"`
+if [ -z "$FSO_DEVICE" -a -n "$FSO_DEVICE_AUTODETECTED" ]; then
+ FSO_DEVICE=$FSO_DEVICE_AUTODETECTED
+fi
+if [ "$FSO_DEVICE" != gta01 -a "$FSO_DEVICE" != gta02 ]; then
+ echo "E: unsupported FSO_DEVICE '$FSO_DEVICE'"
+ exit 1
+fi
+
+# this is an user variable, which by default depends on the FSO_DEVICE value
+HOSTNAME=${HOSTNAME:-debian}
+if [ "$HOSTNAME" = debian ]; then
+ HOSTNAME="debian-$FSO_DEVICE"
+fi
+
# general variables
VERSION=3.0
VERBOSE=${VERBOSE:-}
@@ -272,7 +283,8 @@ ENVIRONMENT
FSO_MIRROR the Debian freesmartphone.org repository (set to
'$FSO_MIRROR')
FSO_DEVICE the device the installation is being performed on
- (default to gta02, possible values are gta01/gta02)
+ (set to '$FSO_DEVICE', default to autodetection,
+ possible values are gta01/gta02)
QI if you use Qi bootloader set this to true
(set to '$QI')
QI_VERBOSE_BOOT set this to true if you want to see the kernel messages