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
40 changes: 40 additions & 0 deletions live/root/tmp/driver_cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?("-")}

Expand Down
15 changes: 15 additions & 0 deletions live/root/tmp/module.list
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ARCH> and end with </ARCH> (on separate lines).
#
kernel/drivers/base/
kernel/drivers/block/
-kernel/drivers/block/paride
Expand Down Expand Up @@ -311,3 +315,14 @@ updates/
-updates/net/sunrpc/
-updates/fs/lockd/
-updates/fs/nfs*

<ppc64le>
# 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/
</ppc64le>
7 changes: 7 additions & 0 deletions live/src/agama-installer.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Feb 24 16:19:03 UTC 2025 - Ladislav Slezák <lslezak@suse.com>

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

Expand Down
4 changes: 2 additions & 2 deletions live/src/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down