[pkg-fso-commits] [SCM] Various non-packaged files branch, master, updated. 35d535fc26bf3f0545610fac538252704ac9d113

Luca Capello luca at pca.it
Sun Jul 19 15:14:45 UTC 2009


The following commit has been merged in the master branch:
commit 35d535fc26bf3f0545610fac538252704ac9d113
Author: Luca Capello <luca at pca.it>
Date:   Sun Jul 19 13:53:23 2009 +0200

    install.sh: autodetect FSO_DEVICE from /proc/cpuinfo

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 

-- 
Various non-packaged files



More information about the pkg-fso-commits mailing list