From: David-John Willis Date: Mon, 23 Nov 2009 09:41:38 +0000 (+0000) Subject: pandora-first-run-wizard: Update recipe and scripts (WIP). X-Git-Tag: Release-2010-05/1~165 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=ba87a4eda8e4b18a592778c5850f97de60ab67b9 pandora-first-run-wizard: Update recipe and scripts (WIP). * TODO: Add touchscreen calibration. Better error handling. Use single X instance (longer term). --- diff --git a/recipes/pandora-system/pandora-first-run-wizard.bb b/recipes/pandora-system/pandora-first-run-wizard.bb index d2a9adb..742cfc3 100755 --- a/recipes/pandora-system/pandora-first-run-wizard.bb +++ b/recipes/pandora-system/pandora-first-run-wizard.bb @@ -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}" diff --git a/recipes/pandora-system/pandora-first-run-wizard/first-boot-wizard.sh b/recipes/pandora-system/pandora-first-run-wizard/first-boot-wizard.sh index 68faa8f..74ffa65 100755 --- a/recipes/pandora-system/pandora-first-run-wizard/first-boot-wizard.sh +++ b/recipes/pandora-system/pandora-first-run-wizard/first-boot-wizard.sh @@ -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 diff --git a/recipes/pandora-system/pandora-first-run-wizard/first-run-wizard.sh b/recipes/pandora-system/pandora-first-run-wizard/first-run-wizard.sh index 27a393d..161511e 100644 --- a/recipes/pandora-system/pandora-first-run-wizard/first-run-wizard.sh +++ b/recipes/pandora-system/pandora-first-run-wizard/first-run-wizard.sh @@ -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" < /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!" diff --git a/recipes/pandora-system/pandora-first-run-wizard/op_default.png b/recipes/pandora-system/pandora-first-run-wizard/op_default.png index 74675c7..24995cd 100644 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 index 0000000..7adc693 --- /dev/null +++ b/recipes/pandora-system/pandora-first-run-wizard/op_startup.sh @@ -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 diff --git a/recipes/pandora-system/pandora-first-run-wizard/rc.firstrun b/recipes/pandora-system/pandora-first-run-wizard/rc.firstrun index 1f4b42c..30d4395 100644 --- a/recipes/pandora-system/pandora-first-run-wizard/rc.firstrun +++ b/recipes/pandora-system/pandora-first-run-wizard/rc.firstrun @@ -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 }