added better gentoo/funtoo support
Merge pull request #6237 from bcoca/genfuntoo

added better gentoo/funtoo support