diff --git a/live/root/tmp/driver_cleanup.rb b/live/root/tmp/driver_cleanup.rb
index b7c26def1f..6377a955e1 100755
--- a/live/root/tmp/driver_cleanup.rb
+++ b/live/root/tmp/driver_cleanup.rb
@@ -58,17 +58,57 @@ def self.from_file(file)
end
end
+# Remove lines for other architectures than the current machine architecture. The arch specific
+# lines start with the <$arch> line and end with the $arch> line.
+def arch_filter(lines)
+ # the current state for a finite-state machine with two states (inside or outside an arch tag)
+ skipping = false
+ # the current machine architecture
+ arch = `arch`.strip
+ # the architecture from the tag line
+ arch_tag = nil
+
+ lines.reject! do |line|
+ # opening arch tag
+ if line.match(/^\s*<\s*(\w+)\s*>\s*$/)
+ arch_tag = Regexp.last_match[1]
+ skipping = arch_tag != arch
+ # always remove the arch tag
+ next true
+ end
+
+ # closing arch tag, for simplicity let's assume it matches the previous opening tag, the tags
+ # cannot be nested and the input file is under our control and so we can be sure it is valid
+ if line.match(/^\s*<\/\s*\w+\s*>\s*$/)
+ skipping = false
+ # always remove the arch tag
+ next true
+ end
+
+ if skipping
+ puts "Ignoring #{arch_tag} specific line: #{line}"
+ end
+
+ skipping
+ end
+end
+
# really delete or just do a smoke test?
do_delete = ARGV[0] == "--delete"
debug = ENV["DEBUG"] == "1"
# read the configuration files
+# this file is a copy from https://github.com/openSUSE/installation-images/blob/master/etc/module.list
config = File.read(File.join(__dir__, "module.list")).split("\n")
+# here are Agama specific overrides
config += File.read(File.join(__dir__, "module.list.extra")).split("\n")
# remove comments and empty lines
config.reject!{|l| l.empty? || l.start_with?("#")}
+# process the architecture specific lines
+arch_filter(config)
+
# split the list into keep and delete parts (starting with "-")
delete, keep = config.partition{|c| c.start_with?("-")}
diff --git a/live/root/tmp/module.list b/live/root/tmp/module.list
index 54574108bc..71c7066951 100644
--- a/live/root/tmp/module.list
+++ b/live/root/tmp/module.list
@@ -3,6 +3,10 @@
# Lines starting with '-' specify modules to drop.
# The lines below are actually perl regexps, so be careful.
#
+# If a module is specified both to be added and dropped, it is dropped.
+#
+# Arch-dependend blocks start with and end with (on separate lines).
+#
kernel/drivers/base/
kernel/drivers/block/
-kernel/drivers/block/paride
@@ -311,3 +315,14 @@ updates/
-updates/net/sunrpc/
-updates/fs/lockd/
-updates/fs/nfs*
+
+
+# for the source of this module list, see bsc#1213879 comment 35
+-kernel/drivers/net/wireless/
+-kernel/net/ieee80211/
+-kernel/net/mac80211/
+-kernel/net/wireless/
+-kernel/net/wimax/
+-kernel/drivers/gpu/
+-kernel/drivers/video/
+
diff --git a/live/src/agama-installer.changes b/live/src/agama-installer.changes
index 205ea1faa8..d426be83a0 100644
--- a/live/src/agama-installer.changes
+++ b/live/src/agama-installer.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Mon Feb 24 16:19:03 UTC 2025 - Ladislav Slezák
+
+- Reduce the PPC initrd size (gh#agama-project/agama#2026),
+ use the same solution from installation-images
+ (gh#openSUSE/installation-images#754)
+
-------------------------------------------------------------------
Mon Feb 24 13:35:04 UTC 2025 - Ladislav Slezák
diff --git a/live/src/config.sh b/live/src/config.sh
index b80cdf6a26..1cb4e9a34f 100644
--- a/live/src/config.sh
+++ b/live/src/config.sh
@@ -208,8 +208,8 @@ du -h -s /lib/modules /lib/firmware
# remove the multimedia drivers
# set DEBUG=1 to print the deleted drivers
/tmp/driver_cleanup.rb --delete
-# remove the script, not needed anymore
-rm /tmp/driver_cleanup.rb
+# remove the script and data, not needed anymore
+rm /tmp/driver_cleanup.rb /tmp/module.list*
# remove the unused firmware (not referenced by kernel drivers)
/tmp/fw_cleanup.rb --delete