Skip to content

Commit

Permalink
Merge pull request #1080 from yast/unmount_ag_udev
Browse files Browse the repository at this point in the history
save inst-sys memory by ending the agent process after use (bsc#1172139)
  • Loading branch information
mvidner committed Jun 19, 2020
2 parents 7a9507d + ed6a4a9 commit 6ad9e61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/yast2-network.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jun 19 08:52:54 UTC 2020 - Martin Vidner <mvidner@suse.com>

- Save inst-sys memory by ending ag_udev_persistent after use
(bsc#1172139).
- 4.3.7

-------------------------------------------------------------------
Mon Jun 15 11:53:03 UTC 2020 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-network.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-network
Version: 4.3.6
Version: 4.3.7
Release: 0
Summary: YaST2 - Network Configuration
License: GPL-2.0-only
Expand Down
3 changes: 3 additions & 0 deletions src/lib/y2network/udev_rule.rb
Expand Up @@ -160,6 +160,7 @@ def write_net_rules(udev_rules)
Yast::SCR.Write(Yast::Path.new(".udev_persistent.rules"), udev_rules.map(&:to_s))
# Writes changes to the rules file
Yast::SCR.Write(Yast::Path.new(".udev_persistent.nil"), [])
Yast::SCR.UnmountAgent(Yast::Path.new(".udev_persistent"))
end

# Writes drivers specific udev rules to the filesystem
Expand All @@ -177,6 +178,7 @@ def write_drivers_rules(udev_rules)
Yast::SCR.Write(Yast::Path.new(".udev_persistent.drivers"), rules_hash)
# Writes changes to the rules file
Yast::SCR.Write(Yast::Path.new(".udev_persistent.nil"), [])
Yast::SCR.UnmountAgent(Yast::Path.new(".udev_persistent"))
end

# Clears rules cache map
Expand All @@ -191,6 +193,7 @@ def find_rules(group)
return @all[group] if @all[group]

rules_map = Yast::SCR.Read(Yast::Path.new(".udev_persistent.#{group}")) || {}
Yast::SCR.UnmountAgent(Yast::Path.new(".udev_persistent"))
@all[group] = rules_map.values.map do |parts|
udev_parts = parts.map { |p| UdevRulePart.from_string(p) }.compact
new(udev_parts)
Expand Down

0 comments on commit 6ad9e61

Please sign in to comment.