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

Steffen Moeller moeller at debian.org
Sat Feb 28 14:56:05 UTC 2009


The following commit has been merged in the master branch:
commit ad47764c50b622f039bcbfcbcabcf4fea30ad392
Merge: c5d58c536273273f8a7f31fc408ed0a6a0207012 aed8308ae46e5139415108fc1b339a10f33c4192
Author: Steffen Moeller <moeller at debian.org>
Date:   Sat Feb 28 15:55:36 2009 +0100

    Merge branch 'tasks'

diff --combined install.sh
index 14c2387,491d5ce..e599d8c
--- a/install.sh
+++ b/install.sh
@@@ -43,6 -43,7 +43,7 @@@ lc () 
  APT_OPTIONS=${APT_OPTIONS:- --yes}
  APT_RECOMMENDS=${APT_RECOMMENDS:-false}
  DASH_BINSH=${DASH_BINSH:-true}
+ EXTRA_TASKS=""
  FSO_MIRROR=${FSO_MIRROR:-http://pkg-fso.alioth.debian.org/debian}
  FSO_DEVICE=${FSO_DEVICE:-gta02}
  HOSTNAME=${HOSTNAME:-debian-gta02}
@@@ -56,7 -57,6 +57,6 @@@ SD_PART1_SIZE=${SD_PART1_SIZE:-8
  SD_PART2_FS=${SD_PART2_FS:-ext3}
  SD_SWAP_SIZE=${SD_SWAP_SIZE:-0}
  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,6 -76,9 +76,9 @@@ RDATEHOST=ntp.fu-berlin.d
  WPA_SUPPLICANT_CONF=/etc/wpa_supplicant/wpa_supplicant.conf
  DROPBEAR_KEYS="/etc/dropbear/dropbear_rsa_host_key /etc/dropbear/dropbear_dss_host_key"
  
+ # internal variables
+ intern_instdir_already_present="" 
+ 
  # cdebootstrap options
  # with packages for a basic debian with network connectivity
  CDEBOOTSTRAP_FLAVOUR=minimal
@@@ -91,7 -94,10 +94,10 @@@ xserver-xorg-video-fbdev xserver-xorg-i
  xserver-xorg-input-all- xserver-xorg-input-synaptics- xserver-xorg-input-wacom- xserver-xorg-video-all- xserver-xorg-video-v4l- xserver-xorg-video-voodoo- xserver-xorg-video-vga- xserver-xorg-video-vesa- xserver-xorg-video-tseng- xserver-xorg-video-trident- xserver-xorg-video-tga- xserver-xorg-video-tdfx- xserver-xorg-video-sisusb- xserver-xorg-video-sis- xserver-xorg-video-siliconmotion- xserver-xorg-video-savage- xserver-xorg-video-s3virge- xserver-xorg-video-s3- xserver-xorg-video-rendition- xserver-xorg-video-radeonhd- xserver-xorg-video-nv- xserver-xorg-video-nsc- xserver-xorg-video-neomagic- xserver-xorg-video-mga- xserver-xorg-video-imstt- xserver-xorg-video-i740- xserver-xorg-video-i128- xserver-xorg-video-glint- xserver-xorg-video-dummy- xserver-xorg-video-cyrix- xserver-xorg-video-chips- xserver-xorg-video-ati- xserver-xorg-video-radeon- xserver-xorg-video-mach64- xserver-xorg-video-r128- xserver-xorg-video-cirrus- xserver-xorg-video-ark- xserver-xorg-video-apm-"
  
  # Games sufficiently well suited for the FreeRunner
- GAMES_PACKAGES="mokomaze"
+ PACKAGES_TASK_GAMES="mokomaze sgt-puzzles"
+ PACKAGES_TASK_GPS="tangogps"
+ PACKAGES_TASK_PHONE="zhone"
+ PACKAGES_TASK_WEB="midori"
  
  # device-specific values
  UBOOT_ENV_SIZE=262144
@@@ -217,17 -223,12 +223,12 @@@ ENVIRONMEN
                       do this only when QI=true (set to '$QI_VERBOSE_BOOT')
  	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
  
      Stages:
  
- 	minimal      Runs all the stages in the following order:
+ 	all          Runs all the stages in the following order:
                                  testing time partition format mount debian
-                                 apt fso configuration kernel unmount
- 	all          Like 'minimal', but also installs a selection of games.
+                                 apt fso configuration kernel tasks unmount
  	testing      Verifys that everything is in place for this
                       installer to work
  	time         Fetches the current time from $RDATEHOST via rdate
@@@ -243,9 -244,20 +244,20 @@@
  	debian       Installs a basic Debian system, including an SSH server
  	apt          Configure APT
  	fso          Installs packages required to use the Zhone GUI
- 	games        Installs games that were designed with FreeRunner-like
-                      devices in mind (currently this is only mokomaze, an
-                      upcoming candidate is numpy-physics).
+ 	tasks        Installs packages for a series of tasks. Supported are
+                        GAMES  Installs games that were designed with
+                               FreeRunner-like devices in mind (currently
+                               this is only mokomaze) or that have been found
+                               compatible (sgt-puzzles, an upcoming candidate
+                               is numpy-physics).
+                        GPS    Software for GPS, geocaching and navigation
+                               (only tangogps as a technical exercise for the
+                               moment)
+                        PHONE  zhone (always selected)
+                        WEB    midori
+                        WIFI   wicd
+                      To specify the tasks shall be assigned to the TASKS
+                      environment variable as a comma separated list.
  	configuration    Configures various parts of the system, such as
                       the X server
  	kernel       Downloads and installs the Debian kernel package
@@@ -273,7 -285,28 +285,28 @@@ OPTION
                       sets the SD_PART1_SIZE variable
  	--swap-size <megabytes>
                       sets the SD_SWAP_SIZE variable
- 	--with-wifi  sets the WITH_WIFI variable (experimental, non functional)
+ 
+ EXAMPLE
+ 
+ 	./install.sh --part1-fs vfat --part1-size 16  all
+ 
+ 	Performs a complete installation. Tasks would be addressed if the
+ 	TASKS environment variable would have been set.
+ 
+ 	TASKS="GAMES,GPS" ./install.sh --part1-fs vfat --part1-size 16  all
+ 
+ 	As before, but now extra packages are installed (and configured)
+ 	to prepare a selection of games and a reasonably complete utilisation
+ 	of the GPS funcionality.
+ 
+ 	TASKS="GAMES,GPS" ./install.sh --part1-fs vfat --part1-size 16  tasks
+ 
+ 	This is the delta between the prior two examples.
+ 
+ 	TASKS="GAMES,GPS" ./install.sh --part1-fs vfat --part1-size 16
+ 
+ 	E: This does nothing since no install target is defined.
+ 
  
  BUGS
  	Only the current (second) generation of devices is supported.
@@@ -393,7 -426,7 +426,7 @@@ action_testing () 
  		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 )
 +		( 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
@@@ -407,7 -440,7 +440,7 @@@
  			# 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 )
 +			( 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
@@@ -602,9 -635,11 +635,11 @@@ action_format () 
  action_mount () {
  	echo "Mounting the newly created system"
  	if [ -d "$INST_DIR" ]; then
- 		 mkdir -p "$INST_DIR"; 
+ 		mkdir -p "$INST_DIR"; 
+ 		intern_instdir_already_present="" 
  	elif [ -n "$verbose" ]; then
  		echo "Not creating directory '$INST_DIR', it is already existing."
+ 		intern_instdir_already_present="true" 
  	fi
  	if [ "$SINGLE_PART" = "true" ]; then
  		if [ -n "$verbose" ]; then echo "Preparing single ext2 device."; fi
@@@ -632,37 -667,11 +667,11 @@@ action_debian () 
  
  	echo " * Downloading cdebootstrap package"
  	wget $CDEBOOTSTRAP_PACKAGE -O /tmp/cdebootstrap.deb
 -	( cd /tmp; ar -x cdebootstrap.deb data.tar.gz )
 +	( 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
@@@ -672,7 -681,7 +681,7 @@@
  		--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"
  }
  
  
@@@ -692,33 -701,11 +701,33 @@@ __END_
  	echo " * Install APT recommends by default: $APT_RECOMMENDS"
  	echo "APT::Install-Recommends \"$APT_RECOMMENDS\";" > "$INST_DIR/etc/apt/apt.conf.d/99recommends"
  
 +	echo " * Learning public key for pkg-fso-keyring"
 +	chroot "$INST_DIR" apt-key add - <<__END__
 +-----BEGIN PGP PUBLIC KEY BLOCK-----
 +Version: GnuPG v1.4.6 (GNU/Linux)
 +
 +mQGiBEicYhYRBACvesYUC+rkRpp0j/PTEimmuPkZqjLuRnpXqlCXV9Y1TZxvPmFl
 +TwoeBHYoh3Uipbj0WypAJ3N989OQPiPo+lyrPNscRYc9+H/k7Q47Oc0ms23EQSWX
 +AdnuhRezNF98cW/bmykVO9uZo+OjA501R9SCrMkhkbuifB57OMdXA0o67wCg0NWM
 +EOAqQ/DCoo9Nqnb5sWotwisD/15dgunBY1BCyz8o7Ky1gn+Cel3LfNaqCIHwgCNf
 +oxdAzHViNHMJa13Hab/nBY1GPpfJ3VIvLNs309JTDoKnYFvUkinvt+OJcY4z/3XN
 +yloHhUoFBOSuZUy/xqB5PVrlQYJ07WKQHOkjvcp5LCH7pTLjCu8ih+YIIr4uipNl
 +ZjBwA/9bCGQysO4xaHCR+qEZcQ1J4tW2A1g6Kr8p2CHxvGVCCQW7hhIRVIVGXF83
 +EViOVobmG8RHZFpAJzdsrJ/jkYBZp62wCs1DTljxLdMfY9vlKzpui3RSPv10fdPX
 +t2iPG4Qc9Qm2H6LkWDfSJx6FLzDKrcj8tmbLTpr+fdJZtehudLRNcGtnLWZzbyBB
 +cmNoaXZlIEF1dG9tYXRpYyBTaWduaW5nIEtleSA8cGtnLWZzby1tYWludEBsaXN0
 +cy5hbGlvdGguZGViaWFuLm9yZz6IZgQTEQIAJgUCSJxiFgIbAwUJAeEzgAYLCQgH
 +AwIEFQIIAwQWAgMBAh4BAheAAAoJEOK53mqOezI7vToAnR+D4n8UEyBKHPc5mqVc
 +KlzsMB1qAKCNHBbdoCuo/b9ZRdbj0d3zCKGOQA==
 +=MfK3
 +-----END PGP PUBLIC KEY BLOCK-----
 +__END__
 +
  	echo " * Updating APT database"
  	chroot "$INST_DIR" apt-get update
  
  	echo " * Installing pkg-fso keyring"
 -	chroot "$INST_DIR" apt-get $APT_OPTIONS install pkg-fso-keyring
 +	chroot $INST_DIR apt-get $APT_OPTIONS install pkg-fso-keyring
  
  	echo " * Removing additional packages"
  	chroot "$INST_DIR" /bin/sh -e <<__END_CHROOT__
@@@ -746,15 -733,51 +755,51 @@@ __END_CHROOT_
  
  
  #
- # Stage games
+ # Stage tasks
  #
- action_games () {
- 	echo "Installing a selection of games"
- 	chroot "$INST_DIR" /bin/sh -e <<__END_CHROOT__
- apt-get $APT_OPTIONS install $GAMES_PACKAGES
- apt-get clean
- __END_CHROOT__
- 	echo "I: Selection of nice games installed"
+ #	These steps shall be executed only after all basic packages
+ #	have been installed.
+ #
+ action_tasks () {
+ 
+ 	if  [ -z "$TASKS" ]; then
+ 		if [ -n "$VERBOSE" ]; then
+ 			echo
+ 			echo "No task selected."
+ 			echo
+ 		fi
+ 		return 0;
+ 	fi
+ 
+ 	echo "Performing selected tasks: $TASKS"
+ 
+ 	for intern_task in $( echo $TASKS|tr "," " ")
+ 	do
+ 		echo " * task: $intern_task"
+ 		eval chroot "$INST_DIR" apt-get install $APT_OPTIONS \$PACKAGES_TASK_$intern_task
+ 		chroot "$INST_DIR" apt-get clean
+ 		echo "I: Selection of packages for task $intern_task installed"
+ 
+ 		case "$intern_task" in
+ 		  "WIFI")
+ 			#sed -i '/^exec/iif [ -x /usr/bin/wicd-client ]; then wicd-client --no-animate &; fi' "$INST_DIR/root/.xsession"
+ 			sed -i '/^exec/i#wicd-client --no-animate &' "$INST_DIR/root/.xsession"
+ 			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"
+ 				echo "[Settings]" >> "$INST_DIR/etc/wicd/manager-settings.conf"
+ 			fi
+ 			echo "wired_interface =" >> "$INST_DIR/etc/wicd/manager-settings.conf"
+ 			echo " * All extra activity for task '$intern_task' completed."
+ 			;;
+ 		  *)
+ 			echo " * No extra activity for task '$intern_task'."
+ 			;;
+ 		esac
+ 	done
  }
  
  
@@@ -894,25 -917,6 +939,6 @@@ __END_
  	echo 'dash dash/sh string $DASH_BINSH' | chroot "$INST_DIR" debconf-set-selections
  	chroot "$INST_DIR" apt-get $APT_OPTIONS 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"
@@@ -930,15 -934,6 +956,6 @@@ zhone 
  exec matchbox-window-manager -use_titlebar no -use_cursor no
  EOMATCHBOX
  
- 	case "$WITH_WIFI" in
- 	  "wicd")
- 		#sed -i '/^exec/iif [ -x /usr/bin/wicd-client ]; then wicd-client --no-animate &; fi' "$INST_DIR/root/.xsession"
- 		sed -i '/^exec/i#wicd-client --no-animate &' "$INST_DIR/root/.xsession"
- 		;;
- 	  *)
- 		;;
- 	esac
- 
  	echo "I: System configured"
  }
  
