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

Steffen Moeller steffen_moeller at gmx.de
Sat Feb 21 19:48:41 UTC 2009


The following commit has been merged in the master branch:
commit 36af4f7e52388580d16ebf8c6df29b65194d5825
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date:   Fri Feb 20 23:03:38 2009 +0100

    Indented install.sh.

diff --git a/install.sh b/install.sh
old mode 100755
new mode 100644
index a24f09b..3a5bf39
--- a/install.sh
+++ b/install.sh
@@ -149,7 +149,7 @@ This will destroy all the data on the microSD card!!!
 Press any key within 5 seconds to quit
 __END__
 
-five_seconds_to_quit
+	five_seconds_to_quit
 
 }
 
@@ -283,8 +283,8 @@ __END__
 vfat_check () {
 # /boot on vfat is no more supported (http://bugs.debian.org/315493)
 # http://lists.linuxtogo.org/pipermail/smartphones-userland/2008-November/000502.html
-if [ "$SD_PART1_FS" = "vfat" ]; then
-    cat <<__END__
+	if [ "$SD_PART1_FS" = "vfat" ]; then
+		cat <<__END__
 ***********
 * WARNING *
 ***********
@@ -298,9 +298,9 @@ information are available at http://bugs.debian.org/315493.
 
 Press any key within 5 seconds to quit
 __END__
-    five_seconds_to_quit
-    SINGLE_PART="false"
-fi
+		five_seconds_to_quit
+		SINGLE_PART="false"
+	fi
 }
 
 
@@ -308,7 +308,7 @@ fi
 # Stage all
 #
 action_all () {
-cat <<__END__
+	cat <<__END__
 I: Running all stages with these settings:
 I: hostname set to $HOSTNAME
 I: microSD card device at $SD_DEVICE
@@ -320,25 +320,25 @@ I: dash as default /bin/sh se to $DASH_BINSH
 
 __END__
 
-for f in testing time partition format mount debian apt fso configuration kernel unmount
-do
-	if [ -n "$verbose" ]; then echo calling '$f'; fi
-	action_$f
-done
-cat <<__END__
+	for f in testing time partition format mount debian apt fso configuration kernel unmount
+	do
+		if [ -n "$verbose" ]; then echo calling '$f'; fi
+		action_$f
+	done
+	cat <<__END__
 
 I: All done!
 
 __END__
 
-if [ "$SD_PART1_FS" = "vfat" ]; then
-	echo "Now reboot, switch on the Openmoko FreeRunner with both AUX+PWR,"
-	echo "buttons, choose \"Boot from microSD (FAT+ext2)\" and wait!"
-else
-	echo "Now reboot, and hope for the best!"
-fi
-echo
-exit 0
+	if [ "$SD_PART1_FS" = "vfat" ]; then
+		echo "Now reboot, switch on the Openmoko FreeRunner with both AUX+PWR,"
+		echo "buttons, choose \"Boot from microSD (FAT+ext2)\" and wait!"
+	else
+		echo "Now reboot, and hope for the best!"
+	fi
+	echo
+	exit 0
 }
 
 
