# Greet the user.
-zenity --info --title="Pandoras Box has been opened." --text="Welcome!\n\nPandora's Box has been opened.\n\nThis wizard will help you setting up your new OpenPandora handheld before the first use.\n\nYou will be asked a few simple questions to personalise and configure your device for use." --timeout 45
-
+if zenity --question --title="Pandoras Box has been opened." --text="Welcome!\n\nPandora's Box has been opened.\n\nThis wizard will help you setting up your new OpenPandora handheld before the first use.\n\nYou will be asked a few simple questions to personalise and configure your device.\n\nDo you want to set up your unit now or shut the unit down and do it later?" --ok-label="Start now" --cancel-label="Shutdown" ; then
# ----
# Reset ROOT's password to something random
# Pick a name for the OpenPandora.
-while ! hostname=$(zenity --title="Name your Pandora" --entry --text "Please choose a name for your OpenPandora.\n\nIt should only contain letters, numbers and dashes." --entry-text "$username-openpandora") || [ "x$hostname" = "x" ]; do
+while ! hostname=$(zenity --title="Name your Pandora" --entry --text "Please choose a name for your OpenPandora.\n\nIt should only contain letters, numbers and dashes, no spaces." --entry-text "$username-openpandora") || [ "x$hostname" = "x" ]; do
zenity --title="Error" --error --text="Please try again."
done
+
+echo $hostname > /etc/hostname
+hostname =$(sed 's/ /_/g' /etc/hostname)
echo $hostname > /etc/hostname
echo "127.0.0.1 localhost.localdomain localhost $hostname" > /etc/hosts
hostname -F /etc/hostname
sed -i "s/.*default_user.*/default_user $username/g" /etc/slim.conf
sed -i 's/.*auto_login.*/auto_login yes/g' /etc/slim.conf
else
- if zenity --question --title="User" --text="Do you wish to have your username automatically populated in the login screen?\n\nNote: This is ideal if your the only user of the OpenPandora but wish to disable autologin and use a password." --ok-label="Yes" --cancel-label="No"; then
+ if zenity --question --title="User" --text="Do you wish to have your username automatically populated in the login screen?\n\nNote: This is ideal if you're the only user of the OpenPandora but wish to disable autologin and use a password." --ok-label="Yes" --cancel-label="No"; then
sed -i "s/.*default_user.*/default_user $username/g" /etc/slim.conf
sed -i 's/.*auto_login.*/auto_login no/g' /etc/slim.conf
else
# Select the default interface and setup SLiM to pass that as a sesion to ~./.xinitrc
-while ! launcher=$(zenity --height 260 --list --title="Default User Interface" --text="Please choose your default application launcher.\n\nYou can always change this setting later." --column "return" --print-column=1 --hide-column=1 --column "Pick a launcher" "xfce" "Desktop environment (Xfce)" "mmenu" "Very basic GUI (MiniMenu)" "pmenu" "Gaming-console like launcher (PMenu)" "netbooklauncher" "Netbook Launcher") || [ "x$launcher" = "x" ]; do
- zenity --title="Error" --error --text="Please select a default launcher." --timeout 6
+selection=""
+while [ x$selection = x ]; do
+selection=$(cat /etc/pandora/conf/gui.conf | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Select the Default GUI" --list --column "Name" --column "Description" --text "Please select the Default GUI" )
+if [ x$selection = x ]; then
+ zenity --title="Error" --error --text="Please select a GUI." --timeout=6
+fi
done
-if [ $launcher == "xfce" ]; then
-# sed -i 's/.*sessions .*/sessions xfce4,pmenu/g' /etc/slim.conf
- sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startxfce4/g' /home/$username/.xinitrc
- echo Xfce selected as default interface
-elif [ $launcher == "pmenu" ]; then
-# sed -i 's/.*sessions .*/sessions pmenu,xfce4/g' /etc/slim.conf
- sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=pmenu/g' /home/$username/.xinitrc
- echo PMenu selected as default interface
-elif [ $launcher == "netbooklauncher" ]; then
- sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startnetbooklauncher/g' /home/$username/.xinitrc
-elif [ $launcher == "mmenu" ]; then
- sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startmmenu/g' /home/$username/.xinitrc
+echo $selection
+
+gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}')
+stopcommand=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $4}')
+
+echo $gui
+
+if [ $gui ]; then
+ sed -i "s/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=$gui/g" /home/$username/.xinitrc
+ echo $selection selected as default interface
+ zenity --info --title="Selected session" --text "You selected $selection as default setting. You can always change your default GUI later." --timeout 6
+else
+ sed -i 's/.*DEFAULT_SESSION=.*/DEFAULT_SESSION=startxfce4/g' /home/$username/.xinitrc
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.
+update-rc.d -f samba remove
+update-rc.d -f xinetd remove
+update-rc.d -f avahi-daemon remove
+update-rc.d -f apmd remove
+update-rc.d -f usb-gadget remove
+update-rc.d -f banner remove
+update-rc.d -f portmap remove
+update-rc.d -f mountnfs remove
+update-rc.d -f blueprobe remove
+update-rc.d -f dropbear remove
+update-rc.d -f wl1251-init remove
+
+
# Write the control file so this script is not run on next boot
# (hackish I know but I want the flexability to drop a new script in later esp. in the early firmwares).
chmod 0666 /etc/pandora/first-boot
# ----
+else
+poweroff
+fi
\ No newline at end of file