[RFE] support for some kind of fallback tree/media detection
From my patches here: https://www.redhat.com/archives/libosinfo/2019-February/msg00247.html
<tree> elements in the OS DB serve two broad purposes: 1) track public URLs, so apps can easily look up an install URL and associated metadata like relative initrd/kernel paths 2) track <treeinfo> matching data, so users can use guess_os_by_tree with their own URL, and get an OS object back Every <tree> needs an explicit @arch value associated. This makes thoroughly covering case #2 difficult, because it requires enumerating ever supported OS arch in a <tree> block. This is useful to do for OS that have public URLs, because we want to enumerate those anyways. But for distros without public URLs (RHEL), getting coverage for #2 requires adding a bunch of <tree> stubs for each supported @arch for not much gain. Additionally consider Fedora, which has primary architectures (aarch64, armv7hl, x86_64) and secondary architectures like ppc64le. The latter aren't necessarily considered official releases, so it's debatable whether to enumerate their install URLs in the fedora OS entries. However it's still useful to detect the URL as 'fedora', so virt-install attempts with a manually passed URL get proper defaults etc.
The patches are not complete but the problem still needs to be solved. There's value in trying to fill out the db with every valid public URL or ISO regex, but there's value in trying to have more generic matching paths, kinda like we do for -unknown distros, so that some functionality is provided even if it's not 100% perfect. This is also important for virt-install to eventually transition away from its own media detection logic which is much more flexible than what we have in osinfo-db.
The main question is how to implement this in a way that doesn't cause false positives. We probably need some knowledge in the libosinfo code to handle the fallback detection last, either with some explicit fallback= attribute or special handling of an arch='unknown' value. But it needs investigating