@@ -346,75 +346,75 @@ exit 0
 # Stage test
 #
 action_testing () {
-echo "Testing system setup"
-
-if ! test -e $SD_DEVICE; then
-	echo "E: Could not find microSD card device file $SD_DEVICE"
-	exit 1
-fi
-echo " * microSD card device: $SD_DEVICE present"
+	echo "Testing system setup"
 
-for BINARY in wget ping fdisk mount umount mkfs.$SD_PART1_FS mkfs.$SD_PART2_FS gunzip dd sed rdate; do
-	if ! which $BINARY > /dev/null; then
-		echo "E: Could not find $BINARY binary"
+	if ! test -e $SD_DEVICE; then
+		echo "E: Could not find microSD card device file $SD_DEVICE"
 		exit 1
 	fi
-	echo " * $BINARY installed"
-done
+	echo " * microSD card device: $SD_DEVICE present"
 
-if tar --help 2>&1 | grep "Usage: tar \-\[cxtvO\]" >/dev/null; then
-	echo "W: tar does not support gzip archives"
-	echo "Downloading tar package"
-	wget $TAR_PACKAGE -O /tmp/tar.deb
-	( cd /tmp; ar -x tar.deb data.tar.gz )
-	mkdir -p /usr/local
-	gunzip -c /tmp/data.tar.gz | tar -x -C /usr/local/
-	rm -f /tmp/data.tar.gz
-	rm -f /tmp/tar.deb
-fi
+	for BINARY in wget ping fdisk mount umount mkfs.$SD_PART1_FS mkfs.$SD_PART2_FS gunzip dd sed rdate; do
+		if ! which $BINARY > /dev/null; then
+			echo "E: Could not find $BINARY binary"
+			exit 1
+		fi
+		echo " * $BINARY installed"
+	done
 
-if [ "$SD_PART1_FS" = "vfat" ]; then
-	if ! which mkfs.vfat >/dev/null; then
-		echo "W: Could not find mkfs.vfat binary"
-		# it should try first to install dosfstools through opkg
-		# and then try to install the Debian dosfstools
-		echo "Downloading dosfstools package"
-		wget $DOSFSTOOLS_PACKAGE -O /tmp/dosfstools.deb
-		( cd /tmp; ar -x dosfstools.deb data.tar.gz )
-		tar -xz -C / -f /tmp/data.tar.gz
+	if tar --help 2>&1 | grep "Usage: tar \-\[cxtvO\]" >/dev/null; then
+		echo "W: tar does not support gzip archives"
+		echo "Downloading tar package"
+		wget $TAR_PACKAGE -O /tmp/tar.deb
+		( cd /tmp; ar -x tar.deb data.tar.gz )
+		mkdir -p /usr/local
+		gunzip -c /tmp/data.tar.gz | tar -x -C /usr/local/
 		rm -f /tmp/data.tar.gz
-		rm -f /tmp/dosfstools.deb
+		rm -f /tmp/tar.deb
 	fi
 
-	# let's test again for safety reasons
-	if ! which mkfs.vfat >/dev/null; then
-		echo "E: Could not find mkfs.vfat binary"
-		exit 1
-	else
-		echo " * mkfs.vfat installed"
+	if [ "$SD_PART1_FS" = "vfat" ]; then
+		if ! which mkfs.vfat >/dev/null; then
+			echo "W: Could not find mkfs.vfat binary"
+			# it should try first to install dosfstools through opkg
+			# and then try to install the Debian dosfstools
+			echo "Downloading dosfstools package"
+			wget $DOSFSTOOLS_PACKAGE -O /tmp/dosfstools.deb
+			( cd /tmp; ar -x dosfstools.deb data.tar.gz )
+			tar -xz -C / -f /tmp/data.tar.gz
+			rm -f /tmp/data.tar.gz
+			rm -f /tmp/dosfstools.deb
+		fi
+
+		# let's test again for safety reasons
+		if ! which mkfs.vfat >/dev/null; then
+			echo "E: Could not find mkfs.vfat binary"
+			exit 1
+		else
+			echo " * mkfs.vfat installed"
+		fi
 	fi
-fi
 
-if [ $(uname -m) != armv4tl ]; then
-	echo "E: System is not claiming to be an armv4tl.  Are you sure that this is your Openmoko FreeRunner (GTA02)?"
-	exit 1
-fi
+	if [ $(uname -m) != armv4tl ]; then
+		echo "E: System is not claiming to be an armv4tl.  Are you sure that this is your Openmoko FreeRunner (GTA02)?"
+		exit 1
+	fi
 
-if ! ping -c 2 $TESTHOST > /dev/null; then
-	echo "E: Could not ping $TESTHOST, is the network running?"
-	exit 1
-fi
-echo " * network running"
+	if ! ping -c 2 $TESTHOST > /dev/null; then
+		echo "E: Could not ping $TESTHOST, is the network running?"
+		exit 1
+	fi
 
-if ps -C qpe >/dev/null; then
-	echo "E: Qtopia wants to continually access /media/card.  You need to"
-	echo "   stop it with \`/etc/init.d/qpe stop\` or \`killall qpe\`    "
-	echo "   and then restart the installation!"
-	exit 1
-fi
+	echo " * network running"
 
-echo "I: System setup looks good"
+	if ps -C qpe >/dev/null; then
+		echo "E: Qtopia wants to continually access /media/card.  You need to"
+		echo "   stop it with \`/etc/init.d/qpe stop\` or \`killall qpe\`    "
+		echo "   and then restart the installation!"
+		exit 1
+	fi
 
+	echo "I: System setup looks good"
 }
 
 #
