From 0094bc09666f03b5c2ab955213dab79b19410cb7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 5 Nov 2012 11:19:19 +0000 Subject: [PATCH] RHEL 7: Ignore /etc/release if /etc/redhat-release exists (RHBZ#873219). If the user has created /etc/release on a RHEL machine, don't mis-detect the OS as NetBSD. --- src/inspect-fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/inspect-fs.c b/src/inspect-fs.c index 0473e92..4ad294b 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -223,7 +223,8 @@ check_filesystem (guestfs_h *g, const char *mountable, else if (is_dir_etc && is_dir_bin && guestfs_is_file (g, "/etc/fstab") > 0 && - guestfs_is_file (g, "/etc/release") > 0) { + guestfs_is_file (g, "/etc/release") > 0 && + guestfs_is_file (g, "/etc/redhat-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) -- 1.8.3.1