Displaying 20 results from an estimated 83 matches for "guestfs_is_file".
2013 Nov 28
3
Re: [PATCH 3/3] inspect: improve detection of FreeBSD install discs
...d similar versions.
> *
> * NB: txtsetup file contains Windows \r\n line endings, which guestfs_grep
> @@ -430,7 +440,8 @@ guestfs___check_installer_root (guestfs_h *g, struct inspect_fs *fs)
> * need to unpack this and look inside to tell the difference.
> */
> if (guestfs_is_file (g, "/casper/filesystem.squashfs") > 0 ||
> - guestfs_is_file (g, "/live/filesystem.squashfs") > 0)
> + guestfs_is_file (g, "/live/filesystem.squashfs") > 0 ||
> + guestfs_is_file (g, "/mfsroot.gz") > 0)
> fs->is...
2013 Nov 28
3
[PATCH 1/3] inspect: recognise Debian live images as such
...a6f 100644
--- a/src/inspect-fs-cd.c
+++ b/src/inspect-fs-cd.c
@@ -429,7 +429,8 @@ guestfs___check_installer_root (guestfs_h *g, struct inspect_fs *fs)
* Fedora live CDs which contain the same, but larger file). We
* need to unpack this and look inside to tell the difference.
*/
- if (guestfs_is_file (g, "/casper/filesystem.squashfs") > 0)
+ if (guestfs_is_file (g, "/casper/filesystem.squashfs") > 0 ||
+ guestfs_is_file (g, "/live/filesystem.squashfs") > 0)
fs->is_live_disk = 1;
/* Debian/Ubuntu. */
--
1.8.3.1
2013 Nov 28
0
[PATCH 3/3] inspect: improve detection of FreeBSD install discs
...rn 0;
+}
+
/* Windows 2003 and similar versions.
*
* NB: txtsetup file contains Windows \r\n line endings, which guestfs_grep
@@ -430,7 +440,8 @@ guestfs___check_installer_root (guestfs_h *g, struct inspect_fs *fs)
* need to unpack this and look inside to tell the difference.
*/
if (guestfs_is_file (g, "/casper/filesystem.squashfs") > 0 ||
- guestfs_is_file (g, "/live/filesystem.squashfs") > 0)
+ guestfs_is_file (g, "/live/filesystem.squashfs") > 0 ||
+ guestfs_is_file (g, "/mfsroot.gz") > 0)
fs->is_live_disk = 1;...
2013 Nov 28
0
[PATCH 3/3, v2] inspect: improve detection of FreeBSD install discs
...-git a/src/inspect-fs-cd.c b/src/inspect-fs-cd.c
index eaeaa6f..45d7bb5 100644
--- a/src/inspect-fs-cd.c
+++ b/src/inspect-fs-cd.c
@@ -430,7 +430,8 @@ guestfs___check_installer_root (guestfs_h *g, struct inspect_fs *fs)
* need to unpack this and look inside to tell the difference.
*/
if (guestfs_is_file (g, "/casper/filesystem.squashfs") > 0 ||
- guestfs_is_file (g, "/live/filesystem.squashfs") > 0)
+ guestfs_is_file (g, "/live/filesystem.squashfs") > 0 ||
+ guestfs_is_file (g, "/mfsroot.gz") > 0)
fs->is_live_disk = 1;...
2016 Feb 24
2
[PATCH] inspect: check also /etc/hosts for detecting Linux root (RHBZ#1203898)
...c/inspect-fs.c
+++ b/src/inspect-fs.c
@@ -217,7 +217,8 @@ check_filesystem (guestfs_h *g, const char *mountable,
(is_dir_bin ||
(guestfs_is_symlink (g, "/bin") > 0 &&
guestfs_is_dir (g, "/usr/bin") > 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....
2013 Jun 14
3
[PATCH 0/2] Fix inspection of Fedora guests (RHBZ#974489).
Here is a preliminary fix for this bug.
I'm running the test suite on this now.
Rich.
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
2014 Dec 02
0
[PATCH 2/5] inspect_os: Add support for detecting OpenBSD
...ostname_unix (guestfs_h *g, struct inspect_fs *fs);
@@ -659,6 +662,55 @@ guestfs___check_netbsd_root (guestfs_h *g, struct inspect_fs *fs)
return 0;
}
+/* The currently mounted device may be an OpenBSD root. */
+int
+guestfs___check_openbsd_root (guestfs_h *g, struct inspect_fs *fs)
+{
+ if (guestfs_is_file_opts (g, "/etc/motd",
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) {
+ CLEANUP_FREE char *major = NULL, *minor = NULL;
+
+ /* The first line of this file gets automatically updated at boot. */
+ if (parse_release_file (g, fs, "/etc/motd&qu...
2014 Dec 03
1
[PATCH 1/4] inspect_os: Add support for detecting OpenBSD
...ostname_unix (guestfs_h *g, struct inspect_fs *fs);
@@ -659,6 +662,55 @@ guestfs___check_netbsd_root (guestfs_h *g, struct inspect_fs *fs)
return 0;
}
+/* The currently mounted device may be an OpenBSD root. */
+int
+guestfs___check_openbsd_root (guestfs_h *g, struct inspect_fs *fs)
+{
+ if (guestfs_is_file_opts (g, "/etc/motd",
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) {
+ CLEANUP_FREE char *major = NULL, *minor = NULL;
+
+ /* The first line of this file gets automatically updated at boot. */
+ if (parse_release_file (g, fs, "/etc/motd&qu...
2014 Nov 27
2
[PATCH 1/1] inspect: Fix a bug in the *BSD root detection
...ry->format = OS_FORMAT_UNKNOWN;
+ return;
+ }
+ }
+}
+
/* Find out if 'device' contains a filesystem. If it does, add
* another entry in g->fses.
*/
@@ -207,14 +240,6 @@ check_filesystem (guestfs_h *g, const char *mountable,
is_dir_bin &&
guestfs_is_file (g, "/etc/freebsd-update.conf") > 0 &&
guestfs_is_file (g, "/etc/fstab") > 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...
2014 Sep 22
1
[PATCH] inspect: basic Minix support
...inspect_fs *fs);
@@ -782,6 +785,48 @@ guestfs___check_hurd_root (guestfs_h *g, struct inspect_fs *fs)
return 0;
}
+/* The currently mounted device is maybe to be a Minix root. */
+int
+guestfs___check_minix_root (guestfs_h *g, struct inspect_fs *fs)
+{
+ fs->type = OS_TYPE_MINIX;
+
+ if (guestfs_is_file_opts (g, "/etc/version",
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) {
+ char *major, *minor;
+ if (parse_release_file (g, fs, "/etc/version") == -1)
+ return -1;
+
+ if (match2 (g, fs->product_name, re_minix, &major, &am...
2016 Feb 24
0
Re: [PATCH] inspect: check also /etc/hosts for detecting Linux root (RHBZ#1203898)
...inspect-fs.c
> @@ -217,7 +217,8 @@ check_filesystem (guestfs_h *g, const char *mountable,
> (is_dir_bin ||
> (guestfs_is_symlink (g, "/bin") > 0 &&
> guestfs_is_dir (g, "/usr/bin") > 0)) &&
> - guestfs_is_file (g, "/etc/fstab") > 0) {
> + (guestfs_is_file (g, "/etc/fstab") > 0 ||
> + guestfs_is_file (g, "/etc/hosts") > 0)) {
/etc/hosts could be present on any UNIX pretty much (so could /etc/fstab
for that matter).
If you want Linux then...
2016 May 05
0
[PATCH v2] inspect: check also /etc/hosts for detecting Linux root (RHBZ#1203898)
.....e9976cf 100644
--- a/src/inspect-fs.c
+++ b/src/inspect-fs.c
@@ -217,7 +217,8 @@ check_filesystem (guestfs_h *g, const char *mountable,
else if (is_dir_etc &&
(is_dir_bin ||
is_symlink_to (g, "/bin", "usr/bin") > 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....
2013 Jun 07
1
[PATCH] inspect: Fix bogus warning for partitions without /boot.ini
...ws.c
+++ b/src/inspect-fs-windows.c
@@ -154,7 +154,7 @@ guestfs___get_windows_systemroot (guestfs_h *g)
* systemroot locations */
CLEANUP_FREE char *boot_ini_path =
guestfs___case_sensitive_path_silently (g, "/boot.ini");
- if (boot_ini_path) {
+ if (boot_ini_path && guestfs_is_file (g, boot_ini_path)) {
CLEANUP_FREE_STRING_LIST char **boot_ini =
guestfs_read_lines (g, boot_ini_path);
if (!boot_ini) {
--
1.8.2.1
2017 Jun 16
1
[PATCH] inspection: Deprecate APIs and remove support for inspecting installer CDs.
...1;
-
- fs->type = OS_TYPE_LINUX;
- if (STRPREFIX (fs->product_name, "Ubuntu"))
- fs->distro = OS_DISTRO_UBUNTU;
- else if (STRPREFIX (fs->product_name, "Debian"))
- fs->distro = OS_DISTRO_DEBIAN;
-
- (void) guestfs_int_parse_major_minor (g, fs);
-
- if (guestfs_is_file (g, "/.disk/cd_type") > 0) {
- CLEANUP_FREE char *cd_type =
- guestfs_int_first_line_of_file (g, "/.disk/cd_type");
- if (!cd_type)
- return -1;
-
- if (STRPREFIX (cd_type, "dvd/single") ||
- STRPREFIX (cd_type, "full_cd/single"))...
2016 Mar 17
2
[PATCH] inspect: improve UsrMove detection (RHBZ#1186935)
...(is_dir_etc &&
(is_dir_bin ||
- (guestfs_is_symlink (g, "/bin") > 0 &&
- guestfs_is_dir (g, "/usr/bin") > 0)) &&
+ is_symlink_to (g, "/bin", "usr/bin") > 0) &&
guestfs_is_file (g, "/etc/fstab") > 0) {
fs->is_root = 1;
fs->format = OS_FORMAT_INSTALLED;
@@ -366,6 +366,22 @@ get_partition_context (guestfs_h *g, const char *partition,
return 0;
}
+static int
+is_symlink_to (guestfs_h *g, const char *file, const char *wanted_target)
+{
+ CL...
2010 Aug 02
5
[PATCH v3 0/5] Inspection code in C
The first three patches were posted previously:
https://www.redhat.com/archives/libguestfs/2010-July/msg00082.html
The last two patches in this series change guestfish -i to use
this new code.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to
2016 Jan 26
1
[PATCH] inspect: resolve symlinks when detecting architecture
...spect-fs-unix.c b/src/inspect-fs-unix.c
index f915e86..75c76f8 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -1082,10 +1082,22 @@ check_architecture (guestfs_h *g, struct inspect_fs *fs)
char *arch;
for (i = 0; i < sizeof binaries / sizeof binaries[0]; ++i) {
- if (guestfs_is_file (g, binaries[i]) > 0) {
- /* Ignore errors from file_architecture call. */
+ /* Allow symlinks when checking the binaries:,so in case they are
+ * relative ones (which can be resolved within the same partition),
+ * then we can check the architecture of their target.
+ */
+...
2010 Jul 29
4
[PATCH 0/3] Inspection code in C
These three patches (two were previously posted) can do simple
operating system inspection in C.
Example of use:
><fs> add-ro rhel55.img
><fs> run
><fs> inspect-os
/dev/VolGroup00/LogVol00
><fs> inspect-get-type /dev/VolGroup00/LogVol00
linux
><fs> inspect-get-distro /dev/VolGroup00/LogVol00
rhel
><fs> inspect-get-arch
2010 Aug 17
8
[PATCH v4 0/8] Inspection code in C
Previously discussed here:
https://www.redhat.com/archives/libguestfs/2010-August/msg00002.html
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/