Skip to content
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
1 change: 1 addition & 0 deletions products.d/slowroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ security:
patterns: null

storage:
boot_strategy: BLS
space_policy: delete
volumes:
- "/"
Expand Down
1 change: 1 addition & 0 deletions products.d/tumbleweed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ security:
patterns: null

storage:
boot_strategy: BLS
space_policy: delete
volumes:
- "/"
Expand Down
7 changes: 7 additions & 0 deletions service/lib/agama/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ def lvm?
data.dig("storage", "lvm") || false
end

# Boot strategy for the product
#
# @return [String, nil]
def boot_strategy
data.dig("storage", "boot_strategy")
end

private

def mandatory_path?(path)
Expand Down
13 changes: 13 additions & 0 deletions service/lib/agama/storage/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
require "yast"
require "bootloader/proposal_client"
require "y2storage/storage_manager"
require "y2storage/storage_env"
require "y2storage/clients/inst_prepdisk"
require "agama/storage/actions_generator"
require "agama/storage/bootloader"
Expand Down Expand Up @@ -119,6 +120,12 @@ def on_probe(&block)
def probe(keep_config: false)
start_progress_with_size(4)
product_config.pick_product(software.selected_product)

# Underlying yast-storage-ng has own mechanism for proposing boot strategies.
# However, we don't always want to use BLS when it proposes so. Currently
# we want to use BLS only for Tumbleweed / Slowroll
prohibit_bls_boot if !product_config.boot_strategy&.casecmp("BLS")

check_multipath
progress.step(_("Activating storage devices")) { activate_devices }
progress.step(_("Probing storage devices")) { probe_devices }
Expand Down Expand Up @@ -214,6 +221,12 @@ def locale=(locale)
# @return [Logger]
attr_reader :logger

def prohibit_bls_boot
ENV["YAST_NO_BLS_BOOT"] = "1"
# avoiding problems with cached values
Y2Storage::StorageEnv.instance.reset_cache
end

# Issues are updated when the proposal is calculated
def register_proposal_callbacks
proposal.on_calculate { update_issues }
Expand Down
7 changes: 7 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 5 08:09:28 UTC 2025 - Michal Filka <mfilka@suse.com>

- introduced boot_strategy into storage section of product
definition yaml file. It allows to control what boot strategy
will be proposed by storage. Currently works only for BLS.

-------------------------------------------------------------------
Wed Feb 26 06:52:45 UTC 2025 - José Iván López González <jlopez@suse.com>

Expand Down
8 changes: 8 additions & 0 deletions service/test/agama/storage/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@

let(:callback) { proc {} }

it "sets env YAST_NO_BLS_BOOT to yes if product doesn't requires bls boot explicitly" do
expect(config).to receive(:pick_product)
expect(config).to receive(:boot_strategy).and_return(nil)
expect(ENV).to receive(:[]=).with("YAST_NO_BLS_BOOT", "1")

storage.probe
end

it "probes the storage devices and calculates a proposal" do
expect(config).to receive(:pick_product).with("ALP")
expect(iscsi).to receive(:activate)
Expand Down