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

Luca Capello luca at pca.it
Wed Apr 8 08:06:14 UTC 2009


The following commit has been merged in the master branch:
commit 35c912d26c68793fb91b00df8bd4a5c74b0b8b19
Author: Luca Capello <luca at pca.it>
Date:   Wed Apr 8 10:04:45 2009 +0200

    install.sh: support GTA01 as well

diff --git a/install.sh b/install.sh
index b59535c..df6c54a 100755
--- a/install.sh
+++ b/install.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Auto-Installer for Debian on the Openmoko FreeRunner (GTA02)
+# Auto-Installer for Debian on the Openmoko Neo phones (GTA01 and GTA02)
 #
 # Copyright 2008 Joachim Breitner <nomeata at debian.org>
 # Copyright 2008 Luca Capello <luca at pca.it>
@@ -47,7 +47,10 @@ DISPLAY_MANAGER=${DISPLAY_MANAGER:-nodm}
 EXTRA_TASKS=""
 FSO_MIRROR=${FSO_MIRROR:-http://pkg-fso.alioth.debian.org/debian}
 FSO_DEVICE=${FSO_DEVICE:-gta02}
-HOSTNAME=${HOSTNAME:-debian-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:-}
@@ -63,14 +66,6 @@ SINGLE_PART=${SINGLE_PART:-$QI}
 # hardening for the case that a user uses capitals
 lc SD_PART1_FS SD_PART2_FS APT_RECOMMENDS QI QI_VERBOSE_BOOT FSO_DEVICE
 
-### sanity check until the GTA01 installer will be merged
-if [ "${FSO_DEVICE}" != gta02 ]; then
-        echo "Installing on anything different than the Openmoko"
-        echo "GTA02 Neo FreeRunner is not supported yet."
-        exit 1
-fi
-
-
 # general variables
 VERSION=1.1
 VERBOSE=${VERBOSE:-}
@@ -208,7 +203,7 @@ usage () {
 	cat <<__END__
 
 NAME
-	install.sh - Auto-Installer for Debian on the Openmoko FreeRunner (GTA02) v$VERSION
+	install.sh - Auto-Installer for Debian on the Openmoko Neo phones (GTA01 and GTA02) v$VERSION
 
 SYNOPSIS
 	[variable1=value1 variable2 ...] `dirname $0` [options] all
@@ -216,10 +211,11 @@ SYNOPSIS
 
 DESCRIPTION
 
-	This script is to be executed on an OpenMoko FreeRunner, an openly
-	designed telephone, to install the Debian operating system on
-	an SD card. The system goes through multiple stages, and can
-	be modified to adapt to local preferences. 
+	This script is to be executed on an OpenMoko Neo devices
+	(either 1973 or FreeRunner), two openly designed telephones,
+	to install the Debian operating system on an SD card. The
+	system goes through multiple stages, and can be modified to
+	adapt to local preferences.
 
 	The individual stages are described below. The script uses
 	cdebootstrap to prepare a directory to which it can chroot(8)
@@ -257,7 +253,7 @@ ENVIRONMENT
 	FSO_MIRROR   the Debian FSO repository (set to
                      '$FSO_MIRROR')
 	FSO_DEVICE   the device the installation is being performed on
-                     (default to gta02, possible value is gta02 only)
+                     (default to gta02, 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 
@@ -972,13 +968,22 @@ __END__
 # USB RNDIS/Ethernet Gadget
 g_ether
 
-# audio
-snd-soc-neo1973-gta02-wm8753
-
 # bluetooth
 ohci-hcd
 hci_usb
+
+__END__
+	if [ "$FSO_DEVICE" = gta01 ]; then
+		cat >> "$INST_DIR/etc/modules" <<__END__
+# audio
+snd-soc-neo1973-wm8753
 __END__
+	else
+		cat >> "$INST_DIR/etc/modules" <<__END__
+# audio
+snd-soc-neo1973-gta02-wm8753
+__END__
+	fi
 
 	echo " * Setting FSCKFIX=yes in /etc/default/rcS"
 	sed -i 's/FSCKFIX=.*/FSCKFIX=yes'/ "$INST_DIR/etc/default/rcS"
@@ -1017,9 +1022,17 @@ __END__
 		fi
 	fi
 
+	if [ "$FSO_DEVICE" = gta01 ]; then
+	    cat >> "$INST_DIR/etc/fstab" <<__END__
+/dev/mtdblock4	/mnt/flash	jffs2	defaults,noatime,noauto		0 2
+__END__
+	else
+	    cat >> "$INST_DIR/etc/fstab" <<__END__
+/dev/mtdblock6	/mnt/flash	jffs2	defaults,noatime,noauto		0 2
+__END__
+	fi
 
 	cat >> "$INST_DIR/etc/fstab" <<__END__
-/dev/mtdblock6	/mnt/flash	jffs2	defaults,noatime,noauto		0 2
 proc	/proc		proc	defaults				0 0
 tmpfs	/tmp		tmpfs	defaults,noatime			0 0
 tmpfs	/var/lock	tmpfs	defaults,noatime			0 0
@@ -1087,89 +1100,104 @@ EOPANELPLUGIN
 action_kernel () {
 	echo "Installing kernel package"
 
-	ensure_proc_is_mounted
+	if [ "$FSO_DEVICE" != gta02 ]; then
+		cat <<EOF
 
-	intern_cmd="apt-get $APT_OPTIONS install linux-image-2.6.28-openmoko-gta02"
+***********
+* WARNING *
+***********
 
-	if [ "$SD_PART1_FS" = "vfat" ]; then
-		intern_bootmountpoint=$(mount | grep "^${SD_DEVICE}p1"| cut -f3 -d\ )
-		if [ -z "$intern_bootmountpoint" -o "boot" != "$(basename "$intern_bootmountpoint")" ]; then
-			echo " * installing to /boot"
-			chroot "$INST_DIR" $intern_cmd
-			echo " * cleaning apt cache"
-			chroot "$INST_DIR" apt-get clean
-			echo " * copying /boot/uImage.bin to first partition"
-			if [ -z "$intern_bootmountpoint" ]; then
-				if [ -n "$VERBOSE" ]; then
-					echo "    Mounting first partition to /mnt/tmp_first_part_$$";
-				fi
-				mkdir /mnt/tmp_first_part_$$
-				mount ${SD_DEVICE}p1 /mnt/tmp_first_part_$$
+Debian does not provide any kernel for the Openmoko Neo 1973.
+You should install an official Openmoko kernel from
 
-				if [ -n "$VERBOSE" ]; then
-					echo "    Copying '$INST_DIR/boot/uImage.bin' to '/mnt/tmp_first_part_$$/'"
-				fi
-				cp "$INST_DIR/boot/uImage.bin" "/mnt/tmp_first_part_$$/"
+  http://wiki.openmoko.org/wiki/Kernel
 
-				if [ -n "$VERBOSE" ]; then
-					echo "    Unmounting first partition from /mnt/tmp_first_part_$$"
-				fi
-				umount /mnt/tmp_first_part_$$
-				rmdir /mnt/tmp_first_part_$$
-			else 
-				if [ -n "$VERBOSE" ]; then
-					echo "    Found first partitional already mounted to '$intern_bootmountpoint'."
-				fi
-				if [ -n "$VERBOSE" ]; then
-					echo "    Copying '$INST_DIR/boot/uImage.bin' to '$intern_bootmountpoint/'."
+EOF
+	else
+		ensure_proc_is_mounted
+
+		intern_cmd="apt-get $APT_OPTIONS install linux-image-2.6.28-openmoko-gta02"
+
+		if [ "$SD_PART1_FS" = "vfat" ]; then
+			intern_bootmountpoint=$(mount | grep "^${SD_DEVICE}p1"| cut -f3 -d\ )
+			if [ -z "$intern_bootmountpoint" -o "boot" != "$(basename "$intern_bootmountpoint")" ]; then
+				echo " * installing to /boot"
+				chroot "$INST_DIR" $intern_cmd
+				echo " * cleaning apt cache"
+				chroot "$INST_DIR" apt-get clean
+				echo " * copying /boot/uImage.bin to first partition"
+				if [ -z "$intern_bootmountpoint" ]; then
+					if [ -n "$VERBOSE" ]; then
+						echo "    Mounting first partition to /mnt/tmp_first_part_$$";
+					fi
+					mkdir /mnt/tmp_first_part_$$
+					mount ${SD_DEVICE}p1 /mnt/tmp_first_part_$$
+
+					if [ -n "$VERBOSE" ]; then
+						echo "    Copying '$INST_DIR/boot/uImage.bin' to '/mnt/tmp_first_part_$$/'"
+					fi
+					cp "$INST_DIR/boot/uImage.bin" "/mnt/tmp_first_part_$$/"
+
+					if [ -n "$VERBOSE" ]; then
+						echo "    Unmounting first partition from /mnt/tmp_first_part_$$"
+					fi
+					umount /mnt/tmp_first_part_$$
+					rmdir /mnt/tmp_first_part_$$
+				else 
+					if [ -n "$VERBOSE" ]; then
+						echo "    Found first partitional already mounted to '$intern_bootmountpoint'."
+					fi
+					if [ -n "$VERBOSE" ]; then
+						echo "    Copying '$INST_DIR/boot/uImage.bin' to '$intern_bootmountpoint/'."
+					fi
+					cp "$INST_DIR/boot/uImage.bin" "$intern_bootmountpoint/"
 				fi
-				cp "$INST_DIR/boot/uImage.bin" "$intern_bootmountpoint/"
-			fi
 			
+			else
+				echo "W: when using $SD_PART1_FS as filesystem for the first microSD card"
+				echo "   partition, you should manually install the kernel, since dpkg"
+				echo "   does not support non-POSIX filesystems:"
+				echo "     http://bugs.debian.org/bug=315493"
+				echo
+				echo "   Make sure, the first partition is not mounted to the /boot"
+				echo "   directory. Then "
+				echo "      $intern_cmd"
+				echo "   and copy /boot/uImage.bin to your first partition. When no longer"
+				echo "   mounted to /boot, you may also rerun '$0 --part1-fs vfat kernel'."
+				return 0
+			fi
 		else
-			echo "W: when using $SD_PART1_FS as filesystem for the first microSD card"
-			echo "   partition, you should manually install the kernel, since dpkg"
-			echo "   does not support non-POSIX filesystems:"
-			echo "     http://bugs.debian.org/bug=315493"
-			echo
-			echo "   Make sure, the first partition is not mounted to the /boot"
-			echo "   directory. Then "
-			echo "      $intern_cmd"
-			echo "   and copy /boot/uImage.bin to your first partition. When no longer"
-			echo "   mounted to /boot, you may also rerun '$0 --part1-fs vfat kernel'."
-			return 0
-		fi
-	else
-		chroot "$INST_DIR" /bin/sh -e <<__END_CHROOT__
+			chroot "$INST_DIR" /bin/sh -e <<__END_CHROOT__
 $intern_cmd
 apt-get clean
 __END_CHROOT__
-	fi
+		fi
 
-	echo "I: Kernel installed"
+		echo "I: Kernel installed"
 
-	if [ "$QI" = "true" ]; then
-		echo "Prepare system for booting with Qi"
-		BOOT_DIR="$INST_DIR/boot/boot"
-		if [ "$SINGLE_PART" = "true" ]; then
-			BOOT_DIR="$INST_DIR/boot"
-			ln -fs uImage.bin $BOOT_DIR/uImage-GTA02.bin
-		else
-			mkdir $BOOT_DIR
-			ln -fs ../uImage.bin $BOOT_DIR/uImage-GTA02.bin
-		fi
+		if [ "$QI" = "true" ]; then
+			echo "Prepare system for booting with Qi"
+			BOOT_DIR="$INST_DIR/boot/boot"
+			if [ "$SINGLE_PART" = "true" ]; then
+				BOOT_DIR="$INST_DIR/boot"
+				ln -fs uImage.bin $BOOT_DIR/uImage-GTA02.bin
+			else
+				mkdir $BOOT_DIR
+				ln -fs ../uImage.bin $BOOT_DIR/uImage-GTA02.bin
+			fi
 	
-		if [ "$SINGLE_PART" = "true" ]; then
-			ROOT_PART=${SD_DEVICE}p1
-		else
-			ROOT_PART=${SD_DEVICE}p2
-		fi
+			if [ "$SINGLE_PART" = "true" ]; then
+				ROOT_PART=${SD_DEVICE}p1
+			else
+				ROOT_PART=${SD_DEVICE}p2
+			fi
 
-		if [ "$QI_VERBOSE_BOOT" = "true" ]; then
-			echo "root=$ROOT_PART console=tty0 loglevel=8" >$BOOT_DIR/append-GTA02
-		else
-			echo "root=$ROOT_PART rootdelay=1" >$BOOT_DIR/append-GTA02
-		fi	
+			if [ "$QI_VERBOSE_BOOT" = "true" ]; then
+				echo "root=$ROOT_PART console=tty0 loglevel=8" >$BOOT_DIR/append-GTA02
+			else
+				echo "root=$ROOT_PART rootdelay=1" >$BOOT_DIR/append-GTA02
+			fi	
+		fi
 	fi
 }
 

-- 
Various non-packaged files



More information about the pkg-fso-commits mailing list