[Libosinfo] [osinfo-db/libosinfo PATCH 0/6] Add support to images
Daniel P. Berrangé
berrange at redhat.com
Thu Nov 1 11:12:45 UTC 2018
On Thu, Nov 01, 2018 at 11:06:11AM +0000, Richard W.M. Jones wrote:
> On Thu, Nov 01, 2018 at 10:09:03AM +0000, Daniel P. Berrangé wrote:
> > ie essentially encode the file content probing rules that libguestfs
> > has, as osinfo DB information, so that it becomes user extendable in
> > the normal way we do for ISO/install tree. Admittedly the image probing
> > rules are significantly more complicated than ISO/install tree probiing
> > rules, but I think it is doable if we wanted to. It ultimately just
> > comes down to a (very large) set of file content matches.
>
> It's rather more complicated than that. It's definitely not true to
> say that libguestfs is just doing some regexps over files.
I've not looked at all the OS match rules libguestfs has, but for the
Linux matches, it looks like just file existance/content matches
I'm looking at "check_filesystem" which has a bunch of logic like:
(* Minix root? *)
else if Is.is_dir "/etc" &&
Is.is_dir "/bin" &&
Is.is_file "/service/vm" &&
Is.is_file "/etc/fstab" &&
Is.is_file "/etc/version" then (
debug_matching "Minix root";
role := `Root;
Inspect_fs_unix.check_minix_root data;
)
(* Linux root? *)
else if Is.is_dir "/etc" &&
(Is.is_dir "/bin" ||
is_symlink_to "/bin" "usr/bin") &&
(Is.is_file "/etc/fstab" ||
Is.is_file "/etc/hosts") then (
debug_matching "Linux root";
role := `Root;
Inspect_fs_unix.check_linux_root mountable data;
)
(* CoreOS root? *)
else if Is.is_dir "/etc" &&
Is.is_dir "/root" &&
Is.is_dir "/home" &&
Is.is_dir "/usr" &&
Is.is_file "/etc/coreos/update.conf" then (
debug_matching "CoreOS root";
role := `Root;
Inspect_fs_unix.check_coreos_root mountable data;
)
And then looking at check_linux_root just iterates over the
filename content regex matches defined in linux_root_tests.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the Libosinfo
mailing list