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

Joachim Breitner mail at joachim-breitner.de
Sun Jul 26 12:20:56 UTC 2009


The following commit has been merged in the master branch:
commit 73e5175f051272a17d07e4dee828d43bceba3781
Merge: 2f49253b7fe86ca53b85d90b166913dcbbe00464 56831dbd08417f933ddecd53875914ee75c863d0
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Sun Jul 26 14:20:34 2009 +0200

    Merge commit 'alioth/master'

diff --combined install.sh
index 669281a,3c04e09..c40ca3a
--- a/install.sh
+++ b/install.sh
@@@ -44,30 -44,42 +44,42 @@@ APT_OPTIONS=${APT_OPTIONS:- --yes
  APT_RECOMMENDS=${APT_RECOMMENDS:-false}
  DASH_BINSH=${DASH_BINSH:-true}
  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}
- 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:-}
  QI=${QI:-false}
  QI_VERBOSE_BOOT=${QI_VERBOSE_BOOT:-false}
+ ROOT_PASSWORD=${ROOT_PASSWORD:-changeme}
  SD_DEVICE=${SD_DEVICE:-/dev/mmcblk0}
  SD_PART1_FS=${SD_PART1_FS:-ext2}
  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}
+ 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=2.0
+ VERSION=3.0
  VERBOSE=${VERBOSE:-}
  TESTHOST=${TESTHOST:-www.debian.org}
  RDATEHOST=${RDATEHOST:-ntp.fu-berlin.de}
@@@ -76,6 -88,7 +88,7 @@@ MOUNT_PROC="
  
  # internal variables
  intern_instdir_already_present="" 
+ intern_no_partitioning=""
  
  # cdebootstrap options
  # with packages for a basic debian with network connectivity
@@@ -85,11 -98,12 +98,12 @@@ CDEBOOTSTRAP_EXTRA_PACKAGES=ifupdown,dr
  # This gets passed to cdebuildstrap. currently not used
  CDEBOOTSTRAP_EXCLUDE_PACKAGES=hello
  
- # fso-specific packages
- # With work around for some APT/aptitude bug (http://bugs.debian.org/435662)
- FSO_PACKAGES="matchbox-window-manager zhone fso-frameworkd fso-gpsd openmoko-panel-plugin dbus-x11 trayer fso-utils mtd-utils \
- xserver-xorg-video-fbdev xserver-xorg-input-tslib xterm xinit xfonts-base x11-xserver-utils \
- 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-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-"
+ # freesmartphone.org packages
+ # because of some apt-get bug, console-setup must be listed
+ # before any other X.Org package, for more information see
+ # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=435662#45
+ FSO_PACKAGES="matchbox-window-manager fso-frameworkd fso-gpsd openmoko-panel-plugin dbus-x11 trayer fso-utils mtd-utils \
+ console-setup xserver-xorg-video-fbdev xserver-xorg-input-tslib xserver-xorg-core xserver-xorg xterm xinit xfonts-base x11-xserver-utils"
  
  # well-suited software for the FreeRunner
  PACKAGES_TASK_GAMES="mokomaze sgt-puzzles"
@@@ -198,6 -212,22 +212,22 @@@ __END_
  
  }
  
