From 0a48175249ab2d2da1c3a80a57eeee2d1b8e545b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 1 Jan 2020 03:02:11 -0800 Subject: [PATCH] storage: Ignore errors resizing partition during initial setup On Raspberry Pi 3B+ image, it was observed that resizing partition fails during initial setup. Due to this, Apache, SSH and Plinth become unavailable. Since resizing the partition is not a critical operation to perform to bring up FreedomBox, it is safe it ignore the error. In these cases, the user will have to the storage app and retry manually after bring prompted by low disk space message. Tests: - Introduce deliberate error in expand partition operation. Modify code to always detect that partition can be expanded. Remove storage module from plinth_module table in plinth.sqlite3. Run plinth. Notice that storage setup is run but expanding partition fails. Even after expanding partition fails, storage module is fully setup. Plinth proceeds with starting web server and storage module is found in the plinth_module table of plinth.sqlite3. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/storage/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plinth/modules/storage/__init__.py b/plinth/modules/storage/__init__.py index 8605d7c6e..a162d3b35 100644 --- a/plinth/modules/storage/__init__.py +++ b/plinth/modules/storage/__init__.py @@ -27,7 +27,7 @@ from plinth import actions from plinth import app as app_module from plinth import cfg, menu, utils from plinth.daemon import Daemon -from plinth.errors import PlinthError +from plinth.errors import ActionError, PlinthError from plinth.utils import format_lazy, import_from_gi from .manifest import backup # noqa, pylint: disable=unused-import @@ -281,4 +281,7 @@ def setup(helper, old_version=None): disks = get_disks() root_device = get_root_device(disks) if is_expandable(root_device): - expand_partition(root_device) + try: + expand_partition(root_device) + except ActionError: + pass