@@@ -1040,9 -1035,9 +1057,9 @@@ action_uboot () 
  	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
 +		echo "W: When using $SD_PART1_FS as filesystem for the first microSD card"
 +		echo "   partition, you should not modify the U-Boot environment."
 +		return 1
  	fi
  
  	cat > "$INST_DIR/root/uboot_menu.in" <<'__END__'
@@@ -1129,8 -1124,37 +1146,37 @@@ action_unmount () 
  	if [ "$SINGLE_PART" != "true" ]; then
  		umount "$INST_DIR/boot"
  	fi
- 	umount "$INST_DIR"
+ 	if ! umount "$INST_DIR"; then
+ 		echo "W: Could not unmount install directory '$INST_DIR'."
+ 		return 1;
+ 	fi
  	echo "I: microSD card partitions unmounted"
+ 
+ 	if [ -z "$intern_instdir_already_present" -o "no" = "$intern_instdir_already_present" ]; then
+ 		if ! rmdir "$INST_DIR"; then
+ 			echo "W: Could not remove directory '$INST_DIR'."
+ 			echo
+ 		fi
+ 
+ 		cat <<EOINSTRUCTIONS
+ 
+ The directory '$INST_DIR' to which Debian was installed
+ is not available any longer. You may want to consider to
+ recreate the directory '$INSTDIR' with
+ 
+ mkdir "$INST_DIR"
+ 
+ and add the line
+ 
+ /dev/mmcblk0p2  $INST_DIR  auto  defaults,async  0  0
+ 
+ to the file /etc/fstab, so it will be mounted with subsequent
+ boots into the current system.
+ 
+ EOINSTRUCTIONS
+ 	fi
+ 
+ 	return 0
  }
  
  #
