Daniel P. Berrangé
2018-Feb-07 17:56 UTC
[Libguestfs] [PATCH v2] daemon: add inspector support for MS-DOS distro
An installation of MS-DOS has various files in a /DOS directory, which COMMAND.COM looking like a reasonable signal that its MS-DOS or a very close relative there-of. This is validated with an MS-DOS 6.22 install. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- daemon/inspect_fs.ml | 14 ++++++++++++++ daemon/inspect_types.ml | 2 ++ daemon/inspect_types.mli | 1 + generator/actions_inspection.ml | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/daemon/inspect_fs.ml b/daemon/inspect_fs.ml index 13ed127cd..a20de6761 100644 --- a/daemon/inspect_fs.ml +++ b/daemon/inspect_fs.ml @@ -220,6 +220,18 @@ and check_filesystem mountable *) data.arch <- Some "i386" ) + (* MS-DOS *) + else if is_dir_nocase "/DOS" && + is_file_nocase "/DOS/COMMAND.COM" then ( + debug_matching "MS-DOS"; + role := `Root; + data.os_type <- Some OS_TYPE_DOS; + data.distro <- Some DISTRO_MSDOS; + (* MS-DOS is a mix of 16 and 32 bit, but + * assume it requires a 32 bit i386 processor. + *) + data.arch <- Some "i386" + ) (* None of the above. *) else ( debug_matching "no known OS partition" @@ -282,6 +294,7 @@ and check_package_format { distro } | Some DISTRO_FREEBSD | Some DISTRO_FREEDOS | Some DISTRO_FRUGALWARE + | Some DISTRO_MSDOS | Some DISTRO_NETBSD | Some DISTRO_OPENBSD | Some DISTRO_PLD_LINUX @@ -365,6 +378,7 @@ and check_package_management { distro; version } | Some DISTRO_FREEBSD | Some DISTRO_FREEDOS | Some DISTRO_FRUGALWARE + | Some DISTRO_MSDOS | Some DISTRO_NETBSD | Some DISTRO_OPENBSD | Some DISTRO_PLD_LINUX diff --git a/daemon/inspect_types.ml b/daemon/inspect_types.ml index 473939a67..464b8c2a6 100644 --- a/daemon/inspect_types.ml +++ b/daemon/inspect_types.ml @@ -82,6 +82,7 @@ and distro | DISTRO_MAGEIA | DISTRO_MANDRIVA | DISTRO_MEEGO + | DISTRO_MSDOS | DISTRO_NEOKYLIN | DISTRO_NETBSD | DISTRO_OPENBSD @@ -211,6 +212,7 @@ and string_of_distro = function | DISTRO_MAGEIA -> "mageia" | DISTRO_MANDRIVA -> "mandriva" | DISTRO_MEEGO -> "meego" + | DISTRO_MSDOS -> "msdos" | DISTRO_NEOKYLIN -> "neokylin" | DISTRO_NETBSD -> "netbsd" | DISTRO_OPENBSD -> "openbsd" diff --git a/daemon/inspect_types.mli b/daemon/inspect_types.mli index 6d75e5825..78051b510 100644 --- a/daemon/inspect_types.mli +++ b/daemon/inspect_types.mli @@ -89,6 +89,7 @@ and distro | DISTRO_MAGEIA | DISTRO_MANDRIVA | DISTRO_MEEGO + | DISTRO_MSDOS | DISTRO_NEOKYLIN | DISTRO_NETBSD | DISTRO_OPENBSD diff --git a/generator/actions_inspection.ml b/generator/actions_inspection.ml index d422b6088..0ac282435 100644 --- a/generator/actions_inspection.ml +++ b/generator/actions_inspection.ml @@ -226,6 +226,10 @@ Mandriva. MeeGo. +=item \"msdos\" + +Microsoft DOS. + =item \"neokylin\" NeoKylin. -- 2.14.3
Richard W.M. Jones
2018-Feb-07 18:15 UTC
Re: [Libguestfs] [PATCH v2] daemon: add inspector support for MS-DOS distro
I will push this shortly, thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Reasonably Related Threads
- [PATCH] daemon: add inspector support for MS-DOS distro
- [PATCH] daemon: inspection: Add support for NeoKylin (RHBZ#1476081).
- [PATCH v12 08/11] daemon: Implement inspection types and utility functions.
- [PATCH] inspect: recognize the Kali Linux distribution (RHBZ#1544227)
- [PATCH v12 09/11] daemon: Implement inspection of Linux and other Unix-like operating systems.