Skip to content

Commit

Permalink
Report UI progress in PostUpdate scenario when installing 3rd party apps
Browse files Browse the repository at this point in the history
This should help with the progress monitor getting a signal during
this long duration phase.
  • Loading branch information
radujipa committed Feb 14, 2019
1 parent 034115a commit ce56bc0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
10 changes: 8 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ kano-updater (4.2.1-0) unstable; urgency=low
* Added free disk space check before download phase
* Restore DHCP hotfix for users experiencing Wireless reconnection issues on boot
* Migrate to using mirrored version of Raspbian repo
* Prioritised update from v3.7 to v3.8 over installation of 3rd party
apps in PostUpdate scenario
* Report UI progress in v3.7 to v3.8 PostUpdate scenario when installing
3rd party apps

-- Team Kano <[email protected]> Mon, 21 Jan 2019 14:12:00 +0000
-- Team Kano <[email protected]> Wed, 13 Feb 2019 14:12:00 +0000

kano-updater (4.2.0-0) unstable; urgency=low

Expand Down Expand Up @@ -69,8 +73,10 @@ kano-updater (3.16.2-0) unstable; urgency=low
* Backport: Configure dpkg to run in noninteractive mode to avoid potential update freezes
* Backport: Prioritised update from v3.7 to v3.8 over installation of 3rd
party apps in PostUpdate scenario
* Backport: Report UI progress in v3.7 to v3.8 PostUpdate scenario when
installing 3rd party apps

-- Team Kano <[email protected]> Tue, 12 Feb 2019 15:12:00 +0000
-- Team Kano <[email protected]> Wed, 13 Feb 2019 15:12:00 +0000

kano-updater (3.16.1-0) unstable; urgency=low

Expand Down
24 changes: 23 additions & 1 deletion kano_updater/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from kano_init.utils import reconfigure_autostart_policy

from kano_updater.progress import Phase
from kano_updater.os_version import OSVersion, get_target_version
from kano_updater.utils import install, remove_user_files, update_failed, \
purge, rclocal_executable, migrate_repository, get_users, run_for_every_user
Expand Down Expand Up @@ -902,7 +903,7 @@ def _bootconfig_set_value_helper(self, setting, value):
except ImportError:
logger.error("end_config_transaciton not present - update to kano-settings failed?")

def beta_370_to_beta_380(self, dummy_progress):
def beta_370_to_beta_380(self, progress):
# linux kernel 4.4.21 shipped with Kano 3.8.0 emits systemd boot messages.
# fix by telling the kernel to enable an empty splash screen.
command = "sed -i 's/\\bsystemd.show_status=0\\b/splash/' {}".format('/boot/cmdline.txt')
Expand Down Expand Up @@ -934,6 +935,25 @@ def beta_370_to_beta_380(self, dummy_progress):
{'kw_app': 'tux-typing', 'disk_req': 26},
{'kw_app': 'libreoffice', 'disk_req': 385},
]
phases = [
Phase(
app['kw_app'],
_("Installing {} from the App Store")
.format(app['kw_app']),
app['disk_req']
)
for app in new_apps
]
# TODO: Because the Pre/PostUpdate scenarios don't split the
# progress, this last phase essentially is used to preserve the
# phase from install.
phases.append(
Phase(
'continue-postupdate',
_("Running The Postupdate Scripts")
)
)
progress.split(*phases)

run_cmd_log('apt-get autoremove -y')

Expand All @@ -944,6 +964,7 @@ def beta_370_to_beta_380(self, dummy_progress):
mb_required = app['disk_req'] + 250 # MB buffer

if mb_free > mb_required:
progress.start(app['kw_app'])
run_cmd_log('kano-apps install --no-gui {app}'.format(app=app['kw_app']))
else:
logger.warn(
Expand All @@ -964,6 +985,7 @@ def beta_370_to_beta_380(self, dummy_progress):
)
finally:
run_cmd_log('apt-get clean')
progress.start('continue-postupdate')

# Tell kano-init to put the automatic logins up-to-date
reconfigure_autostart_policy()
Expand Down

0 comments on commit ce56bc0

Please sign in to comment.