search for: guestfs_int_check_linux_root

Displaying 20 results from an estimated 32 matches for "guestfs_int_check_linux_root".

2015 May 29
1
[PATCH] inspection: fix CentOS 7 detection
...tc/centos-release. --- src/inspect-fs-unix.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index 2abbf24..f0fe141 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -345,8 +345,8 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) goto skip_release_checks; } - /* Oracle Linux includes a "/etc/redhat-release" file, hence the Oracle check - * needs to be performed before the Red-Hat one. + /* RHEL-based distros include a "/etc/redhat-release" file, hence...
2016 Dec 06
3
[PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
For example, converts "///usr//local//" -> "/usr/local". --- src/inspect-fs-unix.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index a1a757c..0fea9c8 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -89,6 +89,7 @@ static char *resolve_fstab_device
2016 Feb 24
2
[PATCH] inspect: check also /etc/hosts for detecting Linux root (RHBZ#1203898)
...;) > 0)) && - guestfs_is_file (g, "/etc/fstab") > 0) { + (guestfs_is_file (g, "/etc/fstab") > 0 || + guestfs_is_file (g, "/etc/hosts") > 0)) { fs->is_root = 1; fs->format = OS_FORMAT_INSTALLED; if (guestfs_int_check_linux_root (g, fs) == -1) -- 2.5.0
2016 Dec 06
0
[PATCH 5/5] inspect: gather info from /usr filesystems as well (RHBZ#1401474)
...etions(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index d10191d..fbbfb90 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -864,6 +864,7 @@ extern void guestfs_int_merge_fs_inspections (guestfs_h *g, struct inspect_fs *d /* inspect-fs-unix.c */ extern int guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs); +extern int guestfs_int_check_linux_usr (guestfs_h *g, struct inspect_fs *fs); extern int guestfs_int_check_freebsd_root (guestfs_h *g, struct inspect_fs *fs); extern int guestfs_int_check_netbsd_root (guestfs_h *g, struct inspect_fs *fs); extern int guestf...
2016 May 18
0
[PATCH 2/2] inspect: switch to version struct for os major/minor version
...); - if (fs->major_version == -1 || fs->minor_version == -1) - goto out; - } + if (guestfs_int_version_from_x_y_re (g, &fs->version, lines[1], + re_opensuse_version) == -1) + goto out; } r = 0; @@ -509,22 +477,22 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (match2 (g, fs->product_name, re_oracle_linux_old, &major, &minor) || match2 (g, fs->product_name, re_oracle_linux, &major, &minor)) { - fs->major_version = guestfs_int_parse_unsigned_int (g, major); + fs-&g...
2015 Sep 08
1
[PATCH] inspect: recognize the Frugalware distribution
...(?:\\.(\\d+)(?:[\\.\\d]+)?)?)\\s+\\((?:[^)]+)\\)$", 0) +COMPILE_REGEXP (re_frugalware, "Frugalware (\\d+)\\.(\\d+)", 0) static void check_architecture (guestfs_h *g, struct inspect_fs *fs); static int check_hostname_unix (guestfs_h *g, struct inspect_fs *fs); @@ -632,6 +633,26 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (guestfs_int_parse_major_minor (g, fs) == -1) return -1; } + else if (guestfs_is_file_opts (g, "/etc/frugalware-release", + GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) { + fs->distro = O...
2016 Dec 07
3
[PATCH v2 0/2] Improve inspection of /usr filesystems
Hi, this patch series improves the way /usr filesystems are handled: tag them appropriately, so later on we can find them and merge results they contain directly back for the root filesystem. Changes in v2: - removed patches #1 and #2, already pushed - drop patch #3, no more needed - replace patch #4 with a better suggestion from Rich - change if into assert in patch #5 Thanks, Pino Toscano
2015 Jun 02
1
[PATCH 2/3] inspection: Add support for CoreOS
...i], "DISTRIB_ID=CoreOS")) { + fs->distro = OS_DISTRO_COREOS; + r = 1; + } else if (STRPREFIX (lines[i], "DISTRIB_RELEASE=")) { char *major, *minor; if (match2 (g, &lines[i][16], re_major_minor, &major, &minor)) { @@ -338,7 +348,7 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (guestfs_is_file_opts (g, "/etc/lsb-release", GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) { - r = parse_lsb_release (g, fs); + r = parse_lsb_release (g, fs, "/etc/lsb-release"); if (r =...
2015 May 29
2
[PATCH 2/3] inspection: Add support for CoreOS
...i], "DISTRIB_ID=CoreOS")) { + fs->distro = OS_DISTRO_COREOS; + r = 1; + } else if (STRPREFIX (lines[i], "DISTRIB_RELEASE=")) { char *major, *minor; if (match2 (g, &lines[i][16], re_major_minor, &major, &minor)) { @@ -338,7 +348,7 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (guestfs_is_file_opts (g, "/etc/lsb-release", GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) { - r = parse_lsb_release (g, fs); + r = parse_lsb_release (g, fs, "/etc/lsb-release"); if (r =...
2016 May 17
3
[PATCH 0/2] src: introduce an helper version struct
Hi, this adds an helper version struct, and uses it in the backends (for the libvirt and qemu versions) and inspection code. This also moves common code to that, so it is not repeated in many places. This should help with the small refactoring proposed with https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html Thanks, Pino Toscano (2): src: start unifying version handling
2016 May 18
3
[PATCH v2 0/2] src: introduce an helper version struct
Hi, this adds an helper version struct, and uses it in the backends (for the libvirt and qemu versions) and inspection code. This also moves common code to that, so it is not repeated in many places. This should help with the small refactoring proposed with https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html Thanks, Pino Toscano (2): src: start unifying version handling
2016 Feb 24
0
Re: [PATCH] inspect: check also /etc/hosts for detecting Linux root (RHBZ#1203898)
...t; 0)) { /etc/hosts could be present on any UNIX pretty much (so could /etc/fstab for that matter). If you want Linux then how about /lib/ld-linux.so.2 which exists on any Linux with ELF library support. > fs->is_root = 1; > fs->format = OS_FORMAT_INSTALLED; > if (guestfs_int_check_linux_root (g, fs) == -1) Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org...
2016 May 05
0
[PATCH v2] inspect: check also /etc/hosts for detecting Linux root (RHBZ#1203898)
...t;) > 0) && - guestfs_is_file (g, "/etc/fstab") > 0) { + (guestfs_is_file (g, "/etc/fstab") > 0 || + guestfs_is_file (g, "/etc/hosts") > 0)) { fs->is_root = 1; fs->format = OS_FORMAT_INSTALLED; if (guestfs_int_check_linux_root (g, fs) == -1) -- 2.5.5
2015 Mar 16
0
[PATCH] inspection: add support for systemd .mount files
...fs_h *, struct inspect_fs *, const char *)); +static int check_systemd_mounts (guestfs_h *g, struct inspect_fs *fs); +static int check_systemd_mnt (guestfs_h *g, struct inspect_fs *fs, const char *path); /* Hash structure for uuid->path lookups */ typedef struct md_uuid { @@ -582,6 +585,9 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) if (check_hostname_unix (g, fs) == -1) return -1; + if (check_systemd_mounts (g, fs) == -1) + return -1; + return 0; } @@ -981,6 +987,180 @@ check_hostname_freebsd (guestfs_h *g, struct inspect_fs *fs) } static int +check_systemd_mnt (gu...
2015 Mar 16
2
[PATCH] RFE: Inspection should support systemd mount units
Adds support for systemd .mount files, uses Augeas to extract mount points. Fixes RHBZ#1113153. Maros Zatko (1): inspection: add support for systemd .mount files src/inspect-fs-unix.c | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) -- 1.9.3
2016 Dec 06
9
[PATCH 0/5] Improve inspection of /usr filesystems
Hi, this patch series improves the way /usr filesystems are handled: tag them appropriately, so later on we can find them and merge results they contain directly back for the root filesystem. The series includes also a new private debug API, and its usage to fix the resolution of /dev/mapper/.. devices found in fstab; without it, LVM /usr filesystems are not recognized as belonging to their
2015 Jun 02
1
[PATCH 1/3] inspection: Add func for merging fs inspections
...t_check_package_format (guestfs_h *g, struct inspect_fs *fs); extern void guestfs_int_check_package_management (guestfs_h *g, struct inspect_fs *fs); +extern void guestfs_int_merge_fs_inspections (guestfs_h *g, struct inspect_fs *dst, struct inspect_fs *src); /* inspect-fs-unix.c */ extern int guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs); diff --git a/src/inspect-fs.c b/src/inspect-fs.c index 932e5e7..a2913d6 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -655,3 +655,105 @@ guestfs_int_first_egrep_of_file (guestfs_h *g, const char *filename, return 1; } + +/* Merge the missing OS...
2015 Sep 09
2
[PATCH] inspect: try to use /etc/os-release on Linux guests
...LL; + fs->major_version = major_version; + fs->minor_version = minor_version; + + return 1; +} + /* Ubuntu has /etc/lsb-release containing: * DISTRIB_ID=Ubuntu # Distro * DISTRIB_RELEASE=10.04 # Version @@ -348,6 +482,15 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) fs->type = OS_TYPE_LINUX; + if (guestfs_is_file_opts (g, "/etc/os-release", + GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) { + r = parse_os_release (g, fs, "/etc/os-release"); + if (r == -1)...
2015 Aug 25
2
[PATCH 1/2] inspect: recognize the ALT Linux distribution
...s)d([0-9])([a-z])$", 0) +COMPILE_REGEXP (re_altlinux, " (?:(\\d+)(?:\\.(\\d+)(?:[\\.\\d]+)?)?)\\s+\\((?:[^)]+)\\)$", 0) static void check_architecture (guestfs_h *g, struct inspect_fs *fs); static int check_hostname_unix (guestfs_h *g, struct inspect_fs *fs); @@ -414,6 +415,26 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs) fs->minor_version = 0; } } + else if (guestfs_is_file_opts (g, "/etc/altlinux-release", + GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) { + fs->distro = OS_DISTRO_ALTLINUX; + + if (pars...
2015 May 29
2
[PATCH 1/3] inspection: Add func for merging fs inspections
...nt_check_package_format (guestfs_h *g, struct inspect_fs *fs); extern void guestfs_int_check_package_management (guestfs_h *g, struct inspect_fs *fs); +extern int guestfs_int_merge_fs_inspections (guestfs_h *g, struct inspect_fs *dst, struct inspect_fs *src); /* inspect-fs-unix.c */ extern int guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs); diff --git a/src/inspect-fs.c b/src/inspect-fs.c index 932e5e7..5f55f1d 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -655,3 +655,118 @@ guestfs_int_first_egrep_of_file (guestfs_h *g, const char *filename, return 1; } + +/* Merge the missing OS...