+ root_password_warning () {
+ 	cat <<__END__
+ ***********
+ * WARNING *
+ ***********
+ 
+ Starting from version 3.0, the root password is no more empty,
+ but defaults to 'changeme'.  You can configure it through the
+ ROOT_PASSWORD variable.
+ 
+ Press any key within 5 seconds to quit
+ __END__
+ 
+ 	five_seconds_to_quit
+ 
+ }
  
  usage () {
  	cat <<__END__
@@@ -250,10 -280,11 +280,11 @@@ ENVIRONMEN
                       (set to '$APT_RECOMMENDS', possible values are false/true)
  	DASH_BINSH   configure dash as default /bin/sh (set to '$DASH_BINSH',
                       possible values are true/false)
- 	FSO_MIRROR   the Debian FSO repository (set to
+ 	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 
@@@ -270,12 -301,15 +301,15 @@@
                       package in the Debian archive, which could require
                       a LOT of disk space; set to none if you do not
                       want a Display Manager)
+ 	ZHONE        set this to true to install the Zhone GUI (set to '$ZHONE')
+ 	ROOT_PASSWORD  the password for the root account (set to '$ROOT_PASSWORD')
  
      Stages:
  
  	all          Runs all the stages in the following order:
-                                 testing time partition format mount debian
-                                 apt fso configuration kernel tasks unmount
+                                 testing time partition format mount
+                                 debian apt fso configuration tasks
+                                 kernel cleanup unmount
  	testing      Verifys that everything is in place for this
                       installer to work
  	time         Fetches the current time from $RDATEHOST via rdate
@@@ -290,7 -324,8 +324,8 @@@
  	mount        Mounts microSD card partitions under '$INST_DIR'
  	debian       Installs a basic Debian system, including an SSH server
  	apt          Configure APT
- 	fso          Installs packages required to use the Zhone GUI
+ 	fso          Install freesmartphone.org packages (by default this
+                      also include the Zhone GUI, see the ZHONE variable)
  	tasks        Installs packages for a series of tasks. Supported are
                         GAMES  Installs games that were designed with
                                FreeRunner-like devices in mind or that have
@@@ -316,6 -351,7 +351,7 @@@
                       the X server
  	kernel       Downloads and installs the Debian kernel package
                       (only when $SD_PART1_FS is set to ext2)
+ 	cleanup      Remove unnecessary package and clean APT cache
  	unmount      Unmounts the Debian filesystem mounted at '$INST_DIR'
  
      Unsupported or buggy stages, use at your own risk:
@@@ -335,6 -371,8 +371,8 @@@ OPTION
                       sets the HOSTNAME variable
  	--mount-proc
                       mounts /proc directory in Debian chroot
+ 	-np|--no-partitioning
+                      disable the partitioning when otherwise doing "all"
  	--part1-fs <vfat|ext2|ext3>
                       sets the SD_PART1_FS variable
  	--part1-size <megabytes>
@@@ -348,6 -386,10 +386,10 @@@
  
  EXAMPLE
  
+ 	Next to your install.sh script you may want to create a file
+ 	that remembers the parameters for you that you have chosen for
+ 	your previous setup.
+ 
  	./install.sh --part1-fs vfat --part1-size 16  all
  
  	Performs a complete installation. Tasks would be addressed if the
@@@ -367,9 -409,10 +409,10 @@@
  
  	E: This does nothing since no install target is defined.
  
- 
  BUGS
- 	Only the current (second) generation of devices is supported.
+ 	Only the current (second) generation of devices is fully supported.
+ 	This script should be functional with the GTA01 except for the
+ 	installation of the kernel.
  
  	For comments or contributions, you can directly send emails
  	to the list mentioned below. However, please be aware of the
@@@ -440,10 -483,28 +483,28 @@@ I: dash as default /bin/sh se to $DASH_
  
  __END__
  
- 	for f in testing time partition format mount debian apt fso configuration kernel unmount
+ 	for f in testing time partition format mount debian apt fso configuration tasks kernel cleanup unmount
  	do
- 		if [ -n "$VERBOSE" ]; then echo calling '$f'; fi
- 		action_$f
+ 		case "$f" in
+ 			"partition")
+ 				if [ -n "$intern_no_partitioning" ]; then
+ 					echo " * Skipping partitioning since --no-partitioning flag set"
+ 				else
+ 					action_partition
+ 				fi
+ 				;;
+ 			"tasks")
+ 				if [ -z "$TASKS" ]; then
+ 					echo " * Skipping over installing tasks since none were specified"
+ 				else
+ 					action_tasks
+ 				fi
+ 				;;
+ 			*)
+ 				if [ -n "$VERBOSE" ]; then echo calling '$f'; fi
+ 				action_$f
+ 				;;
+ 		esac
  	done
  	cat <<__END__
  
@@@ -569,7 -630,6 +630,6 @@@ action_partition () 
  	fi
  
  	# run partitioner
