Brian,

with the current UYOK implementation may happen that a kernel module is
not loaded on the golden client, but this module is needed for the
installation. For example on SuSE the af_packet (to manage raw packet
sockets) may be not loaded, but it's needed by dhcp during the installation.

At the moment I don't see other modules (in general all the modules
needed during the installation should be loaded in the golden client),
but it should be good to hard-code a list of these needed modules inside
the UYOK script.

To resolve I propose the attached patch. What do you think?

Cheers,
-Andrea
Index: lib/SystemImager/UseYourOwnKernel.pm
===================================================================
--- lib/SystemImager/UseYourOwnKernel.pm	(revision 3554)
+++ lib/SystemImager/UseYourOwnKernel.pm	(working copy)
@@ -435,7 +435,9 @@
 sub get_load_ordered_list_of_running_modules() {
 
         my $file = "/proc/modules";
+        my @mandatory_modules = ('af_packet');
         my @modules;
+
         open(MODULES,"<$file") or die("Couldn't open $file for reading.");
         while(<MODULES>) {
                 my ($module) = split;
@@ -448,6 +450,30 @@
         }
         close(MODULES);
 
+        # add not-loaded modules mandatory for the installation environment
+        foreach my $module (@mandatory_modules) {
+                chomp(my $module_file = `modinfo -F filename $module 2>/dev/null`);
+                if ($?) {
+                        print STDERR qq(WARNING: Couldn't find module "$module", assuming it's built into the kernel.\n);
+                        next;
+                }
+                push (@modules, $module_file);
+                # add module dependencies
+                chomp(my @deps = split(/,/, `modinfo -F depends $module 2>/dev/null`));
+                foreach (@deps) {
+                    next unless ($_);
+                    chomp(my $module_file = `modinfo -F filename $_ 2>/dev/null`);
+                    if ($?) {
+                        print STDERR qq(WARNING: Couldn't find module "$_", assuming it's built into the kernel.\n);
+                        next;
+                    }
+                    push (@modules, $module_file);
+                }
+        }
+        # remove duplicate modules
+        my %seen = ();
+        @modules = grep { ! $seen{$_} ++ } @modules;
+
         # reverse order list of running modules
         @modules = reverse(@modules);
 

Reply via email to