diff --git a/rust/agama-dbus-server/src/locale.rs b/rust/agama-dbus-server/src/locale.rs index cae074a708..aabdfdc260 100644 --- a/rust/agama-dbus-server/src/locale.rs +++ b/rust/agama-dbus-server/src/locale.rs @@ -156,19 +156,16 @@ impl Locale { .args([ "--root", ROOT, + "--force", "--locale", self.locales.first().context("missing locale")?.as_str(), + "--keymap", + &self.keymap.to_string(), + "--timezone", + &self.timezone, ]) .status() .context("Failed to execute systemd-firstboot")?; - Command::new("/usr/bin/systemd-firstboot") - .args(["--root", ROOT, "--keymap", &self.keymap.to_string()]) - .status() - .context("Failed to execute systemd-firstboot")?; - Command::new("/usr/bin/systemd-firstboot") - .args(["--root", ROOT, "--timezone", self.timezone.as_str()]) - .status() - .context("Failed to execute systemd-firstboot")?; Ok(()) } diff --git a/rust/package/agama-cli.changes b/rust/package/agama-cli.changes index 074339a3f5..38b6622ad3 100644 --- a/rust/package/agama-cli.changes +++ b/rust/package/agama-cli.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Dec 3 15:53:34 UTC 2023 - Imobach Gonzalez Sosa + +- Use a single call to systemd-firstboot to write the localization + settings (gh#openSUSE/agama#903). + ------------------------------------------------------------------- Sat Dec 2 18:05:54 UTC 2023 - Imobach Gonzalez Sosa diff --git a/service/lib/agama/dbus/y2dir/modules/InstFunctions.rb b/service/lib/agama/dbus/y2dir/modules/InstFunctions.rb new file mode 100644 index 0000000000..a1d5a21cc4 --- /dev/null +++ b/service/lib/agama/dbus/y2dir/modules/InstFunctions.rb @@ -0,0 +1,58 @@ +# Copyright (c) [2022-2023] 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 "yast" + +# :nodoc: +module Yast + # Replacement for the Yast::Package module + # + # @see https://github.com/yast/yast-installation/blob/279b7d108eab24082237cf5e3f02a31f58fef8da/src/modules/InstFunctions.rb + class InstFunctionsClass < Module + def main + puts "Loading mocked module #{__FILE__}" + end + + # @see https://github.com/yast/yast-installation/blob/279b7d108eab24082237cf5e3f02a31f58fef8da/src/modules/InstFunctions.rb#L56 + def ignored_features + [] + end + + # @see https://github.com/yast/yast-installation/blob/279b7d108eab24082237cf5e3f02a31f58fef8da/src/modules/InstFunctions.rb#L83 + def reset_ignored_features; end + + # @see https://github.com/yast/yast-installation/blob/279b7d108eab24082237cf5e3f02a31f58fef8da/src/modules/InstFunctions.rb#L91 + def feature_ignored?(_feature_name) + false + end + + # @see https://github.com/yast/yast-installation/blob/279b7d108eab24082237cf5e3f02a31f58fef8da/src/modules/InstFunctions.rb#L107 + def second_stage_required? + false + end + + # @see https://github.com/yast/yast-installation/blob/279b7d108eab24082237cf5e3f02a31f58fef8da/src/modules/InstFunctions.rb#L137 + def self_update_explicitly_enabled? + false + end + end + + InstFunctions = InstFunctionsClass.new + InstFunctions.main +end diff --git a/service/lib/agama/dbus/y2dir/storage/modules/InstFunctions.rb b/service/lib/agama/dbus/y2dir/storage/modules/InstFunctions.rb new file mode 120000 index 0000000000..42c5d80092 --- /dev/null +++ b/service/lib/agama/dbus/y2dir/storage/modules/InstFunctions.rb @@ -0,0 +1 @@ +../../modules/InstFunctions.rb \ No newline at end of file diff --git a/service/package/rubygem-agama.changes b/service/package/rubygem-agama.changes index 596ead89a6..ea4c958623 100644 --- a/service/package/rubygem-agama.changes +++ b/service/package/rubygem-agama.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Dec 3 15:45:22 UTC 2023 - Imobach Gonzalez Sosa + +- Redefine the InstFunctions module to avoid calling code that + causes unwanted side effects, like resetting the timezone + (gh#openSUSE/agama#903). + ------------------------------------------------------------------- Sat Dec 2 18:05:37 UTC 2023 - Imobach Gonzalez Sosa