- 	rootpartno=2
  	bootfstypeno=83
  
  	if [ -z "$SD_SWAP_SIZE" ]; then SD_SWAP_SIZE=0; fi
@@@ -687,20 -747,17 +747,17 @@@ action_format () 
  
  	if [ -z "$SD_SWAP_SIZE" ]; then SD_SWAP_SIZE=0; fi
  
- 	echo " * Formatting the microSD card partitions"
- 	if [ "$SINGLE_PART" = "true" ]; then
- 		mkfs.ext2 ${SD_DEVICE}p1
- 		if [ 0 -lt "$SD_SWAP_SIZE" ]; then
- 			echo " * Formatting swap on ${SD_DEVICE}p2"
- 			mkswap ${SD_DEVICE}p2
- 		fi
- 	else
- 		mkfs.$SD_PART1_FS ${SD_DEVICE}p1
+ 	echo " * Formatting ${SD_PART1_FS} on ${SD_DEVICE}p1"
+ 	mkfs.$SD_PART1_FS ${SD_DEVICE}p1
+ 	nextpart=2
+ 	if [ "$SINGLE_PART" != "true" ]; then
+ 		echo " * Formatting ${SD_PART2_FS} on ${SD_DEVICE}p2"
  		mkfs.$SD_PART2_FS ${SD_DEVICE}p2
- 		if [ 0 -lt "$SD_SWAP_SIZE" ]; then
- 			echo " * Formatting swap on ${SD_DEVICE}p3"
- 			mkswap ${SD_DEVICE}p3
- 		fi
+ 		nextpart=3
+ 	fi
+ 	if [ 0 -lt "$SD_SWAP_SIZE" ]; then
+ 		echo " * Formatting swap on ${SD_DEVICE}p${nextpart}"
+ 		mkswap ${SD_DEVICE}p${nextpart}
  	fi
  
  	echo "I: microSD card ready"
@@@ -772,9 -829,8 +829,8 @@@ action_apt () 
  
  	ensure_proc_is_mounted
  
- 	echo " * Creating /etc/apt/sources.list"
- 	cat > "$INST_DIR/etc/apt/sources.list" <<__END__
- deb $INST_MIRROR unstable main
+ 	echo " * Populating /etc/apt/sources.list"
+ 	cat >> "$INST_DIR/etc/apt/sources.list" <<__END__
  deb $INST_MIRROR experimental main
  deb $FSO_MIRROR unstable main
  __END__
@@@ -810,12 -866,8 +866,8 @@@ __END_
  	echo " * Installing 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__
- apt-get update
- apt-get --yes --purge remove cdebootstrap-helper-rc.d
- apt-get clean
- __END_CHROOT__
+ 	echo " * Cleaning APT cache"
+ 	chroot $INST_DIR apt-get clean
  
  	echo "I: APT configured"
  }
@@@ -825,16 -877,23 +877,23 @@@
  # Stage fso
  #
  action_fso () {
- 	# TODO
+ 	echo "Installing freesmartphone.org software"
  
  	ensure_proc_is_mounted
  
- 	echo "Installing FSO-specific packages"
+ 	echo "* core packages"
  	chroot "$INST_DIR" /bin/sh -e <<__END_CHROOT__
+ export DEBIAN_FRONTEND=noninteractive
  apt-get $APT_OPTIONS install $FSO_PACKAGES
  apt-get clean
  __END_CHROOT__
- 	echo "I: FSO packages installed"
+ 
+ 	echo "* Zhone GUI: $ZHONE"
+ 	if [ "$ZHONE" = true ]; then
+ 		chroot "$INST_DIR" apt-get $APT_OPTIONS install zhone
+ 	fi
+ 
+ 	echo "I: freesmartphone.org software installed"
  }
  
  