@@ -422,9 +422,9 @@ echo "I: System setup looks good"
 #
 
 action_time () {
-echo "Fetching time from $RDATEHOST with rdate"
-rdate -s "$RDATEHOST"
-echo "I: Time is now `date`"
+	echo "Fetching time from $RDATEHOST with rdate"
+	rdate -s "$RDATEHOST"
+	echo "I: Time is now `date`"
 }
 
 #
@@ -432,29 +432,29 @@ echo "I: Time is now `date`"
 #
 
 action_partition () {
-card_data_warning partition
-umount_all
+	card_data_warning partition
+	umount_all
 
-# put the partition table in a "known state"
-dd if=/dev/zero of=$SD_DEVICE bs=512 count=1
+	# put the partition table in a "known state"
+	dd if=/dev/zero of=$SD_DEVICE bs=512 count=1
 
-# run partitioner
-rootpartno=2
-bootfstypeno=83
+	# run partitioner
+	rootpartno=2
+	bootfstypeno=83
 
-mb=$(echo pq | fdisk /dev/mmcblk0 | grep Disk| cut -f 3 -d \ )
-cylinders=$(echo pq | fdisk /dev/mmcblk0 | grep cylinders|grep heads|cut -f 5 -d\ )
-lastcylinder=$(($cylinders-($cylinders*$SD_SWAP_SIZE/$mb)))
+	mb=$(echo pq | fdisk /dev/mmcblk0 | grep Disk| cut -f 3 -d \ )
+	cylinders=$(echo pq | fdisk /dev/mmcblk0 | grep cylinders|grep heads|cut -f 5 -d\ )
+	lastcylinder=$(($cylinders-($cylinders*$SD_SWAP_SIZE/$mb)))
 
-if [ "vfat" = "$SD_PART1_FS" ]; then
-	bootfstypeno=4
-fi
+	if [ "vfat" = "$SD_PART1_FS" ]; then
+		bootfstypeno=4
+	fi
 
-partitionno=0
-if [ "$SINGLE_PART" = "true" ]; then
-	echo "Preparing SD as a single Linux device."
-	partitionno=$(($partitionno+1))
-	cat <<EOSINGLECONF > /tmp/argsToFdisk$$
+	partitionno=0
+	if [ "$SINGLE_PART" = "true" ]; then
+		echo "Preparing SD as a single Linux device."
+		partitionno=$(($partitionno+1))
+		cat <<EOSINGLECONF > /tmp/argsToFdisk$$
 n
 p
 $partitionno
@@ -462,9 +462,9 @@ $partitionno
 $lastcylinder
 EOSINGLECONF
 
-else
-	partitionno=$(($partitionno+1))
-	cat <<EOBOOTCONF > /tmp/argsToFdisk$$
+	else
+		partitionno=$(($partitionno+1))
+		cat <<EOBOOTCONF > /tmp/argsToFdisk$$
 n
 p
 $partitionno
@@ -474,8 +474,8 @@ t
 $bootfstypeno
 EOBOOTCONF
 
-	partitionno=$(($partitionno+1))
-	cat <<EOROOTCONF >> /tmp/argsToFdisk$$
+		partitionno=$(($partitionno+1))
+		cat <<EOROOTCONF >> /tmp/argsToFdisk$$
 n
 p
 $partitionno
@@ -485,11 +485,11 @@ t
 $partitionno
 83
 EOROOTCONF
-fi
+	fi
 
-if [ 0 -lt "$SD_SWAP_SIZE" ]; then
-	partitionno=$(($partitionno+1))
-	cat <<EOSWAPCONF >> /tmp/argsToFdisk$$
+	if [ 0 -lt "$SD_SWAP_SIZE" ]; then
+		partitionno=$(($partitionno+1))
+		cat <<EOSWAPCONF >> /tmp/argsToFdisk$$
 n
 p
 $partitionno
@@ -500,85 +500,86 @@ $partitionno
 82
 p
 EOSWAPCONF
-fi
-echo "w" >> /tmp/argsToFdisk$$
+	fi
+	echo "w" >> /tmp/argsToFdisk$$
 
-if fdisk $SD_DEVICE < /tmp/argsToFdisk$$; then
-	echo "Partitioning was successful."
-	if [ -n "$verbose" ]; then
-		echo "The following partitions have been created:"
-		echo "pq" | fdisk $SD_DEVICE
+	if fdisk $SD_DEVICE < /tmp/argsToFdisk$$; then
+		echo "Partitioning was successful."
+		if [ -n "$verbose" ]; then
+			echo "The following partitions have been created:"
+			echo "pq" | fdisk $SD_DEVICE
+		fi
+		#rm /tmp/argsToFdisk$$
+	else
+		echo "Partitioning failed, could not execute with fdisk:"
+		cat /tmp/argsToFdisk$$
+		exit -1
 	fi
-	#rm /tmp/argsToFdisk$$
-else
-	echo "Partitioning failed, could not execute with fdisk:"
-	cat /tmp/argsToFdisk$$
-	exit -1
-fi
 
 
-echo " * Waiting for partitions to appear"
-SLEEP_SECONDS=3
-if [ "$SINGLE_PART" = "true" ]; then
-	DEVTEST="test -e ${SD_DEVICE}p1"
-else
-	DEVTEST="test -e ${SD_DEVICE}p1 -a -e ${SD_DEVICE}p2"
-fi
-while ! $DEVTEST; do
-	if [ "$SLEEP_SECONDS" = 15 ]; then
-		echo "E: Partitioning has failed, partitions have not been created"
-		exit 1
+	echo " * Waiting for partitions to appear"
+	SLEEP_SECONDS=3
+	if [ "$SINGLE_PART" = "true" ]; then
+		DEVTEST="test -e ${SD_DEVICE}p1"
+	else
+		DEVTEST="test -e ${SD_DEVICE}p1 -a -e ${SD_DEVICE}p2"
 	fi
-	sleep 3
-	SLEEP_SECONDS=`expr $SLEEP_SECONDS + 3`
-done
-echo " * Partition table created"
+
+	while ! $DEVTEST; do
+		if [ "$SLEEP_SECONDS" = 15 ]; then
+			echo "E: Partitioning has failed, partitions have not been created"
+			exit 1
+		fi
+		sleep 3
+		SLEEP_SECONDS=`expr $SLEEP_SECONDS + 3`
+	done
+	echo " * Partition table created"
 }
 
 #
 # Stage format
 #
 action_format () {
-echo
-card_data_warning format
-umount_all
-
-echo " * Formatting the microSD card partitions"
-if [ "$SINGLE_PART" = "true" ]; then
-	mkfs.ext2 ${SD_DEVICE}p1
-else
-	mkfs.$SD_PART1_FS ${SD_DEVICE}p1
-	mkfs.$SD_PART2_FS ${SD_DEVICE}p2
-fi
+	echo
+	card_data_warning format
+	umount_all
+
+	echo " * Formatting the microSD card partitions"
+	if [ "$SINGLE_PART" = "true" ]; then
+		mkfs.ext2 ${SD_DEVICE}p1
+	else
+		mkfs.$SD_PART1_FS ${SD_DEVICE}p1
+		mkfs.$SD_PART2_FS ${SD_DEVICE}p2
+	fi
 
-echo "I: microSD card ready"
+	echo "I: microSD card ready"
 }
 
 #
 # Stage mount
 #
 action_mount () {
-echo "Mounting the newly created system"
-if [ -d "$INST_DIR" ]; then
-	 mkdir -p $INST_DIR; 
-elif [ -n "$verbose" ]; then
-	echo "Not creating directory '$INST_DIR', it is already existing."
-fi
-if [ "$SINGLE_PART" = "true" ]; then
-	if [ -n "$verbose" ]; then echo "Preparing single ext2 device."; fi
-	mount -t auto ${SD_DEVICE}p1 $INST_DIR
-	mkdir -p $INST_DIR/boot
-else
-	if [ -n "$verbose" ]; then echo "Mounting root partition to '$INST_DIR'."; fi
-	mount -t auto ${SD_DEVICE}p2 $INST_DIR
-	if [ "vfat" = "$SD_PART1_FS" ]; then
-		echo "You have a vfat boot filesystem. This is not mounted to /boot."
+	echo "Mounting the newly created system"
+	if [ -d "$INST_DIR" ]; then
+		 mkdir -p $INST_DIR; 
+	elif [ -n "$verbose" ]; then
+		echo "Not creating directory '$INST_DIR', it is already existing."
+	fi
+	if [ "$SINGLE_PART" = "true" ]; then
+		if [ -n "$verbose" ]; then echo "Preparing single ext2 device."; fi
+		mount -t auto ${SD_DEVICE}p1 $INST_DIR
+		mkdir -p $INST_DIR/boot
 	else
-		if [ ! -d "$INST_DIR/boot" ]; then mkdir $INST_DIR/boot; fi
-		mount -t auto ${SD_DEVICE}p1 $INST_DIR/boot
+		if [ -n "$verbose" ]; then echo "Mounting root partition to '$INST_DIR'."; fi
+		mount -t auto ${SD_DEVICE}p2 $INST_DIR
+		if [ "vfat" = "$SD_PART1_FS" ]; then
+			echo "You have a vfat boot filesystem. This is not mounted to /boot."
+		else
+			if [ ! -d "$INST_DIR/boot" ]; then mkdir $INST_DIR/boot; fi
+			mount -t auto ${SD_DEVICE}p1 $INST_DIR/boot
+		fi
 	fi
-fi
-echo "I: microSD card partitions mounted"
+	echo "I: microSD card partitions mounted"
 }
 
 
