From f0c28b391c2ca6d8be4b7b7313042a6b3eb4dc8c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 2 Nov 2010 10:11:04 +0000 Subject: [PATCH] inspect: Add support for MeeGo. --- generator/generator_actions.ml | 4 ++++ inspector/virt-inspector | 2 +- src/guestfs-internal.h | 1 + src/inspect.c | 10 ++++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 49053a3..b33458c 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -795,6 +795,10 @@ Fedora. Gentoo. +=item \"meego\" + +MeeGo. + =item \"pardus\" Pardus. diff --git a/inspector/virt-inspector b/inspector/virt-inspector index 04226b3..9e12dc8 100755 --- a/inspector/virt-inspector +++ b/inspector/virt-inspector @@ -385,7 +385,7 @@ sub output_applications $package_format = "deb"; $package_management = "apt"; } - elsif ($distro eq "fedora") { + elsif ($distro eq "fedora" || $distro eq "meego") { $package_format = "rpm"; $package_management = "yum"; } diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 4f64e9a..ee04948 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -170,6 +170,7 @@ enum inspect_os_distro { OS_DISTRO_ARCHLINUX, OS_DISTRO_GENTOO, OS_DISTRO_UBUNTU, + OS_DISTRO_MEEGO, }; struct inspect_fs { diff --git a/src/inspect.c b/src/inspect.c index 33da144..e7b1e41 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -818,6 +818,15 @@ check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (parse_major_minor (g, fs) == -1) return -1; } + else if (guestfs_exists (g, "/etc/meego-release") > 0) { + fs->distro = OS_DISTRO_MEEGO; + + if (parse_release_file (g, fs, "/etc/meego-release") == -1) + return -1; + + if (parse_major_minor (g, fs) == -1) + return -1; + } skip_release_checks:; @@ -1338,6 +1347,7 @@ guestfs__inspect_get_distro (guestfs_h *g, const char *root) 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_MEEGO: ret = safe_strdup (g, "meego"); 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; -- 1.8.3.1