3 # kernels we are sure we want to update
5 3112d1782a90c2c87ae17a152a35deae \
6 b00a5d617f11366689488395b19411de \
7 aed218fe59ff93618bddd2b52b020014 \
9 newkern=53ca541a471f726eb1103f19d4306e61
10 currkern=$(md5sum /boot/uImage | cut -d" " -f1)
12 # u-boot versions we want to update
14 U-Boot_2010.03_(May_19_2010_-_18:30:30) \
17 oldinterfaces=23f72750f2f7335b9c2ed3f55aaa5061
18 oldrcwl1251=7a6361e842f0f589418218436affbe07
19 newmmenu=270b2ef3aa8e92e913880fb313857b0a
21 d15bf3ad29f12fa2325534b8fcd5c1f4 \
22 fa45e9bc91c48640a9ea592de5fbeb3c \
23 af66a5118a9bfef8eca5de13ee64c6a1 \
25 currmmenu=$(md5sum /usr/bin/mmenu | cut -d" " -f1)
26 currmmenuconf=$(md5sum /etc/pandora/conf/mmenu.conf | cut -d" " -f1)
33 echo "$@" >> /tmp/updater.log
37 rm /tmp/updater_err.log
41 echo "$@" >> /tmp/updater_err.log
44 if zenity --question --title="Update Package 3" --text="\
45 This PND updates your Pandora OS. You can safely delete it after it has finished.\n\
46 This pack includes all updates from previous Hotfix Packs as well.\n\n\
47 Do you want to start the upgrade now? " --ok-label="Start now" --cancel-label="Don't do it" ; then
54 echo "# Updating kernel if needed"
62 needfree=$(ls -lk uImage | grep uImage | cut -d" " -f5)
63 currfree=$(df /boot | grep boot | awk '{print $4}')
64 if [ $currfree -lt $needfree ]; then
65 err "There is not enough diskspace on /boot/ to update the kernel.\nKernel couldn't be updated."
66 log "Kernel not updated - not enough diskspace on /boot/"
69 cp uImage /boot/uImage.new
72 currkern=$(md5sum /boot/uImage.new | cut -d" " -f1)
73 if [ "$currkern" = "$newkern" ]; then
74 mv /boot/uImage /boot/uImage.old
75 mv /boot/uImage.new /boot/uImage
76 currkern=$(md5sum /boot/uImage | cut -d" " -f1)
77 if [ "$currkern" != "$newkern" ]; then
79 mv /boot/uImage.old /boot/uImage
86 if $bad_checksum; then
87 err "There was a checksum error while copying the kernel.\nKernel couldn't be updated. Please check your SD-Card and try to recopy the PND-File."
88 log "Kernel not updated - checksum error"
93 if ! $have_error; then
94 log "Kernel successfully updated"
95 echo "The kernel has been updated. You need to restart your system." > /tmp/updreboot
101 for oknl in $oldkern $newkern; do
102 if [ "$oknl" = "$currkern" ]; then
108 if [ "$kernel_known" = "true" -o -z "$currkern" ]; then
109 if [ "$currkern" != "$newkern" ]; then
112 log "Kernel already up-to-date"
115 if zenity --question --title="Custom kernel?" --text="\
116 You seem to have custom or newer kernel in flash.\n\n\
118 (if unsure, select Yes)" --ok-label="Yes" --cancel-label="No" ; then
121 log "Kernel update skipped"
129 echo "# U-Boot if needed"
133 if flash_eraseall /dev/mtd1 && nandwrite -p /dev/mtd1 u-boot.bin; then
134 # XXX: perhaps we need to check if write went ok?
135 log "u-boot.bin flashed."
137 log "u-boot.bin flashing failed."
141 if [ -f u-boot.bin ]; then
143 rm /tmp/u-boot.bin.nand 2> /dev/null
144 nanddump -o -b -q -f /tmp/u-boot.bin.nand /dev/mtd1
145 uboot_nand_ver=`strings /tmp/u-boot.bin.nand | grep 'U-Boot 20' | head -n 1 | sed 's/ /_/g'`
146 uboot_ver=`strings u-boot.bin | grep 'U-Boot 20' | head -n 1 | sed 's/ /_/g'`
147 uboot_size=`stat -c %s u-boot.bin`
149 dd if=/tmp/u-boot.bin.nand of=/tmp/u-boot.bin.nand.cmp bs=$uboot_size count=1
150 if ! cmp u-boot.bin /tmp/u-boot.bin.nand.cmp
152 uboot_need_to_ask=true
153 for oldver in $oldubootvers; do
154 if [ "$oldver" = "$uboot_nand_ver" ]; then
155 uboot_need_to_ask=false
160 if $uboot_need_to_ask; then
161 if zenity --question --title="Custom u-boot?" --text="\
162 You seem to have custom or newer u-boot in flash.\n\n\
164 (if unsure, select Yes)" --ok-label="Yes" --cancel-label="No" ; then
167 log "u-boot update skipped\n(nand has $uboot_nand_ver)"
173 log "u-boot already up-to-date\n($uboot_nand_ver)"
177 # Libraries and Programs
180 echo "# Installing missing Python libraries"
181 if [ "`opkg list-installed | grep python-shell`" ]; then
182 log "Python libraries were already installed."
184 opkg install 1/gnome-vfs-plugin-ftp_2.24.1-r2.5_armv7a.ipk 1/gnome-vfs-plugin-http_2.24.1-r2.5_armv7a.ipk 1/python-pycairo_1.4.0-ml3.5_armv7a.ipk 1/python-pygtk_2.16.0-r1.5_armv7a.ipk 1/python-shell_2.6.4-ml9.1.5_armv7a.ipk
185 log "Python libraries installed"
189 # Libraries and programs
192 echo "# Installing Boost Library"
193 if [ "`opkg list-installed | grep boost-system`" ]; then
194 log "Boost library was already installed"
196 opkg install 2/boost_1.41.0-r8.1.5_armv7a.ipk 2/boost-filesystem_1.41.0-r8.1.5_armv7a.ipk 2/boost-graph_1.41.0-r8.1.5_armv7a.ipk 2/boost-iostreams_1.41.0-r8.1.5_armv7a.ipk 2/boost-program-options_1.41.0-r8.1.5_armv7a.ipk 2/boost-python_1.41.0-r8.1.5_armv7a.ipk 2/boost-regex_1.41.0-r8.1.5_armv7a.ipk 2/boost-serialization_1.41.0-r8.1.5_armv7a.ipk 2/boost-signals_1.41.0-r8.1.5_armv7a.ipk 2/boost-system_1.41.0-r8.1.5_armv7a.ipk 2/boost-test_1.41.0-r8.1.5_armv7a.ipk
197 log "Boost library installed"
202 echo "# Installing Lua5.1"
203 if [ "`opkg list-installed | grep lua5.1`" ]; then
204 log "Lua5.1 was already installed"
206 opkg install 2/lua5.1_5.1.4-r5.5_armv7a.ipk
207 log "Lua5.1 installed"
212 echo "# Installing Evince"
213 if [ "`opkg list-installed | grep evince`" ]; then
214 log "Evince was already installed"
216 opkg install 2/libpoppler-glib4_0.12.3-r0.5_armv7a.ipk 2/libpoppler5_0.12.3-r0.5_armv7a.ipk 2/espgs_8.15.3-r1.5_armv7a.ipk 2/poppler-data_0.4.0-r1.5_all.ipk 2/poppler_0.12.3-r0.5_armv7a.ipk 2/libcupsimage_1.4.3-r2.5_armv7a.ipk 2/evince_2.30.0-r0.5_armv7a.ipk
217 log "Evince installed"
224 echo "# Installing updated MiniMenu"
230 rm /usr/bin/mmenu.old
231 cp 3/mmenu /usr/bin/mmenu.new
232 cp 3/mmenu.conf /etc/pandora/conf/mmenu.conf.new
234 currmmenu=$(md5sum /usr/bin/mmenu.new | cut -d" " -f1)
235 if [ $currmmenu = $newmmenu ]; then
236 mv /usr/bin/mmenu /usr/bin/mmenu.old
237 mv /etc/pandora/conf/mmenu.conf /etc/pandora/conf/mmenu.conf.old
238 mv /usr/bin/mmenu.new /usr/bin/mmenu
239 mv /etc/pandora/conf/mmenu.conf.new /etc/pandora/conf/mmenu.conf
240 currmmenu=$(md5sum /usr/bin/mmenu | cut -d" " -f1)
241 if [ $currmmenu != $newmmenu ]; then
243 rm /etc/pandora/conf/mmenu.conf
244 mv /etc/pandora/conf/mmenu.conf.old /etc/pandora/conf/mmenu.conf
245 mv /usr/bin/mmenu.old /usr/bin/mmenu
249 rm /usr/bin/mmenu.new
250 rm /etc/pandora/conf/mmenu.conf.new
254 err "There was a checksum error while copying MiniMenu.\n\nMiniMenu couldn't be updated. Please check your SD-Card and try to recopy the PND-File."
255 log "MiniMenu not updated - checksum error"
258 if ! $mmenu_error; then
259 log "MiniMenu successfully updated"
266 for ommenu in $oldmmenu $newmmenu; do
267 if [ "$ommenu" = "$currmmenu" ]; then
273 if [ "$mmenu_known" = "true" -o -z "$currmmenu" ]; then
274 if [ "$currmmenu" != "$newmmenu" ]; then
277 log "MiniMenu already up-to-date"
280 if zenity --question --title="Custom MiniMenu?" --text="\
281 You seem to have custom or newer MiniMenu on your OS.\n\n\
283 (if unsure, select Yes)" --ok-label="Yes" --cancel-label="No" ; then
286 log "MiniMenu update skipped"
290 # Bugfixes in Scripts
293 echo "# Installing updated scripts"
294 if [ ! -f /usr/bin/stopmmenu ]; then
295 cp 2/op_calibrate.sh /usr/pandora/scripts/
296 cp 2/op_datetime.sh /usr/pandora/scripts/
297 cp 2/op_lcdsettings.sh /usr/pandora/scripts/
298 cp 2/op_nubmode.sh /usr/pandora/scripts/
299 cp 2/op_switchgui.sh /usr/pandora/scripts/
300 cp 2/op_usermanager.sh /usr/pandora/scripts/
301 cp 2/op_lcdrate.sh /usr/pandora/scripts/
302 chmod +x /usr/pandora/scripts/op_lcdrate.sh
303 cp 2/gui.conf /etc/pandora/conf/
304 cp 2/op_bluetooth.desktop /usr/share/applications/
305 cp 2/rc.wl1251 /etc/init.d/wl1251-init
306 cp 2/interfaces /etc/network/
307 cp 2/stopmmenu /usr/bin/stopmmenu
308 mkdir /usr/pandora/mmenu
309 rm /usr/share/applications/op_wifi.desktop
310 cp 2/abiword.pnd /usr/pandora/mmenu/
311 cp 2/arora.pnd /usr/pandora/mmenu/
312 cp 2/claws-mail.pnd /usr/pandora/mmenu/
313 cp 2/evince.pnd /usr/pandora/mmenu/
314 cp 2/gigolo.pnd /usr/pandora/mmenu/
315 cp 2/gnumeric.pnd /usr/pandora/mmenu/
316 cp 2/midori.pnd /usr/pandora/mmenu/
317 cp 2/mousepad.pnd /usr/pandora/mmenu/
318 cp 2/pidgin.pnd /usr/pandora/mmenu/
319 cp 2/ristretto.pnd /usr/pandora/mmenu/
320 cp 2/squeeze.pnd /usr/pandora/mmenu/
321 cp 2/thunar.pnd /usr/pandora/mmenu/
322 cp 2/xchat.pnd /usr/pandora/mmenu/
324 log "The HotFix 2 scripts have been updated"
326 chmod 666 /etc/pointercal
327 log "Permissions updated"
329 log "HotFix 2 scripts were already installed."
333 echo "# Installing updated scripts"
334 mountmd5=$(md5sum /usr/pandora/scripts/op_storage.sh | cut -d" " -f1)
335 if [ "23c0cd2ef0197e1a1e512ce48014311e" != "$mountmd5" ]; then
336 update-rc.d -f pandora-lcd-state remove
337 rm /etc/init.d/pandora-lcd-state
338 cp 3/op_bluetooth.sh /usr/pandora/scripts/
339 cp 3/rc.pandora-state /etc/init.d/pandora-state
340 cp 3/50_openpandora /etc/sudoers.d/
341 cp 3/mount.sh /etc/udev/scripts/mount.sh
342 cp 3/op_startupmanager.sh /usr/pandora/scripts/
343 cp 3/op_storage.sh /usr/pandora/scripts/
344 cp 3/pandorascripts.pnd /usr/pandora/apps/
345 cp 3/dirty_expire_centisecs /etc/pandora/conf/
346 cp 3/service.conf /etc/pandora/conf/
347 cp 3/eventmap /etc/pandora/conf/
348 cp 3/op_runfbapp /usr/bin/
349 cp 3/pnd_run.sh /usr/pandora/scripts/
350 update-rc.d -f pandora-state start 39 S . stop 31 0 1 6 .
351 log "The HotFix 3 scripts have been updated"
354 log "HotFix 3 scripts were already installed."
358 echo "# Installing new Modules"
359 if [ ! -f /lib/modules/2.6.27.46-omap1/kernel/drivers/net/tun.ko ]; then
360 cp 3/snd-usb-audio.ko /lib/modules/2.6.27.46-omap1/kernel/sound/usb/
361 cp 3/snd-usb-lib.ko /lib/modules/2.6.27.46-omap1/kernel/sound/usb/
362 cp 3/snd-hwdep.ko /lib/modules/2.6.27.46-omap1/kernel/sound/core/
363 cp 3/snd-rawmidi.ko /lib/modules/2.6.27.46-omap1/kernel/sound/core/
364 cp 3/tun.ko /lib/modules/2.6.27.46-omap1/kernel/drivers/net/
366 log "New modules installed"
369 log "All Modules were already installed."
373 echo "# Disabling unneeded services"
374 if [ -f /etc/rc5.d/S20apmd ]; then
375 update-rc.d -f samba remove
376 update-rc.d -f xinetd
377 update-rc.d -f avahi-daemon
379 update-rc.d -f usb-gadget
380 update-rc.d -f banner
381 update-rc.d -f portmap
382 update-rc.d -f mountnfs
383 update-rc.d -f blueprobe
384 update-rc.d -f dropbear
385 log "Unneeded services have been disabled"
388 log "Unneeded sevices were already disabled"
392 echo "# Update finished"
394 # Zenity Progress goes here
397 --title="Installing Updates..." \
398 --text="Updating System..." \
401 err=`cat /tmp/updater_err.log`
402 if [ -z "$err" ]; then
403 err="Your system has been updated without any errors."
405 update=$(cat /tmp/updater.log)
406 zenity --info --title="Update finished" --text "$err\n\n${update}"
410 if [ -f /tmp/updreboot ]; then
411 reboot=`cat /tmp/updreboot`
412 zenity --info --title="You need to reboot" --text "${reboot}"