- $xml->endTag("filesystem");
- }
- $xml->endTag("filesystems");
-
- if (exists $os->{modprobe_aliases}) {
- my %aliases = %{$os->{modprobe_aliases}};
- my @keys = sort keys %aliases;
- if (@keys) {
- $xml->startTag("modprobealiases");
- foreach (@keys) {
- $xml->startTag("alias", "device" => $_);
-
- foreach my $field ( [ "modulename" => "modulename" ],
- [ "augeas" => "augeas" ],
- [ "file" => "file" ] ) {
- $xml->dataElement($field->[0], $aliases{$_}->{$field->[1]});
- }
-
- $xml->endTag("alias");
- }
- $xml->endTag("modprobealiases");
- }
- }
-
- if (exists $os->{initrd_modules}) {
- my %modvers = %{$os->{initrd_modules}};
- my @keys = sort keys %modvers;
- if (@keys) {
- $xml->startTag("initrds");
- foreach (@keys) {
- my @modules = @{$modvers{$_}};
- $xml->startTag("initrd", "version" => $_);
- $xml->dataElement("module", $_) foreach @modules;
- $xml->endTag("initrd");
- }
- $xml->endTag("initrds");
- }
- }
-
- $xml->startTag("applications");
- my @apps = @{$os->{apps}};
- foreach (@apps) {
- $xml->startTag("application");
- $xml->dataElement("name", $_->{name});
- $xml->dataElement("epoch", $_->{epoch}) if defined $_->{epoch};
- $xml->dataElement("version", $_->{version});
- $xml->dataElement("release", $_->{release});
- $xml->dataElement("arch", $_->{arch});
- $xml->endTag("application");
- }
- $xml->endTag("applications");
-
- if(defined($os->{boot}) && defined($os->{boot}->{configs})) {
- my $default = $os->{boot}->{default};
- my $configs = $os->{boot}->{configs};
-
- $xml->startTag("boot");
- for(my $i = 0; $i < scalar(@$configs); $i++) {
- my $config = $configs->[$i];
-
- my @attrs = ();
- push(@attrs, ("default" => 1)) if($default == $i);
- $xml->startTag("config", @attrs);
- $xml->dataElement("title", $config->{title});
- $xml->dataElement("kernel", $config->{kernel}->{version})
- if(defined($config->{kernel}));
- $xml->dataElement("cmdline", $config->{cmdline})
- if(defined($config->{cmdline}));
- $xml->endTag("config");
- }
- $xml->endTag("boot");
- }
-
- if ($os->{kernels}) {
- $xml->startTag("kernels");
- my @kernels = @{$os->{kernels}};
- foreach (@kernels) {
- $xml->startTag("kernel",
- "version" => $_->{version},
- "arch" => $_->{arch});
- $xml->startTag("modules");
- my @modules = @{$_->{modules}};
- foreach (@modules) {
- $xml->dataElement("module", $_);
- }
- $xml->endTag("modules");
- $xml->dataElement("path", $_->{path}) if(defined($_->{path}));
- $xml->dataElement("package", $_->{package}) if(defined($_->{package}));
- $xml->endTag("kernel");
- }
- $xml->endTag("kernels");
- }
-
- if (exists $os->{root}->{registry}) {
- $xml->startTag("windowsregistryentries");
- # These are just lumps of text - dump them out.
- foreach (@{$os->{root}->{registry}}) {
- $xml->dataElement("windowsregistryentry", $_);
- }
- $xml->endTag("windowsregistryentries");
- }