From 6c86db132ba2d5f55e760f0be1e90ff0f3e9938f Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 28 Mar 2019 13:51:00 -0700 Subject: [PATCH] storage: Don't check type of the disk for / and /boot Other types could be 'disk' (where there is no partition table) and 'loop' when the disk is a loop back device. As long as they are mounted on a important folders, don't let user unmount them. Signed-off-by: Sunil Mohan Adapa --- plinth/modules/storage/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plinth/modules/storage/__init__.py b/plinth/modules/storage/__init__.py index 5c0248075..9d6555be2 100644 --- a/plinth/modules/storage/__init__.py +++ b/plinth/modules/storage/__init__.py @@ -174,12 +174,12 @@ def is_removable_device(disk): def is_root_partition(disk): """Returns whether this disk is mounted at /.""" - return disk['mountpoint'] == '/' and disk['type'] == 'part' + return disk['mountpoint'] == '/' def is_boot_partition(disk): """Returns whether this disk is mounted at /boot.""" - return disk['mountpoint'] == '/boot' and disk['type'] == 'part' + return disk['mountpoint'] == '/boot' def is_expandable(device):