@@ -586,19 +587,21 @@ echo "I: microSD card partitions mounted"
 # Stage debian
 #
 action_debian () {
-echo "Install a basic Debian system"
+	echo "Install a basic Debian system"
 
-echo " * Downloading cdebootstrap package"
-wget $CDEBOOTSTRAP_PACKAGE -O /tmp/cdebootstrap.deb
-( cd /tmp; ar -x cdebootstrap.deb data.tar.gz )
-tar -xz -C / -f /tmp/data.tar.gz
-rm -f /tmp/data.tar.gz
-rm -f /tmp/cdebootstrap.deb
+	echo " * Downloading cdebootstrap package"
+	wget $CDEBOOTSTRAP_PACKAGE -O /tmp/cdebootstrap.deb
+	( cd /tmp; ar -x cdebootstrap.deb data.tar.gz )
+	tar -xz -C / -f /tmp/data.tar.gz
+	rm -f /tmp/data.tar.gz
+	rm -f /tmp/cdebootstrap.deb
 
-echo " * Running cdebootstrap to install the system (might take a while)"
-cdebootstrap-static --allow-unauthenticated --flavour minimal --include=$CDEBOOTSTRAP_EXTRA_PACKAGES --exclude=$CDEBOOTSTRAP_EXCLUDE_PACKAGES sid $INST_DIR $INST_MIRROR
+	echo " * Running cdebootstrap to install the system (might take a while)"
+	cdebootstrap-static --allow-unauthenticated --flavour minimal \
+		--include=$CDEBOOTSTRAP_EXTRA_PACKAGES \
+		--exclude=$CDEBOOTSTRAP_EXCLUDE_PACKAGES sid $INST_DIR $INST_MIRROR
 
-echo "I: basic Debian system installed"
+	echo "I: basic Debian system installed"
 }
 
 
