From: Richard W.M. Jones Date: Fri, 16 Sep 2011 14:21:26 +0000 (+0100) Subject: inspection: Add support for ttylinux (a minimal Linux). X-Git-Tag: 1.13.13~3 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=b648b1813fc8e55db790435b5414d9be3ec765d2;p=libguestfs.git inspection: Add support for ttylinux (a minimal Linux). --- diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 49963bc..c3d74f5 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -830,6 +830,10 @@ Scientific Linux. Slackware. +=item \"ttylinux\" + +ttylinux. + =item \"ubuntu\" Ubuntu. diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 79d8990..c0a2be4 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -251,6 +251,7 @@ enum inspect_os_distro { OS_DISTRO_SLACKWARE, OS_DISTRO_CENTOS, OS_DISTRO_SCIENTIFIC_LINUX, + OS_DISTRO_TTYLINUX, }; enum inspect_os_package_format { diff --git a/src/inspect.c b/src/inspect.c index c51804d..f3e2186 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -204,6 +204,7 @@ guestfs__inspect_get_distro (guestfs_h *g, const char *root) case OS_DISTRO_RHEL: ret = safe_strdup (g, "rhel"); break; case OS_DISTRO_SCIENTIFIC_LINUX: ret = safe_strdup (g, "scientificlinux"); break; case OS_DISTRO_SLACKWARE: ret = safe_strdup (g, "slackware"); break; + case OS_DISTRO_TTYLINUX: ret = safe_strdup (g, "ttylinux"); break; case OS_DISTRO_WINDOWS: ret = safe_strdup (g, "windows"); break; case OS_DISTRO_UBUNTU: ret = safe_strdup (g, "ubuntu"); break; case OS_DISTRO_UNKNOWN: default: ret = safe_strdup (g, "unknown"); break; diff --git a/src/inspect_fs.c b/src/inspect_fs.c index 3f7be0e..e317e46 100644 --- a/src/inspect_fs.c +++ b/src/inspect_fs.c @@ -384,6 +384,7 @@ check_package_format (guestfs_h *g, struct inspect_fs *fs) break; case OS_DISTRO_SLACKWARE: + case OS_DISTRO_TTYLINUX: case OS_DISTRO_WINDOWS: case OS_DISTRO_UNKNOWN: default: @@ -431,6 +432,7 @@ check_package_management (guestfs_h *g, struct inspect_fs *fs) break; case OS_DISTRO_SLACKWARE: + case OS_DISTRO_TTYLINUX: case OS_DISTRO_WINDOWS: case OS_DISTRO_UNKNOWN: default: diff --git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c index b8be049..4270712 100644 --- a/src/inspect_fs_unix.c +++ b/src/inspect_fs_unix.c @@ -404,6 +404,16 @@ guestfs___check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (guestfs___parse_major_minor (g, fs) == -1) return -1; } + else if (guestfs_exists (g, "/etc/ttylinux-target") > 0) { + fs->distro = OS_DISTRO_TTYLINUX; + + fs->product_name = guestfs___first_line_of_file (g, "/etc/ttylinux-target"); + if (fs->product_name == NULL) + return -1; + + if (guestfs___parse_major_minor (g, fs) == -1) + return -1; + } skip_release_checks:; diff --git a/src/inspect_icon.c b/src/inspect_icon.c index ad0f62c..d9e2ee9 100644 --- a/src/inspect_icon.c +++ b/src/inspect_icon.c @@ -134,6 +134,7 @@ guestfs__inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r, case OS_DISTRO_MEEGO: case OS_DISTRO_PARDUS: case OS_DISTRO_SLACKWARE: + case OS_DISTRO_TTYLINUX: case OS_DISTRO_UBUNTU: case OS_DISTRO_WINDOWS: case OS_DISTRO_UNKNOWN: