pandora-skel: clean up modutils files
[openpandora.oe.git] / recipes / pandora-system / pandora-first-run-wizard / first-run-wizard.sh
index 7cb2868..5b18906 100755 (executable)
@@ -89,7 +89,7 @@ while ! username=$(zenity --title="Enter your username" --entry --text "Please c
        zenity --title="Error" --error --text="Please try again." --timeout 6
 done
 
-while ! useradd -c "$name,,," -G adm,audio,cdrom,netdev,plugdev,users,video,wheel "$username" ; do
+while ! useradd -c "$name,,," -G adm,audio,cdrom,netdev,plugdev,users,video,wheel,dialout "$username" ; do
        username=$(zenity --title="Please check username" --entry --text "Please ensure that your username consists of only\nletters and numbers and is not already in use on the system." --entry-text "$username")
 done
 
@@ -179,16 +179,19 @@ fi
 
 # Set the timezone and date/time
 
-while ! area=$(zenity --list --title "Select your time zone" --text="Please select your area" --column="Select your area" --print-column=1 "Africa" "America" "Asia" "Australia" "Europe" "Pacific" --width=500 --height=260) || [ "x$area" = "x" ] ; do
+while [ "x$timezone" = "x" ]; do
+
+  while ! area=$(zenity --list --title "Select your time zone" --text="Please select your area" --column="Select your area" --print-column=1 "Africa" "America" "Asia" "Australia" "Europe" "Pacific" --width=500 --height=260) || [ "x$area" = "x" ] ; do
        zenity --title="Error" --error --text="Please select your area." --timeout=6
-done
+  done
+
+  timezone=$(ls -1 /usr/share/zoneinfo/$area | zenity ---width=500 --height=200 --title="Select your closest location" --list --column "Closest Location" --text "Please select the location closest to you")
 
-while ! timezone=$(ls -1 /usr/share/zoneinfo/$area | zenity ---width=500 --height=200 --title="Select your closest location" --list --column "Closest Location" --text "Please select the location closest to you") || [ "x$timezone" = "x" ] ; do
-       zenity --title="Error" --error --text="Please select your location." --timeout=6
 done
 
 echo $timezone
 rm /etc/localtime && ln -s /usr/share/zoneinfo/$area/$timezone /etc/localtime
+echo "$area/$timezone" > /etc/timezone
 
 #Make sure we clean up any leading zeros in the day (as Zenity freaks out)
 date_d=`date +%d | sed 's/^0//'`
@@ -220,9 +223,9 @@ hwclock -u -w
 # Let the user choose his desired clockspeed.
 
 if [ "$pnd_version" == "1GHz" ]; then 
-      cpusel=$(zenity --title="Optional settings" --width="400" --height="300" --list --column "id" --column "Please select" --hide-column=1 --text="The CPU of the Pandora supports different speed settings.\nHigher speeds might make some units unstable and decrease the lifetime of your CPU.\n\nBelow are some quick profiles which will help you to configure your system the way you like it.\n" "1200" "Clockspeed: 1,2Ghz, OPP4 (probably unstable)" "1100" "Clockspeed: 1,1Ghz, OPP4 (should be stable)" "1000" "Clockspeed: 1GHz, OPP4 (Default Speed)" --ok-label="Select CPU Profile" )
+      cpusel=$(zenity --title="Optional settings" --width="400" --height="300" --list --column "id" --column "Please select" --hide-column=1 --text="The CPU of the Pandora supports different speed settings.\nHigher speeds might make some units unstable and decrease the lifetime of your CPU.\n\nBelow are some quick profiles which will help you to configure your system the way you like it.\n" "1200" "Clockspeed: 1,2GHz, OPP4 (probably unstable)" "1100" "Clockspeed: 1,1GHz, OPP4 (should be stable)" "1000" "Clockspeed: 1GHz, OPP4 (Default Speed)" --ok-label="Select CPU Profile" )
     else
-      cpusel=$(zenity --title="Optional settings" --width="400" --height="300" --list --column "id" --column "Please select" --hide-column=1 --text="The CPU of the Pandora supports different speed settings.\nHigher speeds might make some units unstable and decrease the lifetime of your CPU.\n\nBelow are some quick profiles which will help you to configure your system the way you like it.\n" "900" "Clockspeed: 900Mhz, OPP5 (probably unstable)" "800" "Clockspeed: 800Mhz, OPP5 (should be stable)" "600" "Clockspeed: 600MHz, OPP3 (Default Speed)" --ok-label="Select CPU Profile" )
+      cpusel=$(zenity --title="Optional settings" --width="400" --height="300" --list --column "id" --column "Please select" --hide-column=1 --text="The CPU of the Pandora supports different speed settings.\nHigher speeds might make some units unstable and decrease the lifetime of your CPU.\n\nBelow are some quick profiles which will help you to configure your system the way you like it.\n" "900" "Clockspeed: 900MHz, OPP5 (probably unstable)" "800" "Clockspeed: 800MHz, OPP5 (should be stable)" "600" "Clockspeed: 600MHz, OPP3 (Default Speed)" --ok-label="Select CPU Profile" )
     fi
     
     case $cpusel in
@@ -290,11 +293,24 @@ if [ "$pnd_version" == "1GHz" ]; then
        sed -i "s/.*safe.*/safe:600/g" /etc/pandora/conf/cpu.conf
        sync
        /usr/pandora/scripts/op_cpuspeed.sh -n 600
-       zenity --info --title="CPU Speed set" --text "The maxmimum CPU Speed has been set to 600Mhz." --timeout 6
+       zenity --info --title="CPU Speed set" --text "The maximum CPU Speed has been set to 600MHz." --timeout 6
        ;;
 
 esac
 
+#Enable / Disable TV Out on Startup
+
+if zenity --question --title="TV Out on startup" --text="Do you want to enable the TV Output on startup?\n(Note: This needs a bit more power)" --ok-label="Enable TV Out" --cancel-label="Disable TV Out"; then 
+         touch /etc/pandora/conf/tvout.state
+         zenity --info --title="TV Out" --text "TV Out will be switched on with the last saved settings on bootup." --timeout 6
+       else
+       /usr/pandora/scripts/op_tvout.sh -d
+         if [ -f /etc/pandora/conf/tvout.state ]; then
+               rm /etc/pandora/conf/tvout.state
+         fi
+         zenity --info --title="TV Out" --text "TV Out will not be switched on on bootup." --timeout 6
+fi     
+
 # ----
 
 # NOTE: This is just a temporary fix! These daemons should be removed from startup in the OE recipes. Until the time is found, we'll do it from here.
@@ -322,9 +338,10 @@ if ! grep -q 'blacklist rtl8192cu' /etc/modprobe.conf 2> /dev/null; then
   echo 'blacklist rtl8192cu' >> /etc/modprobe.conf
 fi
 
-# add Midi Module and zram
-echo snd-seq>>/etc/modules
-echo zram>>/etc/modules
+# add Midi module - handled in pandora-skel.bb
+# echo snd-seq > /etc/modutils/snd-seq
+# zram doesn't seem to help, disabled
+# echo zram > /etc/modutils/zram
 
 # get rid of some dirs in /media that OE creates but are unlikely to be used
 rmdir /media/card /media/cf /media/mmc1 /media/net /media/realroot /media/union 2> /dev/null