@@@ -906,6 -965,8 +965,8 @@@ action_tasks () 
  action_configuration () {
  	echo "Configuring system files for ${FSO_DEVICE}"
  
+ 	root_password_warning
+ 
  	ensure_proc_is_mounted
  
  	if [ "true" = "$LOCALEPURGE" ]; then
@@@ -926,7 -987,6 +987,6 @@@ Section "InputDevice
  	Driver		"tslib"
  	Option		"CorePointer"		"true"
  	Option		"SendCoreEvents"	"true"
- 	Option		"Device"		"/dev/input/event1"
  	Option		"Protocol"		"Auto"
  	Option		"Width"			"480"
  	Option		"Height"		"640"
@@@ -1047,8 -1107,11 +1107,11 @@@ __END_
  		cat > "$INST_DIR$FILE" <$FILE
  	done
  
- 	echo " * Setting empty root password"
- 	echo 'root:' | chroot "$INST_DIR" chpasswd
+ 	# empty passwords now require modification to PAM
+ 	# http://lists.alioth.debian.org/pipermail/pkg-fso-maint/2009-May/001225.html
+ 	# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525153
+ 	echo " * Setting root password to '$ROOT_PASSWORD'"
+ 	echo "root:$ROOT_PASSWORD" | chroot "$INST_DIR" chpasswd
  
  	for HOST_KEY in $DROPBEAR_KEYS; do
  		if [ -f "$HOST_KEY" ]; then
@@@ -1085,8 -1148,7 +1148,8 @@@ EOPANELPLUGI
  	else
  		echo " * Installing Display Manager $DISPLAY_MANAGER"
  		if [ "$DISPLAY_MANAGER" = nodm ]; then
 -			echo 'nodm nodm/x_options string "vt4 -nolisten tcp"' | chroot "$INST_DIR" debconf-set-selections
 +			echo 'nodm nodm/x_options string "-nolisten tcp"' | chroot "$INST_DIR" debconf-set-selections
 +			echo 'nodm nodm/first_vt string "3"' | chroot "$INST_DIR" debconf-set-selections
  			echo 'nodm nodm/enabled string "true"' | chroot "$INST_DIR" debconf-set-selections
  		fi
  		chroot "$INST_DIR" apt-get $APT_OPTIONS install $DISPLAY_MANAGER
@@@ -1292,6 -1354,22 +1355,22 @@@ __END_CHROOT_
  }
  
  #
+ # Stage cleaunp
+ #
+ action_cleanup () {
+ 
+ 	echo "Cleaning the environment"
+ 
+ 	echo " * Remove additional packages"
+ 	chroot $INST_DIR apt-get --yes --purge remove cdebootstrap-helper-rc.d
+ 
+ 	echo " * Cleaning APT cache"
+ 	chroot $INST_DIR apt-get clean
+ 
+ 	echo "I: the environment is now clean!"
+ }
+ 
+ #
  # Stage unmount
  #
  action_unmount () {
@@@ -1389,6 -1467,9 +1468,9 @@@ d
                          assignParametername="$i"
                          assignVariablename="HOSTNAME"
  			;;
+ 		 "--no-partitioning")
+ 			intern_no_partitioning="true"
+ 			;;
  		 "--part1-fs")
                          assignParametername="$i"
  			assignVariablename="SD_PART1_FS"
@@@ -1414,22 -1495,10 +1496,10 @@@
  			MOUNT_PROC="true"
  			;;
  		 "all")
- 			action_testing
- 			action_time
- 			action_partition
- 			action_format
- 			action_mount
- 			action_debian
- 			action_apt
- 			action_fso
- 			action_configuration
- 			if [ -n "$TASKS" ]; then
- 				action_tasks
- 			fi
- 			action_kernel
- 			action_unmount
+ 			echo "Running all stages"
+ 			action_all
  			;;
- 		 "testing"|"time"|"partition"|"format"|"mount"|"debian"|"apt"|"fso"|"configuration"|"kernel"|"unmount"|"uboot"|"tasks")
+ 		 "testing"|"time"|"partition"|"format"|"mount"|"debian"|"apt"|"fso"|"configuration"|"kernel"|"unmount"|"uboot"|"tasks"|"cleanup")
  			if [ -z "$showHelp" ]; then
  				echo "Running stage $i"
  				action_$i

-- 
Various non-packaged files



More information about the pkg-fso-commits mailing list