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
5 changes: 5 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Apr 10 06:21:35 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Run scripts from /var/lib/agama/scripts (bsc#1261787).

-------------------------------------------------------------------
Tue Mar 24 10:57:02 UTC 2026 - Knut Anderssen <kanderssen@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion rust/share/agama-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# This script runs the user-defined Agama init scripts.

: "${SCRIPTS_DIR:=/var/log/agama-installation/scripts/init}"
: "${SCRIPTS_DIR:=/var/lib/agama/scripts/init}"

systemctl disable agama-scripts.service

Expand Down
9 changes: 8 additions & 1 deletion service/lib/agama/storage/finisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def label

def run
FileUtils.mkdir_p(logs_dir, mode: 0o700)
FileUtils.mkdir_p(var_dir, mode: 0o700)
collect_logs
copy_scripts
end
Expand All @@ -265,7 +266,7 @@ def run
def copy_scripts
return unless Dir.exist?(SCRIPTS_DIR)

FileUtils.cp_r(SCRIPTS_DIR, logs_dir)
FileUtils.cp_r(SCRIPTS_DIR, var_dir)
end

def collect_logs
Expand All @@ -280,6 +281,12 @@ def logs_dir
Yast::Installation.destdir, "var", "log", "agama-installation"
)
end

def var_dir
@var_dir ||= File.join(
Yast::Installation.destdir, "var", "lib", "agama"
)
end
end

# Executes post-installation scripts
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Apr 10 06:20:39 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Use /var/lib/agama/scripts to save the scripts in the target
system (bsc#1261787).

-------------------------------------------------------------------
Tue Mar 24 07:13:47 UTC 2026 - Knut Anderssen <kanderssen@suse.com>

Expand Down
12 changes: 7 additions & 5 deletions service/test/agama/storage/finisher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

describe Agama::Storage::Finisher::CopyLogsStep do
let(:logger) { Logger.new($stdout, level: :warn) }
let(:scripts_dir) { File.join(tmp_dir, "run", "agama", "scripts") }
let(:init_scripts_dir) { File.join(tmp_dir, "run", "agama", "scripts", "init") }
let(:tmp_dir) { Dir.mktmpdir }

subject { Agama::Storage::Finisher::CopyLogsStep.new(logger) }
Expand All @@ -174,14 +174,16 @@

context "when scripts artifacts exist" do
before do
FileUtils.mkdir_p(scripts_dir)
FileUtils.touch(File.join(scripts_dir, "test.sh"))
FileUtils.mkdir_p(init_scripts_dir)
FileUtils.touch(File.join(init_scripts_dir, "test.sh"))
end

it "copies the artifacts to the installed system" do
subject.run
expect(File).to exist(File.join(tmp_dir, "mnt", "var", "log", "agama-installation",
"scripts"))
files = Dir.glob(File.join(tmp_dir, "**", "*"))
puts files
expect(File).to exist(File.join(tmp_dir, "mnt", "var", "lib", "agama",
"scripts", "init", "test.sh"))
end
end
end
3 changes: 1 addition & 2 deletions service/test/agama/storage/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,7 @@

it "copies the artifacts to the installed system" do
storage.finish
expect(File).to exist(File.join(tmp_dir, "mnt", "var", "log", "agama-installation",
"scripts"))
expect(File).to exist(File.join(tmp_dir, "mnt", "var", "lib", "agama", "scripts"))
end
end
end
Expand Down
Loading