def setDefaultPartitioning(self, storage): autorequests = [ PartSpec(mountpoint="/", fstype=storage.default_fstype, size=Size("2GiB"), max_size=Size("15GiB"), grow=True, btr=True, lv=True, thin=True, encrypted=True) ] bootreqs = platform.set_default_partitioning() if bootreqs: autorequests.extend(bootreqs) disk_space = getAvailableDiskSpace(storage) swp = swap_suggestion(disk_space=disk_space) autorequests.append( PartSpec(fstype="swap", size=swp, grow=False, lv=True, encrypted=True)) for autoreq in autorequests: if autoreq.fstype is None: if autoreq.mountpoint == "/boot": autoreq.fstype = storage.default_boot_fstype else: autoreq.fstype = storage.default_fstype storage.autopart_requests = autorequests
def get_default_partitioning(partitioning_type=None): """Get the default partitioning requests. :param partitioning_type: a type of the partitioning :return: a list of partitioning specs """ if not partitioning_type: partitioning_type = conf.storage.default_partitioning if partitioning_type is PartitioningType.SERVER: return platform.set_default_partitioning() + SERVER_PARTITIONING if partitioning_type is PartitioningType.WORKSTATION: return platform.set_default_partitioning() + WORKSTATION_PARTITIONING raise ValueError("Invalid partitioning type: {}".format(conf.storage.default_partitioning))
def createDefaultPartitioning(storage): autorequests = [PartSpec(mountpoint="/", fstype=storage.default_fstype, size=Size("2GiB"), max_size=Size("15GiB"), grow=True, # Allow one to pass in any of following for root partition # `autopart --type [partition|plain|btrfs|lvm|thinp] [--encrypted]` btr=True, lv=True, thin=True, encrypted=True)] bootreqs = platform.set_default_partitioning() if bootreqs: autorequests.extend(bootreqs) disk_space = getAvailableDiskSpace(storage) swp = swap_suggestion(disk_space=disk_space) autorequests.append(PartSpec(fstype="swap", size=swp, grow=False, lv=True, encrypted=True)) for autoreq in autorequests: if autoreq.fstype is None: if autoreq.mountpoint == "/boot": autoreq.fstype = storage.default_boot_fstype else: autoreq.fstype = storage.default_fstype storage.autopart_requests = autorequests
def setDefaultPartitioning(self, storage): autorequests = [ PartSpec(mountpoint="/", fstype=storage.default_fstype, size=Size("6GiB"), thin=True, grow=True, lv=True), PartSpec(mountpoint="/home", fstype=storage.default_fstype, size=Size("1GiB"), thin=True, lv=True), PartSpec(mountpoint="/tmp", fstype=storage.default_fstype, size=Size("1GiB"), thin=True, lv=True), PartSpec(mountpoint="/var", fstype=storage.default_fstype, size=Size("15GiB"), thin=True, lv=True), PartSpec(mountpoint="/var/log", fstype=storage.default_fstype, size=Size("8GiB"), thin=True, lv=True), PartSpec(mountpoint="/var/log/audit", fstype=storage.default_fstype, size=Size("2GiB"), thin=True, lv=True) ] bootreqs = platform.set_default_partitioning() if bootreqs: autorequests.extend(bootreqs) disk_space = getAvailableDiskSpace(storage) swp = swap_suggestion(disk_space=disk_space) autorequests.append( PartSpec(fstype="swap", size=swp, grow=False, lv=True, encrypted=True)) for autoreq in autorequests: if autoreq.fstype is None: if autoreq.mountpoint == "/boot": autoreq.fstype = storage.default_boot_fstype autoreq.size = Size("1GiB") else: autoreq.fstype = storage.default_fstype storage.autopart_requests = autorequests storage.autopart_type = AUTOPART_TYPE_LVM_THINP