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

Steffen Moeller moeller at debian.org
Sat Feb 21 19:48:41 UTC 2009


The following commit has been merged in the master branch:
commit ae1142bdfc9e0701ac1620be00db192a5d4e721e
Merge: a59c6b9f491d549c9d1d0c025c0d71cfe9b2b735 36af4f7e52388580d16ebf8c6df29b65194d5825
Author: Steffen Moeller <moeller at debian.org>
Date:   Sat Feb 21 20:38:17 2009 +0100

    Merge branch 'indented'
    
    Performed complete test run.
    
    Conflicts:
    	install.sh

diff --combined install.sh
index 5780edc,3a5bf39..8c37b0a
mode 100755,100644..100644
--- a/install.sh
+++ b/install.sh
@@@ -54,7 -54,6 +54,7 @@@ FSO_DEVICE=${FSO_DEVICE:-gta02
  QI=${QI:-false}
  QI_VERBOSE_BOOT=${QI_VERBOSE_BOOT:-false}
  SINGLE_PART=${SINGLE_PART:-$QI}
 +WITH_WIFI=${WITH_WIFI:-none}
  
  # hardening for the case that a user uses capitals
  lc SD_PART1_FS SD_PART2_FS APT_RECOMMENDS QI QI_VERBOSE_BOOT FSO_DEVICE
@@@ -76,7 -75,6 +76,7 @@@ DROPBEAR_KEYS="/etc/dropbear/dropbear_r
  
  # cdebootstrap options
  # with packages for a basic debian with network connectivity
 +CDEBOOTSTRAP_FLAVOUR=minimal
  CDEBOOTSTRAP_PACKAGE=$INST_MIRROR/pool/main/c/cdebootstrap/cdebootstrap-static_0.5.4_armel.deb
  CDEBOOTSTRAP_EXTRA_PACKAGES=ifupdown,dropbear,udev,procps,netbase,vim-tiny,module-init-tools,wget,openssh-client
  # This gets passed to cdebuildstrap. currently not used
@@@ -104,12 -102,12 +104,12 @@@ TAR_PACKAGE=$INST_MIRROR/pool/main/t/ta
  
  # fight against auto-mounting
  umount_all () {
 -	if [ -n "$verbose" ]; then echo "Now unmounting all SD devices."; fi
 +	if [ -n "$VERBOSE" ]; then echo "Now unmounting all SD devices."; fi
  	for I in $(seq 0 9); do
  		cmd="mount | grep -q '^${SD_DEVICE}p$I'"
 -		if [ -n "$verbose" ]; then echo -n " testing #$I ($cmd)"; fi
 +		if [ -n "$VERBOSE" ]; then echo -n " testing #$I ($cmd)"; fi
  		if mount | grep -q "^${SD_DEVICE}p$I" ; then
 -			if [ -n "$verbose" ]; then 
 +			if [ -n "$VERBOSE" ]; then 
  				echo " unmounting"
  			else
  				echo "W: ${SD_DEVICE}p$I is mounted, unmounting"
@@@ -119,11 -117,11 +119,11 @@@
  		#		echo "E: Unmount failed"
  		#		exit 1
  		#	fi
 -		elif [ -n "$verbose" ]; then
 +		elif [ -n "$VERBOSE" ]; then
  			echo 'not mounted'
  		fi
  	done
 -	if [ -n "$verbose" ]; then echo "All SD devices unmounted."; fi
 +	if [ -n "$VERBOSE" ]; then echo "All SD devices unmounted."; fi
  }
  
  five_seconds_to_quit () {
@@@ -151,7 -149,7 +151,7 @@@ This will destroy all the data on the m
  Press any key within 5 seconds to quit
  __END__
  
- five_seconds_to_quit
+ 	five_seconds_to_quit
  
  }
  
@@@ -177,10 -175,7 +177,10 @@@ DESCRIPTIO
  	cdebootstrap to prepare a directory to which it can chroot(8)
  	and complete the configuration. 
  
 -    Variables:
 +ENVIRONMENT
 +
 +	To influence the program's behaviour, set the following
 +	environment variables or leave the default values.
  
  	HOSTNAME     the name of the machine (default to debian-gta02)
  	SD_DEVICE    the character device to access the microSD card
@@@ -210,10 -205,6 +210,10 @@@
                       do this only when QI=true (default to false)
  	SINGLE_PART  set this to true if only one partition should be created
                       this is true by default for QI=true and false if SD_PART1_FS=vfat
 +	WITH_WIFI    determines how to configure the wireless connections. Set
 +                     to 'none' will not install anything (default), 'wicd' is
 +                     supported as an experimental setup (set to '$WITH_WIFI').
 +                     This is not yet functional.
  
      Stages:
  
@@@ -257,7 -248,6 +257,7 @@@ OPTION
  	--part1-fs   sets the SD_PART1_FS variable
  	--part1-size sets the SD_PART1_SIZE variable
  	--swap-size  sets the SD_SWAP_SIZE variable
 +	--with-wifi  sets the WITH_WIFI variable (experimental, not functional)
  
  BUGS
  	Only the current (second) generation of devices is supported.
@@@ -293,8 -283,8 +293,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 *
  ***********
@@@ -308,9 -298,9 +308,9 @@@ information are available at http://bug
  
  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
  }
  
  