@@ -606,32 +609,32 @@ echo "I: basic Debian system installed"
 # Stage apt
 #
 action_apt () {
-echo "Configuring APT"
+	echo "Configuring APT"
 
-echo " * Creating /etc/apt/sources.list"
-cat > $INST_DIR/etc/apt/sources.list <<__END__
+	echo " * Creating /etc/apt/sources.list"
+	cat > $INST_DIR/etc/apt/sources.list <<__END__
 deb $INST_MIRROR unstable main
 deb $INST_MIRROR experimental main
 deb $FSO_MIRROR unstable main
 __END__
 
-echo " * Install APT recommends by default: $APT_RECOMMENDS"
-echo "APT::Install-Recommends \"$APT_RECOMMENDS\";" > $INST_DIR/etc/apt/apt.conf.d/99recommends
+	echo " * Install APT recommends by default: $APT_RECOMMENDS"
+	echo "APT::Install-Recommends \"$APT_RECOMMENDS\";" > $INST_DIR/etc/apt/apt.conf.d/99recommends
 
-echo " * Updating APT database"
-chroot $INST_DIR apt-get update
+	echo " * Updating APT database"
+	chroot $INST_DIR apt-get update
 
-echo " * Installing pkg-fso keyring"
-chroot $INST_DIR apt-get --yes --force-yes install pkg-fso-keyring
+	echo " * Installing pkg-fso keyring"
+	chroot $INST_DIR apt-get --yes --force-yes install pkg-fso-keyring
 
-echo " * Removing additional packages"
-chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
+	echo " * Removing additional packages"
+	chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
 apt-get update
 apt-get --yes --purge remove cdebootstrap-helper-rc.d
 apt-get clean
 __END_CHROOT__
 
-echo "I: APT configured"
+	echo "I: APT configured"
 }
 
 
