Skip to content

Commit

Permalink
Merge pull request #899 from openSUSE/force-timezone
Browse files Browse the repository at this point in the history
Force writing the timezone
  • Loading branch information
imobachgs authored Dec 3, 2023
2 parents c34f5c7 + 6ebe3ba commit e953702
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 8 deletions.
13 changes: 5 additions & 8 deletions rust/agama-dbus-server/src/locale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down
6 changes: 6 additions & 0 deletions rust/package/agama-cli.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Dec 3 15:53:34 UTC 2023 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- 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 <igonzalezsosa@suse.com>

Expand Down
58 changes: 58 additions & 0 deletions service/lib/agama/dbus/y2dir/modules/InstFunctions.rb
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions service/package/rubygem-agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sun Dec 3 15:45:22 UTC 2023 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- 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 <igonzalezsosa@suse.com>

Expand Down

0 comments on commit e953702

Please sign in to comment.