summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--images/NEWS2
-rwxr-xr-ximages/make_boot_img3
-rw-r--r--kernel/modules.pl31
3 files changed, 11 insertions, 25 deletions
diff --git a/images/NEWS b/images/NEWS
index 11b33e10a..3cf924b06 100644
--- a/images/NEWS
+++ b/images/NEWS
@@ -1,3 +1,5 @@
+- include network modules as specified by kernel/list_modules.pm
+
Version 1.94 - 29 October 2013 by Colin Guthrie
- adapt to a dracut based stage1
diff --git a/images/make_boot_img b/images/make_boot_img
index eb2146fa2..2be5bbde5 100755
--- a/images/make_boot_img
+++ b/images/make_boot_img
@@ -153,6 +153,7 @@ sub initrd {
my $init_binary = $ENV{USE_LOCAL_STAGE1} ? trim(`realpath ../mdk-stage1/init`) : "";
my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)";
my $modules = " network mgainstaller ";
+ my $drivers = `perl ../kernel/modules.pl list_needed_modules $kernel | xargs`;
if ($ENV{DEBUGSTAGE1} || $ENV{BUILD_KA}) {
$modules="$modules busybox ";
@@ -162,7 +163,7 @@ sub initrd {
mkdir_p("build/dracut.conf.d");
touch("build/dracut.conf");
# TODO if --nofscks and --no-hostonly are switched, dracut gives an error - fix or report upstream
- __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf ./build/dracut.conf --confdir ./build/dracut.conf.d --nofscks --no-hostonly --add ' $modules ' --omit ' dash modsign systemd plymouth btrfs crypt lvm cifs resume rootfs-block biosdevname shutdown ' '$img' '$kernel'"
+ __ "DRAKX_STAGE1_BINARY=$stage1_binary DRAKX_INIT_BINARY=$init_binary dracut --conf ./build/dracut.conf --confdir ./build/dracut.conf.d --nofscks --no-hostonly --add ' $modules ' --omit ' dash modsign systemd plymouth btrfs crypt lvm cifs resume rootfs-block biosdevname shutdown ' --add-drivers ' $drivers ' '$img' '$kernel'"
}
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"));