@@ -639,13 +642,13 @@ echo "I: APT configured"
 # Stage fso
 #
 action_fso () {
-# TODO
-echo "Installing FSO-specific packages"
-chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
+	# TODO
+	echo "Installing FSO-specific packages"
+	chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
 apt-get --yes install $FSO_PACKAGES
 apt-get clean
 __END_CHROOT__
-echo "I: FSO packages installed"
+	echo "I: FSO packages installed"
 }
 
 
@@ -653,13 +656,13 @@ echo "I: FSO packages installed"
 # Stage configuration
 #
 action_configuration () {
-echo "Configuring system files for ${FSO_DEVICE}"
+	echo "Configuring system files for ${FSO_DEVICE}"
 
-echo " * Installing the fso-config-${FSO_DEVICE} package"
-chroot $INST_DIR apt-get --yes --force-yes install fso-config-${FSO_DEVICE}
+	echo " * Installing the fso-config-${FSO_DEVICE} package"
+	chroot $INST_DIR apt-get --yes --force-yes install fso-config-${FSO_DEVICE}
 
-echo " * Creating /etc/X11/xorg.conf"
-cat > $INST_DIR/etc/X11/xorg.conf <<__END__
+	echo " * Creating /etc/X11/xorg.conf"
+	cat > $INST_DIR/etc/X11/xorg.conf <<__END__
 # Xorg confiugration for an Openmoko FreeRunner
 Section "InputDevice"
 	Identifier	"Configured Touchscreen"
@@ -678,8 +681,8 @@ Section "Device"
 EndSection
 __END__
 
-echo " * Creating /etc/inittab (all but tty1 disabled to save memory)"
-cat > $INST_DIR/etc/inittab <<__END__
+	echo " * Creating /etc/inittab (all but tty1 disabled to save memory)"
+	cat > $INST_DIR/etc/inittab <<__END__
 id:2:initdefault:
 si::sysinit:/etc/init.d/rcS
 ~~:S:wait:/sbin/sulogin
@@ -703,8 +706,8 @@ po::powerokwait:/etc/init.d/powerfail stop
 #6:23:respawn:/sbin/getty 38400 tty6
 __END__
 
-echo " * Creating /etc/modules"
-cat > $INST_DIR/etc/modules <<__END__
+	echo " * Creating /etc/modules"
+	cat > $INST_DIR/etc/modules <<__END__
 # USB RNDIS/Ethernet Gadget
 g_ether
 
@@ -716,48 +719,45 @@ ohci-hcd
 hci_usb
 __END__
 
-echo " * Setting FSCKFIX=yes in /etc/default/rcS"
-sed -i 's/FSCKFIX=.*/FSCKFIX=yes'/ $INST_DIR/etc/default/rcS
+	echo " * Setting FSCKFIX=yes in /etc/default/rcS"
+	sed -i 's/FSCKFIX=.*/FSCKFIX=yes'/ $INST_DIR/etc/default/rcS
 
-echo " * Creating /etc/fstab"
-mkdir -p $INST_DIR/mnt/flash
-cat > $INST_DIR/etc/fstab <<__END__
+	echo " * Creating /etc/fstab"
+	mkdir -p $INST_DIR/mnt/flash
+	cat > $INST_DIR/etc/fstab <<__END__
 rootfs	/		auto	defaults,errors=remount-ro,noatime	0 1
 __END__
 
-if [ "$SINGLE_PART" != "true" ]; then
-	if [ "ext2" = "$SD_PART1_FS" -o "ext3" = "$SD_PART1_FS" ]; then
-		cat >> $INST_DIR/etc/fstab <<__END__
+	if [ "$SINGLE_PART" != "true" ]; then
+		if [ "ext2" = "$SD_PART1_FS" -o "ext3" = "$SD_PART1_FS" ]; then
+			cat >> $INST_DIR/etc/fstab <<__END__
 /dev/mmcblk0p1	/boot	auto	defaults,noatime			0 2
 __END__
 
-	else
-		cat >> $INST_DIR/etc/fstab <<__END__
+		else
+			cat >> $INST_DIR/etc/fstab <<__END__
 /dev/mmcblk0p1	/boot	auto	defaults,noatime,noauto			0 2
 __END__
 
-	fi
+		fi
 
-	if [ 0 -lt "$SD_SWAP_SIZE" ]; then
-		cat >> $INST_DIR/etc/fstab <<__END__
+		if [ 0 -lt "$SD_SWAP_SIZE" ]; then
+			cat >> $INST_DIR/etc/fstab <<__END__
 /dev/mmcblk0p3  none    swap     sw                                     0 0
 __END__
 
-	fi
-
-else
-	# $SINGLE_PART = "true"
-
-	if [ 0 -lt "$SD_SWAP_SIZE" ]; then
-		cat >> $INST_DIR/etc/fstab <<__END__
+		fi
+	else
+		# $SINGLE_PART = "true"
+		if [ 0 -lt "$SD_SWAP_SIZE" ]; then
+			cat >> $INST_DIR/etc/fstab <<__END__
 /dev/mmcblk0p2  none   swap     sw                                     0 0
 __END__
+		fi
 	fi
 
-fi
-
 
-cat >> $INST_DIR/etc/fstab <<__END__
+	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
@@ -765,38 +765,38 @@ tmpfs	/var/lock	tmpfs	defaults,noatime			0 0
 tmpfs	/var/run	tmpfs	defaults,noatime			0 0
 __END__
 
-echo " * Setting /etc/hostname to $HOSTNAME"
-echo "$HOSTNAME" >$INST_DIR/etc/hostname
+	echo " * Setting /etc/hostname to $HOSTNAME"
+	echo "$HOSTNAME" >$INST_DIR/etc/hostname
 
-for FILE in /etc/network/interfaces /etc/resolv.conf; do
-	echo " * $FILE copied from this machine"
-	cat > $INST_DIR$FILE <$FILE
-done
+	for FILE in /etc/network/interfaces /etc/resolv.conf; do
+		echo " * $FILE copied from this machine"
+		cat > $INST_DIR$FILE <$FILE
+	done
 
-echo " * Setting empty root password"
-echo 'root:' | chroot $INST_DIR chpasswd
+	echo " * Setting empty root password"
+	echo 'root:' | chroot $INST_DIR chpasswd
 
-for HOST_KEY in $DROPBEAR_KEYS; do
-	if [ -f "$HOST_KEY" ]; then
-		echo " * copying ssh host key $HOST_KEY"
-		cat >$INST_DIR$HOST_KEY <$HOST_KEY
-	fi
-done
+	for HOST_KEY in $DROPBEAR_KEYS; do
+		if [ -f "$HOST_KEY" ]; then
+			echo " * copying ssh host key $HOST_KEY"
+			cat >$INST_DIR$HOST_KEY <$HOST_KEY
+		fi
+	done
 
 
-echo " * Installing dash as /bin/sh: $DASH_BINSH"
-echo 'dash dash/sh string $DASH_BINSH' | chroot $INST_DIR debconf-set-selections
-chroot $INST_DIR apt-get --yes --force-yes install dash
+	echo " * Installing dash as /bin/sh: $DASH_BINSH"
+	echo 'dash dash/sh string $DASH_BINSH' | chroot $INST_DIR debconf-set-selections
+	chroot $INST_DIR apt-get --yes --force-yes install dash
 
-if [ -f "$WPA_SUPPLICANT_CONF" ]; then
-	echo " * Installing wpasupplicant, wireless-tools and udhcpc"
-	chroot $INST_DIR apt-get --yes install wpasupplicant wireless-tools udhcpc
-	echo " * $WPA_SUPPLICANT_CONF copied from this machine"
-	cat >$INST_DIR$WPA_SUPPLICANT_CONF <$WPA_SUPPLICANT_CONF
-fi
+	if [ -f "$WPA_SUPPLICANT_CONF" ]; then
+		echo " * Installing wpasupplicant, wireless-tools and udhcpc"
+		chroot $INST_DIR apt-get --yes install wpasupplicant wireless-tools udhcpc
+		echo " * $WPA_SUPPLICANT_CONF copied from this machine"
+		cat >$INST_DIR$WPA_SUPPLICANT_CONF <$WPA_SUPPLICANT_CONF
+	fi
 
-echo " * Installing /root/.xsession"
-cat > $INST_DIR/root/.xsession <<EOMATCHBOX
+	echo " * Installing /root/.xsession"
+	cat > $INST_DIR/root/.xsession <<EOMATCHBOX
 #!/bin/sh
 trayer --edge top &
 openmoko-panel-plugin &
@@ -804,52 +804,52 @@ zhone &
 exec matchbox-window-manager -use_titlebar no -use_cursor no
 EOMATCHBOX
 
-echo "I: System configured"
+	echo "I: System configured"
 }
 
 #
 # Stage kernel
 #
 action_kernel () {
-echo "Installing kernel package"
+	echo "Installing kernel package"
 
-if [ "$SD_PART1_FS" = "vfat" ]; then
-	echo "E: when using $SD_PART1_FS as filesystem for the first microSD card"
-	echo "   partition, you should manully install the kernel, since dpkg"
-	echo "   does not support non-POSIX filesystems:"
-	echo "     http://bugs.debian.org/bug=315493"
-	exit 1
-fi
+	if [ "$SD_PART1_FS" = "vfat" ]; then
+		echo "E: when using $SD_PART1_FS as filesystem for the first microSD card"
+		echo "   partition, you should manully install the kernel, since dpkg"
+		echo "   does not support non-POSIX filesystems:"
+		echo "     http://bugs.debian.org/bug=315493"
+		exit 1
+	fi
 
-chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
+	chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
 apt-get --yes install linux-image-2.6.28-openmoko-gta02
 apt-get clean
 __END_CHROOT__
-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 -s uImage.bin $BOOT_DIR/uImage-GTA02.bin
-	else
-		mkdir $BOOT_DIR
-		ln -s ../uImage.bin $BOOT_DIR/uImage-GTA02.bin
-	fi
+	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 -s uImage.bin $BOOT_DIR/uImage-GTA02.bin
+		else
+			mkdir $BOOT_DIR
+			ln -s ../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	
-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
 }
 
 
