Skip to content

Commit

Permalink
Merge branch 'master' into auto-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs authored Oct 18, 2024
2 parents 7e4131a + 860e339 commit afacb84
Show file tree
Hide file tree
Showing 28 changed files with 2,423 additions and 1 deletion.
5 changes: 5 additions & 0 deletions products.d/agama-products.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tru Oct 17 21:58:46 UTC 2024 - WesfunOfficial <93811710+WesfunOfficial@users.noreply.github.com>

- Added Slowroll to the product list (gh#agama-project/agama#1674)

-------------------------------------------------------------------
Thu Oct 17 08:16:42 UTC 2024 - Ladislav Slezák <lslezak@suse.com>

Expand Down
3 changes: 2 additions & 1 deletion products.d/agama-products.spec
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ install -m 0644 *.yaml %{buildroot}%{_datadir}/agama/products.d
Summary: Definition of openSUSE products for the Agama installer.

%description opensuse
Definition of openSUSE products (Tumbleweed, Leap and MicroOS) for the Agama installer.
Definition of openSUSE products (Tumbleweed, Leap, MicroOS and Slowroll) for the Agama installer.

%files opensuse
%doc README.md
Expand All @@ -51,6 +51,7 @@ Definition of openSUSE products (Tumbleweed, Leap and MicroOS) for the Agama ins
%{_datadir}/agama/products.d/microos.yaml
%{_datadir}/agama/products.d/tumbleweed.yaml
%{_datadir}/agama/products.d/leap_160.yaml
%{_datadir}/agama/products.d/slowroll.yaml

%package sle
Summary: Definition of SLE products for the Agama installer.
Expand Down
143 changes: 143 additions & 0 deletions products.d/slowroll.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
id: Slowroll
name: Slowroll
# ------------------------------------------------------------------------------
# WARNING: When changing the product description delete the translations located
# at the at translations/description key below to avoid using obsolete
# translations!!
# ------------------------------------------------------------------------------
description: 'A slightly slower rolling release of openSUSE designed to update
less often than Tumbleweed but more often than Leap without forcing users to
choose between "stable" and newer packages'
icon: Slowroll.svg
# Do not manually change any translations! See README.md for more details.
translations:
software:
installation_repositories:
- url: https://download.opensuse.org/slowroll/repo/oss/
archs: x86_64
- url: https://download.opensuse.org/slowroll/repo/non-oss/
archs: x86_64

mandatory_patterns:
- enhanced_base
optional_patterns: null
user_patterns:
- basic-desktop
- gnome
- kde
- yast2_basis
- yast2_desktop
- yast2_server
- multimedia
- office
mandatory_packages:
- NetworkManager
- openSUSE-repos-Slowroll
optional_packages: null
base_product: openSUSE

security:
lsm: apparmor
available_lsms:
apparmor:
patterns:
- apparmor
selinux:
patterns:
- selinux
policy: enforcing
none:
patterns: null

storage:
space_policy: delete
volumes:
- "/"
- "swap"
volume_templates:
- mount_path: "/"
filesystem: btrfs
btrfs:
snapshots: true
read_only: false
default_subvolume: "0"
subvolumes:
- path: home
- path: opt
- path: root
- path: srv
- path: usr/local
# Unified var subvolume - https://lists.opensuse.org/opensuse-packaging/2017-11/msg00017.html
- path: var
copy_on_write: false
# Architecture specific subvolumes
- path: boot/grub2/arm64-efi
archs: aarch64
- path: boot/grub2/arm-efi
archs: arm
- path: boot/grub2/i386-pc
archs: x86_64
- path: boot/grub2/powerpc-ieee1275
archs: ppc,!board_powernv
- path: boot/grub2/s390x-emu
archs: s390
- path: boot/grub2/x86_64-efi
archs: x86_64
- path: boot/grub2/riscv64-efi
archs: riscv64
size:
auto: true
outline:
required: true
filesystems:
- btrfs
- ext2
- ext3
- ext4
- xfs
auto_size:
base_min: 5 GiB
base_max: 15 GiB
snapshots_increment: 250%
max_fallback_for:
- "/home"
snapshots_configurable: true
- mount_path: "swap"
filesystem: swap
size:
auto: true
outline:
auto_size:
base_min: 1 GiB
base_max: 2 GiB
adjust_by_ram: true
required: false
filesystems:
- swap
- mount_path: "/home"
filesystem: xfs
size:
auto: false
min: 10 GiB
max: unlimited
outline:
required: false
filesystems:
- btrfs
- ext2
- ext3
- ext4
- xfs
- filesystem: xfs
size:
auto: false
min: 1 GiB
outline:
required: false
filesystems:
- btrfs
- ext2
- ext3
- ext4
- xfs
- vfat
1 change: 1 addition & 0 deletions service/lib/agama/storage/config_conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# find current contact information at www.suse.com.

require "agama/storage/config_conversions/from_json"
require "agama/storage/config_conversions/to_json"

module Agama
module Storage
Expand Down
48 changes: 48 additions & 0 deletions service/lib/agama/storage/config_conversions/to_json.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: true

# Copyright (c) [2024] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "agama/storage/config_conversions/to_json_conversions/config"

module Agama
module Storage
module ConfigConversions
# Config conversion to JSON hash according to schema.
class ToJSON
# @param config [Storage::Config]
def initialize(config)
@config = config
end

# Performs the conversion to Hash according to the JSON schema.
#
# @return [Hash]
def convert
ToJSONConversions::Config.new(config).convert
end

private

# @return [Storage::Config]
attr_reader :config
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# frozen_string_literal: true

# Copyright (c) [2024] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "agama/storage/config_conversions/from_json_conversions/base"
require "agama/storage/config_conversions/from_json_conversions/boot"
require "agama/storage/config_conversions/from_json_conversions/config"
require "agama/storage/config_conversions/from_json_conversions/drive"
require "agama/storage/config_conversions/from_json_conversions/encryption"
require "agama/storage/config_conversions/from_json_conversions/filesystem"
require "agama/storage/config_conversions/from_json_conversions/logical_volume"
require "agama/storage/config_conversions/from_json_conversions/luks1"
require "agama/storage/config_conversions/from_json_conversions/luks2"
require "agama/storage/config_conversions/from_json_conversions/partition"
require "agama/storage/config_conversions/from_json_conversions/pervasive_luks2"
require "agama/storage/config_conversions/from_json_conversions/search"
require "agama/storage/config_conversions/from_json_conversions/size"
require "agama/storage/config_conversions/from_json_conversions/volume_group"

module Agama
module Storage
module ConfigConversions
# Conversions to JSON.
module ToJSONConversions
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# frozen_string_literal: true

# Copyright (c) [2024] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

module Agama
module Storage
module ConfigConversions
module ToJSONConversions
# Base class for conversions to JSON hash according to schema.
class Base
# Defines the expected config type to perform the conversion.
#
# @raise If a subclass does not defines a type.
# @return [Class]
def self.config_type
raise "Undefined config type"
end

# @param config [Object] The config type is provided by the {.config_type} method.
def initialize(config)
type = self.class.config_type
raise "Invalid config (#{type} expected): #{config}" unless config.is_a?(type)

@config = config
end

# Performs the conversion to Hash according to the JSON schema.
#
# @return [Hash, nil]
def convert
config_json = {}

conversions.each do |property, value|
next if value.nil?

config_json[property] = value
end

config_json.empty? ? nil : config_json
end

private

# @return [Object] The config type is provided by the {.config_type} method.
attr_reader :config

# Values to generate the JSON.
#
# @return [Hash] e.g., { name: "/dev/vda" }.
def conversions
{}
end
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# frozen_string_literal: true

# Copyright (c) [2024] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "agama/storage/config_conversions/to_json_conversions/base"
require "agama/storage/configs/logical_volume"

module Agama
module Storage
module ConfigConversions
module ToJSONConversions
# Boot conversion to JSON hash according to schema.
class Boot < Base
# @see Base
def self.config_type
Configs::Boot
end

private

# @see Base#conversions
def conversions
{
configure: config.configure?,
device: config.device
}
end
end
end
end
end
end
Loading

0 comments on commit afacb84

Please sign in to comment.