summaryrefslogtreecommitdiffstats
path: root/src/inspect.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-10-29 10:53:05 +0100
committerRichard Jones <rjones@redhat.com>2010-10-29 10:58:20 +0100
commit96b44334dd7421b8209f839faccb216a2cb0f773 (patch)
treeb4d1c27449642a8ab8e16fdb23fe2e3308e2f922 /src/inspect.c
parentb4618fb060b40ba70f2be28b1b1ad625722a7edf (diff)
downloadlibguestfs-96b44334dd7421b8209f839faccb216a2cb0f773.tar.gz
libguestfs-96b44334dd7421b8209f839faccb216a2cb0f773.tar.xz
libguestfs-96b44334dd7421b8209f839faccb216a2cb0f773.zip
inspect: Add detection of Gentoo.
Diffstat (limited to 'src/inspect.c')
-rw-r--r--src/inspect.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/inspect.c b/src/inspect.c
index dbb194b9..6e223604 100644
--- a/src/inspect.c
+++ b/src/inspect.c
@@ -738,6 +738,15 @@ check_linux_root (guestfs_h *g, struct inspect_fs *fs)
* determine the actual release or product string.
*/
}
+ else if (guestfs_exists (g, "/etc/gentoo-release") > 0) {
+ fs->distro = OS_DISTRO_GENTOO;
+
+ if (parse_release_file (g, fs, "/etc/gentoo-release") == -1)
+ return -1;
+
+ if (parse_major_minor (g, fs) == -1)
+ return -1;
+ }
/* Determine the architecture. */
const char *binaries[] =
@@ -1255,6 +1264,7 @@ guestfs__inspect_get_distro (guestfs_h *g, const char *root)
case OS_DISTRO_ARCHLINUX: ret = safe_strdup (g, "archlinux"); break;
case OS_DISTRO_DEBIAN: ret = safe_strdup (g, "debian"); break;
case OS_DISTRO_FEDORA: ret = safe_strdup (g, "fedora"); break;
+ case OS_DISTRO_GENTOO: ret = safe_strdup (g, "gentoo"); break;
case OS_DISTRO_PARDUS: ret = safe_strdup (g, "pardus"); break;
case OS_DISTRO_REDHAT_BASED: ret = safe_strdup (g, "redhat-based"); break;
case OS_DISTRO_RHEL: ret = safe_strdup (g, "rhel"); break;