pandora-first-run-wizard: Update recipe and scripts (WIP).
authorDavid-John Willis <John.Willis@Distant-earth.com>
Mon, 23 Nov 2009 09:41:38 +0000 (09:41 +0000)
committerDavid-John Willis <John.Willis@Distant-earth.com>
Mon, 23 Nov 2009 09:41:38 +0000 (09:41 +0000)
* TODO:
  Add touchscreen calibration.
  Better error handling.
  Use single X instance (longer term).

recipes/pandora-system/pandora-first-run-wizard.bb
recipes/pandora-system/pandora-first-run-wizard/first-boot-wizard.sh
recipes/pandora-system/pandora-first-run-wizard/first-run-wizard.sh
recipes/pandora-system/pandora-first-run-wizard/op_default.png
recipes/pandora-system/pandora-first-run-wizard/op_startup.sh [new file with mode: 0644]
recipes/pandora-system/pandora-first-run-wizard/rc.firstrun

index d2a9adb..742cfc3 100755 (executable)
@@ -1,13 +1,16 @@
 DESCRIPTION = "Scripts to support the first run wizard on the OpenPandora."
 LICENSE = "GPLV2"
+
+DEPENDS = "hsetroot zenity dbus"
 RDEPENDS = "hsetroot zenity dbus"
 
 COMPATIBLE_MACHINE = "omap3-pandora"
 
-PR = "r2"
+PR = "r5"
 
 SRC_URI = " \
           file://first-run-wizard.sh \
+          file://op_startup.sh \
           file://rc.firstrun \
           file://op_default.png \          
 "
@@ -20,12 +23,13 @@ INITSCRIPT_PARAMS = "start 29 2 3 4 5 . stop  29 2 3 4 5 ."
 do_install() {         
           install -d ${D}${prefix}/pandora/scripts/
           install -m 0755 ${WORKDIR}/first-run-wizard.sh ${D}${prefix}/pandora/scripts/
-          
+          install -m 0755 ${WORKDIR}/op_startup.sh ${D}${prefix}/pandora/scripts/
+
           install -d ${D}${sysconfdir}/init.d/
           install -m 0755 ${WORKDIR}/rc.firstrun ${D}${sysconfdir}/init.d/oprun-init
-          
+
           install -d ${D}${datadir}/backgrounds/
-          install -m 0644 ${WORKDIR}/op_default.png ${D}${datadir}/backgrounds/
+          install -m 0666 ${WORKDIR}/op_default.png ${D}${datadir}/backgrounds/
 }
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
index 68faa8f..74ffa65 100755 (executable)
@@ -7,6 +7,7 @@ export LANG=en_GB.UTF-8
 if [ "x$DISPLAY" = "x" ]; then
        export DISPLAY=:0
 fi
+
 export MB_HUNG_APP_HANDLER='/usr/bin/hd-hung-app-handler'
 export GTK2_RC_FILES=/usr/share/themes/default/gtk-2.0/gtkrc:/usr/share/themes/default/gtk-2.0/gtkrc.maemo_af_desktop
 
index 27a393d..161511e 100644 (file)
@@ -9,12 +9,16 @@
 export LANG=en_GB.UTF-8
 export GTK2_RC_FILES=/usr/share/themes/Xfce/gtk-2.0/gtkrc
 
-# We will load up a background image here as soon as we have a tool for that :)
-WALLPAPER=`/usr/share/backgrounds/op_default.png`
+# Ensure there is a wheel group for sudoers to be put into.
+# TODO: Do this somewhere better.
+groupadd wheel
+
+# We load up a background image here
+export WALLPAPER=/usr/share/backgrounds/op_default.png
 hsetroot -center $WALLPAPER
 
 # Greet the user
-zenity --info --title="Pandoras Box has been opened." --text "Welcome. This Wizard will help you setting up your Pandora before your first use."
+zenity --info --title="Pandoras Box has been opened." --text "Welcome. This wizard will help you setting up your new OpenPandora handheld before your first use."
 
 # Should we really enable SWAP?
 #swap_part=$(sfdisk -l /dev/mmcblk? | grep swap | cut -d" " -f1)
@@ -40,8 +44,6 @@ contain only letters and numbers." --entry-text "$username_guess") || [ "x$usern
        zenity --title="Error" --error --text="Please try again."
 done
 
