[Libguestfs] [PATCH] inspect: tighten NetBSD detection

Pino Toscano ptoscano at redhat.com
Tue Jun 3 08:14:21 UTC 2014


It seems recent (?) NetBSD versions have their kernel as /netbsd, so
also check for it to detect NetBSD installations.

The current detection so far basically relied on generic files and
directories which can potentially be in every UNIX system, misdetecting
them if a /etc/release file is present in them.
---
 src/inspect-fs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/inspect-fs.c b/src/inspect-fs.c
index c011b5a..21d2a23 100644
--- a/src/inspect-fs.c
+++ b/src/inspect-fs.c
@@ -222,6 +222,7 @@ check_filesystem (guestfs_h *g, const char *mountable,
   }
   else if (is_dir_etc &&
            is_dir_bin &&
+           guestfs_is_file (g, "/netbsd") > 0 &&
            guestfs_is_file (g, "/etc/fstab") > 0 &&
            guestfs_is_file (g, "/etc/release") > 0) {
     /* Ignore /dev/sda1 which is a shadow of the real root filesystem
-- 
1.9.3




More information about the Libguestfs mailing list