local $_;
my $r = shift;
- # XXX Windows version.
- # List of applications.
+ # Windows version?
}
sub check_grub
local $_;
my $r = shift;
- # XXX Kernel versions, grub version.
+ # Grub version, if we care.
}
#print Dumper (\%fses);
local $_;
my $root_dev = shift;
- # XXX
+ my @kernels;
+
+ my $os = $oses{$root_dev}->{os};
+ if ($os eq "linux") {
+ # Installed kernels will have a corresponding /lib/modules/<version>
+ # directory, which is the easiest way to find out what kernels
+ # are installed, and what modules are available.
+ foreach ($g->ls ("/lib/modules")) {
+ if ($g->is_dir ("/lib/modules/$_")) {
+ my %kernel;
+ $kernel{version} = $_;
+
+
+ # XXX List modules.
+
+
+
+
+
+
+ push @kernels, \%kernel;
+ }
+ }
+
+ } elsif ($os eq "windows") {
+ # XXX
+ }
+
+ $oses{$root_dev}->{kernels} = \@kernels;
}
#----------------------------------------------------------------------
print " $_->{name} $_->{version}\n"
}
- # XXX Kernel.
+ print " Kernels:\n";
+ my @kernels = @{$os->{kernels}};
+ foreach (@kernels) {
+ print " $_->{version}\n"
+
+
+
+ }
}
sub output_xml
}
print "</applications>\n";
- # XXX Kernel.
+ print "<kernels>\n";
+ my @kernels = @{$os->{kernels}};
+ foreach (@kernels) {
+ print "<kernel>\n";
+ print "<version>$_->{version}</version>\n";
+
+
+
+
+
+
+ print "</kernel>\n";
+ }
+ print "</kernels>\n";
print "</operatingsystem>\n";
}