fusioninventory-agent icon indicating copy to clipboard operation
fusioninventory-agent copied to clipboard

os name is wrong for amazon linux 2

Open eric-lbn opened this issue 4 years ago • 1 comments

we collect bad os name under amazon linux in order to collect the right os name and version for amazon linux 2 i just add under /FusionInventory/Agent/Task/Inventory/Linux/Distro/NonLSB.pm

[ '/etc/system-release', 'Amazon Linux', 'release ([\d.]+)', '%s' ], in the @distributions array if you want to add it in the next release , it will be great regards eric

eric-lbn avatar Feb 22 '21 05:02 eric-lbn

Hi @eric-lbn it's not accurate enough. Here I'm working on a F33 station, and it still uses this file:

[g-bougard@here fusioninventory-agent]$ cat /etc/system-release
Fedora release 33 (Thirty Three)
[g-bougard@here fusioninventory-agent]$ ls -l /etc/system-release
lrwxrwxrwx 1 root root 14 15 déc.  16:38 /etc/system-release -> fedora-release

I don't want a Fedora OS detected as an Amazon Linux OS. Indeed Amazon Linux should be based on Fedora if I guess right.

Don't you have other 'release' file ? On my Fedora I have this one:

[g-bougard@here fusioninventory-agent]$ ls -l /etc/fedora-release 
lrwxrwxrwx 1 root root 25 15 déc.  16:38 /etc/fedora-release -> ../usr/lib/fedora-release
[g-bougard@here fusioninventory-agent]$ cat /etc/fedora-release
Fedora release 33 (Thirty Three)

So can you report all your /etc/*-release files ?

Indeed you patch could work if we place it after the fedora entry, but I would prefer a more accurate filename. If you don't have one, we will better have to modify the _getDistroData() function to support the Amazon Linux case. And in that case, you'll have to report the exact content of /etc/system-release.

g-bougard avatar Mar 08 '21 09:03 g-bougard