summaryrefslogtreecommitdiffstats
path: root/src/inspect_fs.c
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2011-10-14 01:05:05 +0200
committerRichard W.M. Jones <rjones@redhat.com>2011-10-14 10:35:17 +0100
commitf25d2300ce0206b3d4ef5e38d0314d86ea20136e (patch)
treed3befcebb874aac60ce4c1e1a992fe2d1d3e6f8a /src/inspect_fs.c
parent8f6eed00da59614184090e56edef6884f187b436 (diff)
downloadlibguestfs-f25d2300ce0206b3d4ef5e38d0314d86ea20136e.tar.gz
libguestfs-f25d2300ce0206b3d4ef5e38d0314d86ea20136e.tar.xz
libguestfs-f25d2300ce0206b3d4ef5e38d0314d86ea20136e.zip
Add basic support for netbsd detection.
Diffstat (limited to 'src/inspect_fs.c')
-rw-r--r--src/inspect_fs.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/inspect_fs.c b/src/inspect_fs.c
index 68e2ddb7..25bb492c 100644
--- a/src/inspect_fs.c
+++ b/src/inspect_fs.c
@@ -190,6 +190,23 @@ check_filesystem (guestfs_h *g, const char *device,
if (guestfs___check_freebsd_root (g, fs) == -1)
return -1;
}
+ else if (is_dir_etc &&
+ is_dir_bin &&
+ 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
+ * that is probably /dev/sda5 (see:
+ * http://www.freebsd.org/doc/handbook/disk-organization.html)
+ */
+ if (match (g, device, re_first_partition))
+ return 0;
+
+ fs->is_root = 1;
+ fs->content = FS_CONTENT_NETBSD_ROOT;
+ fs->format = OS_FORMAT_INSTALLED;
+ if (guestfs___check_netbsd_root (g, fs) == -1)
+ return -1;
+ }
/* Linux root? */
else if (is_dir_etc &&
is_dir_bin &&