+ check_architecture (g, fs);
+
+ /* We already know /etc/fstab exists because it's part of the test
+ * for Linux root above. We must now parse this file to determine
+ * which filesystems are used by the operating system and how they
+ * are mounted.
+ */
+ if (check_fstab (g, fs) == -1)
+ return -1;
+
+ return 0;
+}
+
+/* The currently mounted device is known to be a FreeBSD root. */
+static int
+check_freebsd_root (guestfs_h *g, struct inspect_fs *fs)
+{
+ int r;
+
+ fs->type = OS_TYPE_FREEBSD;
+
+ /* FreeBSD has no authoritative version file. The version number is
+ * in /etc/motd, which the system administrator might edit, but
+ * we'll use that anyway.
+ */
+
+ if (guestfs_exists (g, "/etc/motd") > 0) {
+ if (parse_release_file (g, fs, "/etc/motd") == -1)
+ return -1;
+
+ if (parse_major_minor (g, fs) == -1)
+ return -1;
+ }
+
+ /* Determine the architecture. */
+ check_architecture (g, fs);
+
+ /* We already know /etc/fstab exists because it's part of the test above. */
+ if (check_fstab (g, fs) == -1)
+ return -1;
+
+ return 0;
+}
+
+static void
+check_architecture (guestfs_h *g, struct inspect_fs *fs)
+{