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 08:02:40 UTC 2026 - Lidong Zhong <lidong.zhong@suse.com>

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

-------------------------------------------------------------------
Thu Apr 9 06:53:34 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@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/umounter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,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 @@ -123,7 +124,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 @@ -133,6 +134,12 @@ def collect_logs
)
end

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

def logs_dir
@logs_dir ||= File.join(
Yast::Installation.destdir, "var", "log", "agama-installation"
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 08:03:07 UTC 2026 - Lidong Zhong <lidong.zhong@suse.com>

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

-------------------------------------------------------------------
Wed Apr 8 09:28:31 UTC 2026 - Knut Anderssen <kanderssen@suse.com>

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

describe described_class::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 { described_class.new(logger) }
Expand All @@ -72,14 +72,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
Expand Down