From 81d352e665e4c28fe6a2847eb48cf0e153ee368f Mon Sep 17 00:00:00 2001 From: Radu Jipa Date: Wed, 13 Feb 2019 12:47:27 +0000 Subject: [PATCH] Report UI progress in PostUpdate scenario when installing 3rd party apps This should help with the progress monitor getting a signal during this long duration phase. --- debian/changelog | 10 ++++++++-- kano_updater/scenarios.py | 24 +++++++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 90f4b133..35b630a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 21 Jan 2019 14:12:00 +0000 + -- Team Kano Wed, 13 Feb 2019 14:12:00 +0000 kano-updater (4.2.0-0) unstable; urgency=low @@ -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 Tue, 12 Feb 2019 15:12:00 +0000 + -- Team Kano Wed, 13 Feb 2019 15:12:00 +0000 kano-updater (3.16.1-0) unstable; urgency=low diff --git a/kano_updater/scenarios.py b/kano_updater/scenarios.py index 8c9182e8..011f5bb5 100644 --- a/kano_updater/scenarios.py +++ b/kano_updater/scenarios.py @@ -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 @@ -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') @@ -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') @@ -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( @@ -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()