summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-11-01 10:35:03 +0000
committerColin Guthrie <colin@mageia.org>2013-11-02 11:47:27 +0000
commit284ba5ab6fc742dd3f7a5a4705207f9b2d4de5be (patch)
tree18eb615cabb1ea6cee90c1ef7b6fe01812c1c0dd /kernel
parent74cc75140329a03e5ed6f952932f8ea937216209 (diff)
downloaddrakx-284ba5ab6fc742dd3f7a5a4705207f9b2d4de5be.tar
drakx-284ba5ab6fc742dd3f7a5a4705207f9b2d4de5be.tar.gz
drakx-284ba5ab6fc742dd3f7a5a4705207f9b2d4de5be.tar.bz2
drakx-284ba5ab6fc742dd3f7a5a4705207f9b2d4de5be.tar.xz
drakx-284ba5ab6fc742dd3f7a5a4705207f9b2d4de5be.zip
images/kernel: Ensure the previously hand-picked modules are included in the new dracut-based initrd.
This removes functions no longer called and adds a new one which will simply list the desired modules and pass them on the dracut command line. This should mean we have the same modules as before (at least) which should mean less regressions. This does increase the size of the initrd back up quite a lot (as expected) so we may want to look at optimising other areas to bring it back down a bit again.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/modules.pl31
1 files changed, 7 insertions, 24 deletions
diff --git a/kernel/modules.pl b/kernel/modules.pl
index b64c92fa2..3b68b4039 100644
--- a/kernel/modules.pl
+++ b/kernel/modules.pl
@@ -41,38 +41,21 @@ sub modules() {
@nls_modules, map { category2modules($_) } split(' ', $images_cat);
}
-sub get_firmwares() {
+sub list_needed_modules {
my ($kern_ver) = @_;
- foreach (all("all.kernels/$kern_ver/modules")) {
- foreach(`/sbin/modinfo -Ffirmware "all.kernels/$kern_ver/modules/$_"`) {
- mkdir_p(dirname("all.kernels/$kern_ver/firmware/$_"));
- eval { cp_af("/lib/firmware/$_", "all.kernels/$kern_ver/firmware/$_"); };
- }
- }
-}
-
-sub remove_unneeded_modules {
- my ($kern_ver) = @_;
-
- load_dependencies("all.kernels/$kern_ver/modules.dep");
+ load_dependencies("/lib/modules/$kern_ver/modules.dep");
my @all = modules();
my @all_with_deps = map { dependencies_closure($_) } @all;
- my %wanted_modules = map { (list_modules::modname2filename($_) . ".ko.xz" => 1) } @all_with_deps;
- foreach (all("all.kernels/$kern_ver/modules")) {
- $wanted_modules{$_} or unlink "all.kernels/$kern_ver/modules/$_";
+ my %wanted_modules = map { (list_modules::modname2filename($_) => 1) } @all_with_deps;
+ foreach (`find /lib/modules/$kern_ver -name '*.ko.?z'`) {
+ my $modfile = basename($_);
+ $modfile =~ s/\.ko\.xz//;
+ $wanted_modules{$modfile} and print "$modfile\n";
}
}
-sub make_modules_per_image {
- my ($kern_ver) = @_;
-
- my $dir = "all.kernels/$kern_ver/modules";
-
- system("cd $dir ; tar cf ../all_modules.tar *.ko.*") == 0 or die "tar failed\n";
-}
-
sub get_main_modules() {
my $base = dirname($0);
my $main = chomp_(cat_("$base/RPMS/.main"));