Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the user visible patterns configurable, added MicroOS products #916

Merged
merged 15 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .yupdate.post
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function restart_service() {

if [ -n "$SERVICE_START" ]; then
SERVICE_START_UNIX_TIME=$(date -d "$SERVICE_START" +"%s")
# find the date of the latest file in the gem
NEWEST_FILE_TIME=$(find /usr/lib*/ruby/gems/*/gems/$SERVICE_NAME-* -exec stat --format %Y "{}" \; | sort -nr | head -n 1)
# find the date of the latest file in the product configuration or in the gem
NEWEST_FILE_TIME=$(find /usr/share/agama/products.d /usr/lib*/ruby/gems/*/gems/$SERVICE_NAME-* -exec stat --format %Y "{}" \; | sort -nr | head -n 1)

# when a file is newer than the start time then restart the service
if [ -n "$NEWEST_FILE_TIME" ] && [ "$SERVICE_START_UNIX_TIME" -lt "$NEWEST_FILE_TIME" ]; then
Expand Down
16 changes: 16 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,21 @@ if ENV["YUPDATE_FORCE"] == "1" || File.exist?("/.packages.initrd") || live_iso?
FileUtils.mkdir_p(File.join(destdir, "/usr/share"))
FileUtils.cp_r("playwright/.", File.join(destdir, "/usr/share/agama-playwright"))
end

if ENV["YUPDATE_SKIP_PRODUCTS"] != "1"
files = Dir.glob("products.d/*.y{a}ml")
files.each do |f|
# the sources contain several products, update only the existing files
oldfile = File.join("/usr/share/agama/", f)
if File.exist?(oldfile)
target = File.join(destdir, "/usr/share/agama/", f)
FileUtils.mkdir_p(File.dirname(target))
FileUtils.cp(f, target)
else
# if there is a new product file it needs to be copied manually
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without putting too much thinking into it... not sure if this is the behavior I would expect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, problem is that it is hard to know which product belongs to which iso

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the Git repository contains YAML files for all product. If you are patching the openSUSE Agama installer then the Live medium contains only the openSUSE products.

If yupdate would install all files you would suddenly see the ALP Dolomite product in the list, that would be confusing. So I decided to patch only the existing files and to not blindly copy everything available. IMHO it is better to have a safer default behavior.

puts "Skipping product file: #{f}"
end
end
end
end
end
9 changes: 9 additions & 0 deletions doc/yaml_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ Array of patterns that have to be selected.

Array of patterns that should be selected but can be deselected or skipped if not available.

#### user\_patterns

Array of patterns that are displayed in the pattern selector UI and user can
select them to install.

If the list is empty then the pattern selector is not displayed. If the key is
not defined or the value is missing or is `null` then all available user visible
patterns are displayed.

### security

Options related to security
Expand Down
2 changes: 2 additions & 0 deletions products.d/ALP-Dolomite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ software:
- alp_cockpit
- alp_hardware
optional_patterns: null # no optional pattern shared
# no user selectable patterns, do not display the pattern selector
user_patterns: []
mandatory_packages:
- package: ppc64-diag # Needed for hardware-based installations
archs: ppc64
Expand Down
6 changes: 6 additions & 0 deletions products.d/agama-products-opensuse.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Dec 4 14:11:51 UTC 2023 - Ancor Gonzalez Sosa <ancor@suse.com>

- Preliminary definitions of openSUSE MicroOS products
- Remove Leap 16.0 for now

-------------------------------------------------------------------
Mon Oct 30 14:38:51 UTC 2023 - Josef Reidinger <jreidinger@suse.com>

Expand Down
3 changes: 2 additions & 1 deletion products.d/agama-products-opensuse.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ install -m 0644 *.yaml %{buildroot}%{_datadir}/agama/products.d
%files
%dir %{_datadir}/agama
%dir %{_datadir}/agama/products.d
%{_datadir}/agama/products.d/microos.yaml
%{_datadir}/agama/products.d/microos-desktop.yaml
%{_datadir}/agama/products.d/tumbleweed.yaml
%{_datadir}/agama/products.d/leap16.yaml

%files -n agama-products-ALP-Dolomite
%dir %{_datadir}/agama
Expand Down
100 changes: 0 additions & 100 deletions products.d/leap16.yaml

This file was deleted.

110 changes: 110 additions & 0 deletions products.d/microos-desktop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
id: MicroOS-Desktop
name: openSUSE MicroOS Desktop
# ------------------------------------------------------------------------------
# WARNING: When changing the product description delete the translations located
# at the at translations/description key below to avoid using obsolete
# translations!!
# ------------------------------------------------------------------------------
description: 'A distribution for the desktop offering automatic updates and
rollback on top of the foundations of openSUSE MicroOS. Includes Podman
Container Runtime and allows to manage software using Gnome Software or
KDE Discover.'
# Do not manually change any translations! See README.md for more details.
translations:
software:
installation_repositories:
- url: https://download.opensuse.org/tumbleweed/repo/oss/
archs: x86_64
- url: https://download.opensuse.org/ports/aarch64/tumbleweed/repo/oss/
archs: aarch64
- url: https://download.opensuse.org/ports/zsystems/tumbleweed/repo/oss/
archs: s390
- url: https://download.opensuse.org/ports/ppc/tumbleweed/repo/oss/
archs: ppc
- url: https://download.opensuse.org/tumbleweed/repo/non-oss/
archs: x86_64
# aarch64 does not have non-oss ports. Keep eye if it change
- url: https://download.opensuse.org/ports/zsystems/tumbleweed/repo/non-oss/
archs: s390
- url: https://download.opensuse.org/ports/ppc/tumbleweed/repo/non-oss/
archs: ppc
- url: https://download.opensuse.org/update/tumbleweed/
archs: x86_64
- url: https://download.opensuse.org/ports/aarch64/update/tumbleweed/
archs: aarch64
- url: https://download.opensuse.org/ports/zsystems/update/tumbleweed/
archs: s390
- url: https://download.opensuse.org/ports/ppc/tumbleweed/repo/oss/
archs: ppc
mandatory_patterns:
- microos_base
- microos_base_zypper
- microos_defaults
- microos_hardware
- container_runtime
- pattern: 32bit
archs: x86_64
optional_patterns:
- microos_gnome_desktop
user_patterns:
- microos_gnome_desktop
- microos_kde_desktop
mandatory_packages:
- NetworkManager
optional_packages: null
base_product: MicroOS

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

storage:
space_policy: delete
volumes:
- "/"
volume_templates:
- mount_path: "/"
filesystem: btrfs
btrfs:
snapshots: true
read_only: true
default_subvolume: "@"
subvolumes:
- path: home
- path: opt
- path: root
- path: srv
- path: usr/local
- path: boot/writable
# 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: false
min: 5 GiB
outline:
required: true
snapshots_configurable: false
filesystems:
- btrfs
Loading