@@ -857,15 +857,15 @@ fi
 # Stage uboot
 #
 action_uboot () {
-echo "Modifying U-Boot bootloader menu"
+	echo "Modifying U-Boot bootloader menu"
 
-if [ "$SD_PART1_FS" = "vfat" ]; then
-	echo "E: when using $SD_PART1_FS as filesystem for the first microSD card"
-	echo "   partition, you should not modify the U-Boot environment"
-	exit 1
-fi
+	if [ "$SD_PART1_FS" = "vfat" ]; then
+		echo "E: when using $SD_PART1_FS as filesystem for the first microSD card"
+		echo "   partition, you should not modify the U-Boot environment"
+		exit 1
+	fi
 
-cat > $INST_DIR/root/uboot_menu.in <<'__END__'
+	cat > $INST_DIR/root/uboot_menu.in <<'__END__'
 bootcmd=
   setenv bootargs
     ${bootargs_base} ${mtdparts}
@@ -908,15 +908,15 @@ menu_7=
 menu_8=
 __END__
 
-echo " * Checking for a sane MTD configuration"
-if ! fgrep mtd2 < /proc/mtd |fgrep -q "u-boot_env"; then
-	echo "E: U-Boot environment not found at expected location in mtd2"
-	exit 1
-fi
+	echo " * Checking for a sane MTD configuration"
+	if ! fgrep mtd2 < /proc/mtd |fgrep -q "u-boot_env"; then
+		echo "E: U-Boot environment not found at expected location in mtd2"
+		exit 1
+	fi
 
-echo " * Mounting /dev inside the chroot at $INST_DIR"
-mount -o bind /dev $INST_DIR/dev
-chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
+	echo " * Mounting /dev inside the chroot at $INST_DIR"
+	mount -o bind /dev $INST_DIR/dev
+	chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
 echo " * Dumping current U-Boot environment"
 #dd if=/dev/mtdblock2 of=\$INST_DIR/root/env.orig
 nanddump /dev/mtd2 -o -b -f /root/env.orig
@@ -935,22 +935,22 @@ flash_eraseall /dev/mtd2
 nandwrite /dev/mtd2 /root/env.new
 __END_CHROOT__
 
-echo " * Unmounting /dev"
-umount $INST_DIR/dev
+	echo " * Unmounting /dev"
+	umount $INST_DIR/dev
 
-echo "I: U-Boot environment modified"
+	echo "I: U-Boot environment modified"
 }
 
 #
 # Stage unmount
 #
 action_unmount () {
-echo "Unmounting microSD card partitions"
-if [ "$SINGLE_PART" != "true" ]; then
-	umount $INST_DIR/boot
-fi
-umount $INST_DIR
-echo "I: microSD card partitions unmounted"
+	echo "Unmounting microSD card partitions"
+	if [ "$SINGLE_PART" != "true" ]; then
+		umount $INST_DIR/boot
+	fi
+	umount $INST_DIR
+	echo "I: microSD card partitions unmounted"
 }
 
 #

-- 
Various non-packaged files



More information about the pkg-fso-commits mailing list