From: Michael Mrozek Date: Wed, 23 Jun 2010 02:05:23 +0000 (+0200) Subject: Updater.sh: Included most stuff for HotFix 3. Not yet finished. X-Git-Tag: sz_beta3~22 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=406291b2c018d57a21a6ac48d1fbe3fec4874f21;p=pandora-misc.git Updater.sh: Included most stuff for HotFix 3. Not yet finished. --- diff --git a/hotfix_updater/updater.sh b/hotfix_updater/updater.sh index 2400a3e..dc2c8cc 100755 --- a/hotfix_updater/updater.sh +++ b/hotfix_updater/updater.sh @@ -16,9 +16,12 @@ U-Boot_2010.03_(May_19_2010_-_18:30:30) \ oldinterfaces=23f72750f2f7335b9c2ed3f55aaa5061 oldrcwl1251=7a6361e842f0f589418218436affbe07 -newmmenu=af66a5118a9bfef8eca5de13ee64c6a1 -oldmmenu1=d15bf3ad29f12fa2325534b8fcd5c1f4 -oldmmenu2=fa45e9bc91c48640a9ea592de5fbeb3c +newmmenu=270b2ef3aa8e92e913880fb313857b0a +oldmmenu="\ +d15bf3ad29f12fa2325534b8fcd5c1f4 \ +fa45e9bc91c48640a9ea592de5fbeb3c \ +af66a5118a9bfef8eca5de13ee64c6a1 \ +" currmmenu=$(md5sum /usr/bin/mmenu | cut -d" " -f1) currmmenuconf=$(md5sum /etc/pandora/conf/mmenu.conf | cut -d" " -f1) @@ -49,6 +52,7 @@ Do you want to start the upgrade now? " --ok-label="Start now" --cancel-label="D echo "7" echo "# Updating kernel if needed" + update_kernel() { have_error=false @@ -166,9 +170,7 @@ else fi -# HotFix 1 - -# Libraries for HotFix 1 +# Libraries and Programs echo "20" echo "# Installing missing Python libraries" @@ -180,16 +182,51 @@ else sync fi -# HotFix 2 -# MiniMenu Update +# Libraries and programs echo "30" +echo "# Installing Boost Library" +if [ "`opkg list-installed | grep boost-system`" ]; then + log "Boost library was already installed" +else + 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 + log "Boost library installed" + sync +fi + +echo "50" +echo "# Installing Lua5.1" +if [ "`opkg list-installed | grep lua5.1`" ]; then + log "Lua5.1 was already installed" +else + opkg install 2/lua5.1_5.1.4-r5.5_armv7a.ipk + log "Lua5.1 installed" + sync +fi + +echo "60" +echo "# Installing Evince" +if [ "`opkg list-installed | grep evince`" ]; then + log "Evince was already installed" +else + 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 + log "Evince installed" + sync +fi + +# MiniMenu Update + +echo "70" echo "# Installing updated MiniMenu" -if [ $oldmmenu1 = $currmmenu -o $oldmmenu2 = $currmmenu ]; then - echo temp + +update_mmenu() +{ + bad_mmenu=false + mmenu_error=false rm /usr/bin/mmenu.old - cp 2/mmenu /usr/bin/mmenu.new - cp 2/mmenu.conf /etc/pandora/conf/mmenu.conf.new + rm /etc/pandora/conf/mmenu.conf.old + cp 3/mmenu /usr/bin/mmenu.new + cp 3/mmenu.conf /etc/pandora/conf/mmenu.conf.new sync currmmenu=$(md5sum /usr/bin/mmenu.new | cut -d" " -f1) if [ $currmmenu = $newmmenu ]; then @@ -203,55 +240,60 @@ if [ $oldmmenu1 = $currmmenu -o $oldmmenu2 = $currmmenu ]; then rm /etc/pandora/conf/mmenu.conf mv /etc/pandora/conf/mmenu.conf.old /etc/pandora/conf/mmenu.conf mv /usr/bin/mmenu.old /usr/bin/mmenu - 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." - log "MiniMenu not updated - checksum error" + bad_mmenu=true fi else rm /usr/bin/mmenu.new rm /etc/pandora/conf/mmenu.conf.new + bad_mmenu=true + fi + if $bad_mmenu; then 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." log "MiniMenu not updated - checksum error" - fi + mmenu_error=true + fi + if ! $mmenu_error; then log "MiniMenu successfully updated" - sync - else - log "MiniMenu already up-to-date" fi + sync +} -# Libraries and programs for HotFix 2 - -echo "40" -echo "# Installing Boost Library" -if [ "`opkg list-installed | grep boost-system`" ]; then - log "Boost library was already installed" -else - 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 - log "Boost library installed" - sync -fi +mmenu_known=false +for ommenu in $oldmmenu $newmmenu; do + if [ "$ommenu" = "$currmmenu" ]; then + mmenu_known=true + break + fi +done -echo "60" -echo "# Installing Lua5.1" -if [ "`opkg list-installed | grep lua5.1`" ]; then - log "Lua5.1 was already installed" -else - opkg install 2/lua5.1_5.1.4-r5.5_armv7a.ipk - log "Lua5.1 installed" - sync +if [ "$mmenu_known" = "true" -o -z "$currmmenu" ]; then + if [ "$currmmenu" != "$newmmenu" ]; then + update_mmenu + else + log "MiniMenu already up-to-date" + fi +else + if zenity --question --title="Custom MiniMenu?" --text="\ +You seem to have custom or newer MiniMenu on your OS.\n\n\ +Update it anyway?\n\ +(if unsure, select Yes)" --ok-label="Yes" --cancel-label="No" ; then + update_mmenu + else + log "MiniMenu update skipped" + fi fi # Bugfixes in Scripts -echo "70" +echo "80" echo "# Installing updated scripts" -#if [ ! -f /usr/bin/stopmmenu ]; then +if [ ! -f /usr/bin/stopmmenu ]; then cp 2/op_bluetooth.sh /usr/pandora/scripts/ cp 2/op_calibrate.sh /usr/pandora/scripts/ cp 2/op_datetime.sh /usr/pandora/scripts/ cp 2/op_lcdsettings.sh /usr/pandora/scripts/ cp 2/op_nubmode.sh /usr/pandora/scripts/ - cp 2/op_startupmanager.sh /usr/pandora/scripts/ cp 2/op_switchgui.sh /usr/pandora/scripts/ cp 2/op_usermanager.sh /usr/pandora/scripts/ cp 2/op_lcdrate.sh /usr/pandora/scripts/ @@ -259,14 +301,10 @@ echo "# Installing updated scripts" cp 2/gui.conf /etc/pandora/conf/ cp 2/op_bluetooth.desktop /usr/share/applications/ cp 2/rc.wl1251 /etc/init.d/wl1251-init - cp 2/rc.pandora-lcd-state /etc/init.d/pandora-lcd-state cp 2/interfaces /etc/network/ cp 2/stopmmenu /usr/bin/stopmmenu - cp 2/50_openpandora /etc/sudoers.d/ - cp 2/mount.sh /etc/udev/scripts/mount.sh mkdir /usr/pandora/mmenu rm /usr/share/applications/op_wifi.desktop - cp 2/pandorascripts.pnd /usr/pandora/apps/ cp 2/abiword.pnd /usr/pandora/mmenu/ cp 2/arora.pnd /usr/pandora/mmenu/ cp 2/claws-mail.pnd /usr/pandora/mmenu/ @@ -283,24 +321,32 @@ echo "# Installing updated scripts" log "The scripts have been updated" sync - echo "80" - echo "# Fixing Touchscreen-Permissions" chmod 666 /etc/pointercal log "Permissions updated" -#else - # log "The scripts were up-to-date" -#fi +else + log "HotFix 2 scripts were already installed." +fi echo "90" -echo "# Installing Evince" -if [ "`opkg list-installed | grep evince`" ]; then - log "Evince was already installed" -else - 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 - log "Evince installed" - sync +echo "# Installing updated scripts" +if [ -f /etc/init.d/pandora-lcd-state ]; then + update-rc.d -f pandora-lcd-state remove + rm /etc/init.d/pandora-lcd-state + cp 3/rc.pandora-state /etc/init.d/pandora-state + cp 3/50_openpandora /etc/sudoers.d/ + cp 3/mount.sh /etc/udev/scripts/mount.sh + cp 3/op_startupmanager.sh /usr/pandora/scripts/ + cp 3/op_storage.sh /usr/pandora/scripts/ + cp 3/pandorascripts.pnd /usr/pandora/apps/ + cp 3/dirty_expire_centisecs /etc/pandora/conf/ + cp 3/service.conf /etc/pandora/conf/ + update-rc.d -f pandora-state start 39 S . stop 31 0 1 6 . +else + log "HotFix 3 scripts were already installed." fi + + echo "100" echo "# Update finished"