--- a/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/LSB.pm +++ b/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/LSB.pm @@ -10,12 +10,33 @@ foreach (`lsb_release -d`) { $release = $1 if /Description:\s+(.+)/; } + +#Check for dual boot system + my $grubfile = '/boot/grub/grub.cfg'; + + open FILE,'<',$grubfile; + my $count=0; + my $win_versions=''; + while (my $line = ){ + my $pattern='^[^#]+?(windows [^ ]+).*?(/dev[^ )]+)'; + + if ($line =~ /$pattern/iog){ + $count=$count+1; + $win_versions=$win_versions." [ $1 @ $2 ]"; + } + } + close FILE; + if ($count > 0){ + $release = $release . '|DUALBOOT'; + } +#End check + my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => $release, - OSCOMMENTS => "$OSComment" + OSCOMMENTS => "$OSComment"."$win_versions" }); }