@@ -772,36 +772,6 @@ def _prepare_encrypt(self, before: str = 'filesystems') -> None:
772772 if 'encrypt' not in self ._hooks :
773773 self ._hooks .insert (self ._hooks .index (before ), 'encrypt' )
774774
775- def _handle_partition_installation (self ) -> None :
776- pvs = []
777- if self ._disk_config .lvm_config :
778- pvs = self ._disk_config .lvm_config .get_all_pvs ()
779-
780- for mod in self ._disk_config .device_modifications :
781- for part in mod .partitions :
782- if part in pvs or part .fs_type is None :
783- continue
784-
785- self ._prepare_fs_type (part .fs_type , part .mountpoint )
786-
787- if part in self ._disk_encryption .partitions :
788- self ._prepare_encrypt ()
789-
790- def _handle_lvm_installation (self ) -> None :
791- if not self ._disk_config .lvm_config :
792- return
793-
794- self .add_additional_packages ('lvm2' )
795- self ._hooks .insert (self ._hooks .index ('filesystems' ) - 1 , 'lvm2' )
796-
797- for vg in self ._disk_config .lvm_config .vol_groups :
798- for vol in vg .volumes :
799- if vol .fs_type is not None :
800- self ._prepare_fs_type (vol .fs_type , vol .mountpoint )
801-
802- if self ._disk_encryption .encryption_type in [disk .EncryptionType .LvmOnLuks , disk .EncryptionType .LuksOnLvm ]:
803- self ._prepare_encrypt ('lvm2' )
804-
805775 def minimal_installation (
806776 self ,
807777 testing : bool = False ,
@@ -811,9 +781,28 @@ def minimal_installation(
811781 locale_config : LocaleConfiguration = LocaleConfiguration .default ()
812782 ):
813783 if self ._disk_config .lvm_config :
814- self ._handle_lvm_installation ()
784+ lvm = 'lvm2'
785+ self .add_additional_packages (lvm )
786+ self ._hooks .insert (self ._hooks .index ('filesystems' ) - 1 , lvm )
787+
788+ for vg in self ._disk_config .lvm_config .vol_groups :
789+ for vol in vg .volumes :
790+ if vol .fs_type is not None :
791+ self ._prepare_fs_type (vol .fs_type , vol .mountpoint )
792+
793+ types = (disk .EncryptionType .LvmOnLuks , disk .EncryptionType .LuksOnLvm )
794+ if self ._disk_encryption .encryption_type in types :
795+ self ._prepare_encrypt (lvm )
815796 else :
816- self ._handle_partition_installation ()
797+ for mod in self ._disk_config .device_modifications :
798+ for part in mod .partitions :
799+ if part .fs_type is None :
800+ continue
801+
802+ self ._prepare_fs_type (part .fs_type , part .mountpoint )
803+
804+ if part in self ._disk_encryption .partitions :
805+ self ._prepare_encrypt ()
817806
818807 if not SysInfo .has_uefi ():
819808 self ._base_packages .append ('grub' )
0 commit comments