@@@ -1189,11 -1213,25 +1235,11 @@@ d
  			assignNumeric="true"
  			assignVariablename="SD_SWAP_SIZE"
  			;;
- 		 "--with-wifi")
+ 		 "--with-tasks")
                          assignParametername="$i"
- 			assignVariablename="WITH_WIFI"
+ 			assignVariablename="TASKS"
  			;;
  
 -		 "minimal")
 -			action_testing
 -			action_time
 -			action_partition
 -			action_format
 -			action_mount
 -			action_debian
 -			action_apt
 -			action_fso
 -			action_configuration
 -			action_kernel
 -			action_uboot
 -			action_unmount
 -			;;
  		 "all")
  			action_testing
  			action_time
@@@ -1204,16 -1242,14 +1250,18 @@@
  			action_apt
  			action_fso
  			action_configuration
- 			action_games
+ 			if [ -n "$TASKS" ]; then
+ 				action_tasks
+ 			fi
  			action_kernel
 -			action_uboot
 +			if [ "vfat" == "SD_PART1_FS" ]; then
 +				echo "Skipping uboot modification since boot partition is of type '$SD_PART1_FS'."
 +			else
 +				action_uboot
 +			fi
  			action_unmount
  			;;
- 		 "testing"|"time"|"partition"|"format"|"mount"|"debian"|"apt"|"fso"|"configuration"|"kernel"|"unmount"|"uboot"|"games")
+ 		 "testing"|"time"|"partition"|"format"|"mount"|"debian"|"apt"|"fso"|"configuration"|"kernel"|"unmount"|"uboot"|"tasks")
  			if [ -z "$showHelp" ]; then
  				echo "Running stage $i"
  				action_$i

-- 
Various non-packaged files



More information about the pkg-fso-commits mailing list