-# Note: Group wheel doesn't exist in the current image! Should be created for easy sudo!
-
 while ! useradd -c "$name,,," -G adm,audio,video,netdev,wheel,plugdev "$username" ; do
        username=$(zenity --title="Please check username" --entry --text "Please be sure that your
 username consists of only
@@ -58,7 +60,7 @@ while [ x$password = x ] ; do
                zenity --title="Error" --error --text="Passwords don't match.
 Please try again."
        else if [ x$password1 = x ] ; then
-               zenity --title="Error" --error --text="Password can't be blank!
+               zenity --title="Error" --error --text="Password can not be blank!
 Please try again."
                else
                        password=$password1
@@ -66,14 +68,11 @@ Please try again."
        fi
 done
 
-# Setting the password doesn't work yet (permission issues)
-
 passwd "$username" <<EOF
 $password
 $password
 EOF
 
-
 # Name our little baby
 
 while ! hostname=$(zenity --title="Name your Pandora" --entry --text "Please choose a name for
@@ -98,14 +97,13 @@ if zenity --question --title="Autologin" --text="Do you want to automatically lo
       sed -i 's/.*auto_login.*/auto_login no/g' /etc/slim.conf
 fi
 
-# I don't know yet how to setup which GUI will run as default. At the moment, it just creates a small file and puts XFCE or cpasjuste into it :)
+# Setup which GUI will run as default. At the moment, it just creates a small file and puts Xfce or PMenu into it :)
 
-if zenity --question --title="Default GUI" --text="Now you can choose whether you want to boot into a full desktop or a gaming console-like launcher as default.\n\nYou can always change that setting later." --ok-label="Full Desktop (XFCE)"  --cancel-label="Gaming 
+if zenity --question --title="Default Inteface" --text="Now you can choose whether you want to boot into a full desktop interface or a gaming console-like launcher by default.\n\nYou can always change this setting later." --ok-label="Full Desktop (Xfce)"  --cancel-label="Gaming 
 console-like Launcher"; then 
-       echo XFCE > /etc/bootup.cfg
+       echo Xfce > /etc/bootup.cfg
        else
-       echo cpasjuste > /etc/bootup.cfg
+       echo PMenu > /etc/bootup.cfg
 fi
 
-zenity --info --title="Finished" --text "This concludes the First Boot Wizard.\nThanks for buying the Pandora. Enjoy the device!"
-
+zenity --info --title="Finished" --text "This concludes the First Boot Wizard.\nThanks for buying the OpenPandora. Enjoy the device!"
index 74675c7..24995cd 100644 (file)
Binary files a/recipes/pandora-system/pandora-first-run-wizard/op_default.png and b/recipes/pandora-system/pandora-first-run-wizard/op_default.png differ
diff --git a/recipes/pandora-system/pandora-first-run-wizard/op_startup.sh b/recipes/pandora-system/pandora-first-run-wizard/op_startup.sh
new file mode 100644 (file)
index 0000000..7adc693
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+OP_CHECKFILE='/etc/bootup.cfg'
+OP_FIRSTRUN='xinit /usr/pandora/scripts/first-run-wizard.sh'
+
+
+[ -f $OP_CHECKFILE ] && echo "OP_STARTUP: $OP_CHECKFILE exists, not first boot." || $OP_FIRSTRUN
index 1f4b42c..30d4395 100644 (file)
@@ -8,11 +8,11 @@
 # Default-Stop:      0 1 6
 ### END INIT INFO
  
-DESC="OpenPandora First Run Deamon"
+DESC="OpenPandora Startup Script Deamon"
 NAME="opruninit"
 
-PID=`pidof -o %PPID -x first-run-wizard.sh`
-OPRUNINIT='xinit /usr/pandora/first-run-wizard.sh'
+PID=`pidof -o %PPID -x op_startup.sh`
+OPRUNINIT='/usr/pandora/scripts/op_startup.sh'
 
 d_stop() {
        if [ $PID ]
@@ -28,7 +28,7 @@ d_start() {
        then
                echo "$DESC: $NAME already running."
        else
-               $OPRUNINIT -d 3
+               $OPRUNINIT
        fi
 }