From d3440bc46d41b5dc5ed5c07efed5b5d20c05d5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Mon, 12 Apr 2021 17:40:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BF=D0=BE=D1=87=D1=82?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D1=8B=D1=85=20=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC,=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=BF=D0=BE=D1=87=D0=B8=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D0=BC=D0=BE=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=D0=BE?= =?UTF-8?q?=D0=B9=20=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B0=20Btrfs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/install/fs_manager.py | 24 +++++++++--------------- pym/install/variables/autopartition.py | 2 +- pym/install/variables/disk.py | 3 +-- pym/install/variables/system.py | 7 +++++++ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pym/install/fs_manager.py b/pym/install/fs_manager.py index 994a1a0..d4211b4 100644 --- a/pym/install/fs_manager.py +++ b/pym/install/fs_manager.py @@ -176,21 +176,15 @@ class FileSystemManager(object): else: return "" - defaultFS = { - 'hdd': ("ext4" - if path.exists(supportFS['ext4']['format']) else - "btrfs" - if path.exists(supportFS['btrfs']['format']) else - "reiserfs" - if path.exists(supportFS['reiserfs']['format']) else - "ext3"), - 'flash': "vfat", - 'usb-hdd': ("ext4" - if path.exists(supportFS['ext4']['format']) else - "reiserfs" - if path.exists(supportFS['reiserfs']['format']) else - "ext3") - } + @classmethod + def get_default_fs(cls, dv, installtype): + if installtype == 'flash': + return 'vfat' + filesystems = dv.Get('install.cl_install_fs') + for fs in filesystems: + if fs in cls.supportFS and path.exists(cls.supportFS[fs]['format']): + return fs + return 'ext3' @classmethod def getDefaultOpt(cls, fs, ssd=False, compress=None): diff --git a/pym/install/variables/autopartition.py b/pym/install/variables/autopartition.py index 4c6977b..fac2d62 100644 --- a/pym/install/variables/autopartition.py +++ b/pym/install/variables/autopartition.py @@ -441,7 +441,7 @@ class VariableClAutopartitionDefaultFormat(Variable): type = "choice" def get(self): - return FileSystemManager.defaultFS['hdd'] + return FileSystemManager.get_default_fs(self, 'hdd') def choice(self): allfs = set([k for k,v in FileSystemManager.supportFS.items() diff --git a/pym/install/variables/disk.py b/pym/install/variables/disk.py index f642d88..b7efc00 100644 --- a/pym/install/variables/disk.py +++ b/pym/install/variables/disk.py @@ -1375,8 +1375,7 @@ class VariableOsLocationFormat(LocationHelper, Variable): return diskFormat[dev] if default_format: return default_format - return FileSystemManager.defaultFS.get( - osInstallRootType, "ext4") + return FileSystemManager.get_default_fs(self, osInstallRootType) return fs return wrap diff --git a/pym/install/variables/system.py b/pym/install/variables/system.py index e743a48..8ef69c4 100644 --- a/pym/install/variables/system.py +++ b/pym/install/variables/system.py @@ -991,6 +991,13 @@ class VariableOsInstallSplashSet(Variable): type = "bool" value = "on" +class VariableClInstallFs(Variable): + """ + Preferred fs + """ + type = "list" + + value = ["btrfs", "ext4", "reiserfs", "ext3"] class FlashUncompatible(VariableInterface): def uncompatible(self):