@@@ -318,7 -308,7 +318,7 @@@
  # 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
@@@ -330,25 -320,25 +330,25 @@@ I: dash as default /bin/sh se to $DASH_
  
  __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
  }
  
  
@@@ -356,75 -346,75 +356,76 @@@
  # 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
- 
- 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
+ 	echo " * microSD card device: $SD_DEVICE present"
+ 
+ 	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)?"
++		echo "E: System is not claiming to be an armv4tl."
++		echo "   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"
  }
  
  #
@@@ -432,9 -422,9 +433,9 @@@
  #
  
  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`"
  }
  
  #
@@@ -442,29 -432,29 +443,29 @@@
  #
  
  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
@@@ -472,9 -462,9 +473,9 @@@
  $lastcylinder
  EOSINGLECONF
  
- else
- 	partitionno=$(($partitionno+1))
- 	cat <<EOBOOTCONF > /tmp/argsToFdisk$$
+ 	else
+ 		partitionno=$(($partitionno+1))
+ 		cat <<EOBOOTCONF > /tmp/argsToFdisk$$
  n
  p
  $partitionno
@@@ -484,8 -474,8 +485,8 @@@
  $bootfstypeno
  EOBOOTCONF
  
- 	partitionno=$(($partitionno+1))
- 	cat <<EOROOTCONF >> /tmp/argsToFdisk$$
+ 		partitionno=$(($partitionno+1))
+ 		cat <<EOROOTCONF >> /tmp/argsToFdisk$$
  n
  p
  $partitionno
@@@ -495,11 -485,11 +496,11 @@@
  $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
@@@ -510,85 -500,86 +511,86 @@@ $partitionn
  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"
  }
  
  
@@@ -596,49 -587,21 +598,51 @@@
  # 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
  
 +	# extra packages for additional software to be installed
 +	case "$WITH_WIFI" in
 +	  "wicd")
 +		echo " * added wicd to list of packages to install"
 +		echo
 +		echo "   W: You have selected the option --with-wifi wicd"
 +		echo "      which is still under development. Please don't"
 +		echo "      expect it to work, you will have to manually"
 +		echo "      install the wicd package after booting into"
 +		echo "      the system."
 +		echo
 +		CDEBOOTSTRAP_EXTRA_PACKAGES=$CDEBOOTSTRAP_EXTRA_PACKAGES,wicd
 +		#CDEBOOTSTRAP_FLAVOUR=build
 +		;;
 +	  "none")
 +		if [ -n "$VERBOSE" ]; then echo "* support for wifi left for manual installation"; fi
 +		;;
 +	  *)
 +		echo
 +		echo "Unsupported Wifi: '$WITH_WIFI'."
 +		echo
 +		exit 1
 +		;;
 +	esac
 +
 +
- echo " * Running cdebootstrap to install the system (might take a while)"
- CDEBOOTSTRAP_EXTRA_FLAGS=""
- if [ -n "$VERBOSE" ]; then
- 	CDEBOOTSTRAP_EXTRA_FLAGS="$CDEBOOTSTRAP_EXTRA_FLAGS -v"
- fi
- cdebootstrap-static $CDEBOOTSTRAP_EXTRA_FLAGS --allow-unauthenticated --flavour $CDEBOOTSTRAP_FLAVOUR --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_EXTRA_FLAGS=""
++	if [ -n "$VERBOSE" ]; then
++		CDEBOOTSTRAP_EXTRA_FLAGS="$CDEBOOTSTRAP_EXTRA_FLAGS -v"
++	fi
+ 	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"
  }
  
  
@@@ -646,32 -609,32 +650,32 @@@
  # 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"
  }
  
  
@@@ -679,13 -642,13 +683,13 @@@
  # 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"
  }
  
  
@@@ -693,13 -656,13 +697,13 @@@
  # 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"
@@@ -718,8 -681,8 +722,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
@@@ -743,8 -706,8 +747,8 @@@ po::powerokwait:/etc/init.d/powerfail s
  #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
  
@@@ -756,48 -719,45 +760,45 @@@ ohci-hc
  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
@@@ -805,58 -765,38 +806,58 @@@ tmpfs	/var/lock	tmpfs	defaults,noatim
  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
  
 +	case "$WITH_WIFI" in
 +	  "wicd")
 +		# the package was already installed via cdebootstrap
 +		echo " * Installing wicd for wifi setup"
 +		if [ -r "$INST_DIR/etc/wicd/manager-settings.conf" ]; then
 +			grep -v ^wired_interface "$INST_DIR/etc/wicd/manager-settings.conf" > \
 +				"$INST_DIR/etc/wicd/manager-settings.conf"
 +		else
 +			mkdir $INST_DIR/etc/wicd
 +		fi
 +		echo "wired_interface =" >> $INST_DIR/etc/wicd/manager-settings.conf
 +		;;
 +
 +	  "none")
 +		# no installation to be performed
 +		;;
 +	  *)
 +		;;
 +	esac
 +
- 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 &
@@@ -864,15 -804,7 +865,15 @@@ zhone 
  exec matchbox-window-manager -use_titlebar no -use_cursor no
  EOMATCHBOX
  
 +	case "$WITH_WIFI" in
 +	  "wicd")
 +		sed -i '/^exec/iwicd-client --no-animate &' $INST_DIR/root/.xsession
 +		;;
 +	  *)
 +		;;
 +	esac
 +
- echo "I: System configured"
+ 	echo "I: System configured"
  }
  
  #
@@@ -881,89 -813,43 +882,88 @@@
  action_kernel () {
  	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
 +	intern_cmd="apt-get --yes install linux-image-2.6.28-openmoko-gta02"
  
 -	chroot $INST_DIR /bin/sh -e <<__END_CHROOT__
 -apt-get --yes 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
 +			
 +		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__
 +$intern_cmd
  apt-get clean
  __END_CHROOT__
 +	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 [ "$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
  }
  
  
@@@ -971,15 -857,15 +971,15 @@@
  # 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}
@@@ -1022,15 -908,15 +1022,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
@@@ -1049,22 -935,22 +1049,22 @@@ flash_eraseall /dev/mtd
  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"
  }
  
  #
@@@ -1077,7 -963,7 +1077,7 @@@ f
  
  # internal variable
  
 -verbose=""
 +VERBOSE=""
  showHelp=""
  
  # parse options
@@@ -1095,7 -981,7 +1095,7 @@@ d
                          showHelp="true"
                          ;;
                   "--verbose")
 -                        verbose="true"
 +                        VERBOSE="true"
                          ;;
                   "-v")
                          echo "$VERSION"
@@@ -1119,10 -1005,6 +1119,10 @@@
  			assignNumeric="true"
  			assignVariablename="SD_SWAP_SIZE"
  			;;
 +		 "--with-wifi")
 +                        assignParametername="$i"
 +			assignVariablename="WITH_WIFI"
 +			;;
  		 "all")
  			action_testing
  			action_time

-- 
Various non-packaged files



More information about the pkg-fso-commits mailing list