diff --git a/install/fs_manager.py b/install/fs_manager.py index 8583f86..884d8b7 100644 --- a/install/fs_manager.py +++ b/install/fs_manager.py @@ -59,6 +59,7 @@ class FileSystemManager: 'msdos': '83', 'type':['hdd','usb-hdd']}, 'btrfs': {'defaultopt': defaultOpt, + 'format':'/sbin/mkfs.btrfs', 'formatparam': '{labelparam} {device}', 'gpt': '0700', 'label': '-L {labelname}', diff --git a/install/variables/system.py b/install/variables/system.py index 3bcc35e..04d6455 100644 --- a/install/variables/system.py +++ b/install/variables/system.py @@ -106,11 +106,16 @@ class VariableOsFormatUse(ReadonlyVariable): 'type': "bool", 'value': "off"} + def checkFunc(self,fs): + if fs == "btrfs" and self.Get('os_root_type') == 'livecd': + return "no" + if "format" in FileSystemManager.supportFS[fs] and \ + path.exists(FileSystemManager.supportFS[fs]["format"]): + return "yes" + return "no" + def get(self): - return map(lambda x:"yes" - if "format" in FileSystemManager.supportFS[x] and \ - path.exists(FileSystemManager.supportFS[x]["format"]) - else "no", self.Get('os_format_type')) + return map(self.checkFunc, self.Get('os_format_type')) class VariableClMigrateRootPwd(UserHelper,Variable): """