3 # notice: system dbus must be running
5 export LANG=en_GB.UTF-8
6 # for testing set display to something sane
7 if [ "x$DISPLAY" = "x" ]; then
11 export MB_HUNG_APP_HANDLER='/usr/bin/hd-hung-app-handler'
12 export GTK2_RC_FILES=/usr/share/themes/default/gtk-2.0/gtkrc:/usr/share/themes/default/gtk-2.0/gtkrc.maemo_af_desktop
14 WALLPAPER=`grep File= /usr/share/backgrounds/default.desktop | cut -d"=" -f2`
15 hsetroot -center $WALLPAPER
17 export `dbus-launch --exit-with-session`
19 #/usr/bin/maemo-launcher --daemon --booster gtk
21 /usr/lib/gconf2/gconfd-2 &
22 #/usr/lib/libgconf2-4/gconfd-2 &
24 #/usr/lib/sapwood/sapwood-server &
28 #/usr/bin/matchbox-window-manager \
31 # -use_desktop_mode plain \
33 # -use_cursor $SHOW_CURSOR \
34 # -use_super_modal no &
36 /usr/bin/x-window-manager
38 #maemo-invoker /usr/bin/hildon-input-method.launch &
40 #if /usr/bin/lshal | grep info.product | grep -i keyboard ; then
41 # /usr/bin/gconftool-2 -s -t bool /apps/osso/inputmethod/keyboard_available true
45 ##First we regenerate existing ssh keys:
46 #rm -f /etc/ssh/ssh_host*
47 #/usr/bin/ssh-keygen -t dsa -q -N "" -f /etc/ssh/ssh_host_dsa_key | \
48 # zenity --title="Please wait..." --text="Generating SSH DSA key." \
49 # --progress --pulsate --auto-close
50 #/usr/bin/ssh-keygen -t rsa -q -N "" -f /etc/ssh/ssh_host_rsa_key |
51 # zenity --title="Please wait..." --text="Generating SSH RSA key." \
52 # --progress --pulsate --auto-close
55 swap_part=$(sfdisk -l /dev/mmcblk? | grep swap | cut -d" " -f1)
56 if [ x$swap_part != x ] ; then
57 use_swap=$(zenity --title="Enable swap?" --text "Swap partition found. Would you like to use it?" --list --radiolist --column " " --column "Answer" TRUE "Use swap on $swap_part" FALSE "Do not use swap")
58 if [ "$use_swap" = "Use swap on $swap_part" ] ; then
60 echo "$swap_part none swap sw 0 0" >> /etc/fstab
64 while ! name=$(zenity --title="Type your name" --entry --text "Please type your full name.") || [ "x$name" = "x" ] ; do
65 zenity --title="Error" --error --text="Please try again."
68 username_guess=$(echo "$name" | cut -d" " -f1 | tr A-Z a-z)
70 while ! username=$(zenity --title="Type your username" --entry --text "Please choose a short username.
71 It should be all lowercase and
72 contain only letters and numbers." --entry-text "$username_guess") || [ "x$username" = "x" ] ; do
73 zenity --title="Error" --error --text="Please try again."
76 while ! adduser --gecos "$name,,," --disabled-password "$username" ; do
77 username=$(zenity --title="Please check username" --entry --text "Please be sure that your
78 username consists of only
79 letters and numbers." --entry-text "$username")
83 while [ x$password = x ] ; do
84 password1=$(zenity --title=Password --entry --text="Choose a new password." --hide-text)
85 password2=$(zenity --title=Confirm --entry --text="Confirm your new password." --hide-text)
86 if [ $password1 != $password2 ] ; then
87 zenity --title="Error" --error --text="Passwords don't match.
89 else if [ x$password1 = x ] ; then
90 zenity --title="Error" --error --text="Password can't be blank!
98 passwd "$username" <<EOF
103 for group in users admin adm audio video netdev plugdev ; do
104 if ! grep ^$group: /etc/group ; then
105 addgroup --system "$group"
107 adduser "$username" "$group" ; done
108 echo "PREFERED_USER=$username" > /etc/default/autologin
110 mkdir -p /etc/sudoers.d && echo '# Members of the admin group may gain root privileges' > /etc/sudoers.d/02ubuntu-admin
111 echo '%admin ALL=(ALL) ALL' >> /etc/sudoers.d/02ubuntu-admin
113 while ! hostname=$(zenity --title="Choose a device name" --entry --text "Please choose a name for
114 your OpenPandora. It should only contain
115 letters, numbers and dashes." --entry-text "$username-pandora") || [ "x$hostname" = "x" ]; do
116 zenity --title="Error" --error --text="Please try again."
119 echo $hostname > /etc/hostname
120 echo "127.0.0.1 localhost.localdomain localhost $hostname" > /etc/hosts
121 cat /usr/share/first-boot-wizard/hosts-template >> /etc/hosts
122 hostname -F /etc/hostname
124 killall maemo-launcher